I’m working on a 3D game with 2D graphics. I was using a sprite renderer but I’ve moved to using a mesh renderer on a plane instead for long auto-tileable meshes such as walls, ramps, or floors.
I like having these meshes use world-space for the textures. This lets me edge snap 2 meshes together and have the texture lines up. (example: the 2 vertical planes in the image).
Using a Triplanar node, I can have the mesh tile the MainTex automatically when i scale the plane.
I can also scale the texture size with the Tile option.
This works great on a Z or X rotation of 0 or 90, but once i rotate anywhere in between the texture stretches or doubles like on the 45degree plane in this image.
How can I make a shader graph, or custom function for a shader graph to fix the normals for this?
This is an expected outcome of triplanar shading and you can’t really do anything about that.
You can try to tweak the blend value to have the texture “jump” from front to top projection, but there is no way of having the texture properly tile in the 3 dimensions without breaks, like you can see in the angle of the XZ and ZY planes (bottom left) in your screenshot.
You could look into doing yourself the triplanar projection and use an additional heightmap for the blending, to have the stones of the texture to be more visible. Search for “triplanar” and “height blend”.
Thanks, for the reply Remy. This is still a bit above me. I didn’t realize how complex this was until I started messing with it. If I figure this out I’ll post a reply, otherwise I’m open to help if anyone can help make a working sample.
I just wanted a 2d texture on a plane that I could
adjust tilescale and have the pattern repeat in both directions when I scaled the plane object.
rotate the plane in any direction
have the texture align to world space so any 2 planes using this material would align properly if i snapped them together.