Attempting to pass uint around in thin instance shader

For shader debugging purposes, I’m trying to pass flags into a thin instance shader… and failing. If line 52 is uncommented, the circles no longer render. (No errors on console.) Clues?

https://playground.babylonjs.com/#D2SV4S

I do have an error in the console (Chrome):

[.WebGL-0000368E00A54E00] GL_INVALID_OPERATION: Vertex shader input type does not match the type of the bound vertex attribute.

That’s because thinInstanceSetBuffer only supports Float32Array as buffers. You can use a float instead of an uint in your shader (GPUs are bad with integers anyway):

3 Likes

Thanks. In operation: https://playground.babylonjs.com/#D2SV4S#5

(Chrome seems to filter errors by type at a certain point. I had cleared the console after the errors and before the last run.)