Thin Instance on shader material

I just noticed that thin instances don’t work on ShaderMaterial but work on StandardMaterial, I don’t quite know all about thin instances but does anyone know how to make it work on ShaderMaterial? I believe it has something to do with the attributes.

testing playground: https://playground.babylonjs.com/#MT2SFV

You need to add some includes in your shader to support instances / thin instances:

https://playground.babylonjs.com/#MT2SFV#1

3 Likes

Wow thanks, I was on this for long so I decided to leave it but know I can continue

@Evgeni_Popov Just one quick question, is it possible to use thin instance buffers with both translation and rotation or is only one the limit? because the docs say “position/rotation/scaling.”

Yes, you can have a position + rotation + scaling: you must give a matrix to create a thin instance, and a matrix can hold at the same time a position + a rotation + a scaling.

1 Like

Thanks, I got it working.