Thin Instanced squares or triangles sharing the same projection texture?

I am not very sure how to handle the situation in BJS.
I would like multiple thin instanced meshes (triangles or quads) to share the same texture.
Ideally a procedural one.

But, my issue is how do I tell BJS to do that? Please have a look at the uploaded picture, it shows what I am trying to achieve.
I let the full texture in the background so that you can see that the position of a shape takes what the texture should be at this place. In 3d, you would only have the two squares.

The squares are on the same plane, like in a 2D world. But that could evolve in the future.

How can I achieve this ? I thought I should take the idea of a triplanar mapping as a base but remove the z part. Not sure… I am asking for opinions here.


You can try to add an offset to the coordinate textures, as in:


1 Like

Thanks Evgeni, I will try that