Is it possible to set UV offset per instance for thinInstances ? It would be great to have spritesheet and select appropriate texture per-instance.
In documentation, the only “kind” mentioned is “matrix” which I am using to create instance at specific location. I have also found info on the internet, that basic colors are also supported, so I wonder if there is something else ? Like that UV offset or maybe scaling ?
Latest info I have found is from 2021 (that only matrix and color is supported) but maybe something changed since then.
Ofc I can live without it (and use Solid Particle System in some cases)
You can use thinInstance buffers and a customMaterial, or like the instanceId and a buffer texture, or a storrageBuffer etc.
There are a bunch of ways to do this!
Look up how to do custom thin instance buffers, it would be the same as the example where it shows how to do colors, but just do it with a vec2 array buffer and make the appropriate modifications to a CustomMaterial.
Thanx for your answer, I can offcourse create buffer with Vec2 that would contain UV data as needed.
But how would CustomMaterial know, that it shall somehow use that data ? Sorry for maybe lame question, I am not that advanced Babylon.js user - but when I set that buffer via thinInstanceSetBuffer, wouldnt that CustomMaterial just ignore it ?
Thanx for that links - I have followed the first one and it is about “basic” instances, not thin instances - is tne principle applicable for both then ?
And I created 1 thin instance, custommaterial (as it was) and then I created uvcBuffer with only two values (as I only have 1 instance) but not matter what numbers I put into that buffer, the result is always the same (unchanged).
Am I missing something crucial ? I believe that buffer shall still be of type Float32Array and to that Array I just need to fill UV coordinates as needed.