Texture offset for instanced mesh using custom shaders

The title sums up what I am trying to achieve. I faced a problem during the implementation of this. What I did: I created instanced mesh, put geometry and shader material, amount inside. I passed texture to GLSL in shaders uniform and successfully set it on the mesh. But here’s a thing: I can see only a single instance instead of my amount.

The shader documentation mentions an extra variable passed to shader when using instance mesh. Search for #ifdef USE_INSTANCING here. Hope this helps

1 Like

Oh, I just noticed it. Thanks :wink:

gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position,1.0);
2 Likes