How to realize that there is a gap when the material is laid, and this gap can change the color and gap width?

I pasted a picture and the effect was as follows

Now I want to achieve the effect that there is a gap when spreading stickers, and the color and width of the gap can be changed. The effect is as follows:

I use MeshPhysicalMaterial for the texture of the paste, how to use. OnBeforeCompile method to modify shader to achieve the seam effect?

If I got you correctly, you need something like that:

Michael, could you enlighten me: I can’t get how .repeat() of THREE.Texture() works? Where and how does it make a texture repeating in materials?


Yes, this is just what I need. Thank you very much.

Altering offset, repeat or center will change a special matrix of Texture which transforms texture coordinates in the vertex shader.


A-ha, so it works without an additional uniform for repeat:

1 Like