Context: I’ve been working on an add-on in Blender that automatically connects nodes to mix full PBR materials together through a simplified interface with a layer stack, available free here: https://github.com/LoganFairbairn/matlay
I’ve created a custom triplanar projection method with a combination of personal experience and shader examples found online which seems to work well.
This custom triplanar projection is being used instead of box projection mainly because normal maps seem to be inverted when using Blenders default box projection from the image texture node, (see How to fix box-projected normal maps? for more details) but also has other advantages, like the ability to offset, rotate and scale projected axis individually.
For this add-on I need to be able to mix multiple PBR materials together in the shader nodes, to do so I convert the triplanar projection normals (which I believe are in object space) to tangent space using the solution found here How to convert object space normals to tangent space?, however this leads to visible seams for normals around UV breaks.
Question: Is there any way to convert world space to tangent space without ending up with seams? Am I missing a step or a setting somewhere in the material nodes? Is there a completely different alternative to achieve triplanar projection with correct normals and rotations?
Triplanar projection converted to tangent space (note the visible seam in normals down the top of the models head):
You can download the blend file with the triplanar projection setups here: https://github.com/LoganFairbairn/matlay/blob/main/blend/Matlay.blend
The textures used in the screenshots are not packed into the blend, you can use your own or download the one I used here: https://ambientcg.com/view?id=Rock037
I’m actively working on a solution for this, and any help is really appreciated!