I have a triplanar pbr material that I use to apply textures to a mesh without UVs. It works pretty well but I have an issue with the orientation of the texture, it seems to be rotated according to the plane it’s in :
As you can see, the texture is fine on the side, but in the front it is rotated by 90 degrees. Is there any way to fix this issue without manually changing the code of the triplanar texture block ?
There are ways to change the way the triplanar texturing applies by changing the input position.
For example, this material changes the way the texture is applied when the normal is close to (1,0,0), so that if you use the Cube model in the NME, you will see two faces that are different from the others:
Thank you, this indeed works for a cube or the model I originally sent. But would it be possible to make it work for something like a cylinder as well ? I tried lerping between the 2 values according to the dot product but couldn’t get it to work. I would like to keep the same rotation and avoid something like this :
Triplanar mapping is more suitable for cubic shapes than for rounded shapes…
That said, it can be improved in the case of a cubic projection to better align the faces of the cube, which is also useful for rounded shapes. This PR will add a switch to use this mode:
I tested it on the preview NME and it works perfectly with only the base color in the output node, but there seems to be a conflict with the PBRMetallicRougness node :
I don’t know if this is an easy fix, but again thank you for your reactivity, the switch appears to do exactly what I need otherwise (if I can get it to work with PBR and normal/aorm).