Custom instance buffer trouble

Hello forum,

I have trouble using the registerInstancedBuffer feature. (How to pass custom attributes of each instance to the shader).

For example: Babylon.js Playground (

Thanks for any help!

See this PG with the fix:

First, you cannot directly declare attribute in fragment shader. I pass the value of attribute test to fragment shader by using a varying vTest. And set vTest to be the value from attribute test.

        vTest = test;

You also need to declare the custom attribute before using it.



Beautiful, thank you!