Copy link to clipboard
Copied
I heard mention on a video that this was possible, but unsure where to start. Wondering if someone has some ideas?
Copy link to clipboard
Copied
Hello converting World Normals to Tangent Normals is absolutely possible using a Pixelprocessor, although it involves a little linear algebra and the use of matrices, which are not part of the function set in Substance 3D Designer.
These have to be build from scratch, which can be a little tricky.
I have some of the needed functions lying around and I should be able to create you a Node, which does this, today or tomorrow.
If you want to give it a try by yourself, here is a step by step explanation of the workflow:
I hope this helps and if you have one or two days, I would be very happy to create such a node for you.
Stay healthy and creative Marco
Copy link to clipboard
Copied
Legendary, thanks for the response!
Will definitely give this a go, but if you have the space for it, if you could create a node I would be absolutely over the moon.
Copy link to clipboard
Copied
You could also try the World Space Direction baker, using your existing World Space Normal texture as a direction file.
Dave
Copy link to clipboard
Copied
That's true, I didn't think about that. But but approximating the direction, from a position map is not that complicated either 😉
Stay healthy and creative Marco
Copy link to clipboard
Copied
Good Morning,
I think I got it, and while I was building the node, I found out, that inverting the TBN matrix isn't really neccessary, because of the construction of the matrix, they are always orthogonal, so a simple dot product of the three vectors should do.
Make sure your baker settings are set like this, especially the .tif file format is important, so you get 32Bit Floating Point precision, which results in an accurate Normal map. Especially for the position map, this is important, because of possible negative values, which would be clamped to 0 when not using 32Bit floating point Textures.
Stay healthy and creative Marco
Copy link to clipboard
Copied
Thanks so much for this! It looks like it's pretty close to being exactly what I was after. Would love to shout you a coffee somehow after this!
I am however encountering an issue where when plugging in the Position Map, it seems to (perhaps) not calculate smoothed normals, instead showing as hard edged?
Copy link to clipboard
Copied
This looks like it's calculating smooth normals pretty fine, the hard edges come from the flattened 2D representation of your 3D model. I'm not at my PC, so I try to explain what happens without any illustrations, I hope this is understandable.
Smooth Normals are basically interpolation the normals at any vertex by averaging the normals of adjacent faces, these averages get interpolated barycentric over every triangle of the mesh. World Normals are relative to the object space, Tangent Normals are relative to the tangent of each face, hard Tangent Normals would result in a Normal vector pointing in (0,0,1) direction from each face, so the resulting Normal map would be rgb(0.5,0.5,1.0). Since your resulting Normal map has different color gradients across every face it means, these are interpolated Normal vectors, converted into tangent space and mapped to your UVs, the hard edges come from the fact, that these Normals are relative to each face and basically compensate the direction of the hard faces, at the edges the Normals are pointing in different direction, because they are averaging the direction from different tangents. Try to apply this Normal Map to your mesh and the normals should be smooth. I hope that was understandable.
By the way, I'm always in for a good espresso https://marcovitale.gumroad.com/coffee 😉
Stay healthy and creative Marco
Copy link to clipboard
Copied
Cheers for the explanation Marco. Unfortunately it seems the normals aren't coming through as smooth when applied to the model here... (So very close to achieving the tool I need for stylized, procedurally painterly normals)
Copy link to clipboard
Copied
OH I see,
I tested something, which is very promising. Instead of calculating the Tangent Direction, you can just bake it, which results in very smooth normals.
I updated the Node, with another Pixelprocessor which takes the World Normals and the two directions maps as Inputs and it seems to work fine.
Stay healthy and creative Marco