1

Bump mapping is really convenient because you take an input normal, you take a grayscale mask (height map), and you get the appearance of displacement. But it has visual quality problems due to being based off partial derivatives (dFdx, dFdy.)

Tangent mapping is high quality and can also represent displacement of the normals. But, all the tangent mapping workflows assume that you are working with a baked Tangent Normal Map texture. I want to get the same workflow convenience as using a bump map, but using tangent normal transforms instead. (I suppose this would essentially be TBN bump mapping, or something?)

I believe this is possible, but I can't quite figure out the nodes. I know it is not as simple as taking your normals and scaling them based on a mask. This does not produce surface displacements. I also know that you can't scale the normals and mix that with the base normals using the mask as a fac to get a difference, as normalization cancels out uniform scaling. (And I've course I've been through the various displacement nodes, but they don't work for this.)

As far as I can tell, what needs to happen is to convert the mesh's Object normals into tangent space, do the scale based on the mask, and then convert back. But I don't know what scale to do or how.

I have created this node group, which takes two Normals and a Tangent (from the tangent node, using a UV map) and returns the tangent normal difference (the same thing you'd get if you baked a tangent normal map): enter image description here

I have also recreated the Normal Map node, but with the base normals exposed as an input socket in this answer. enter image description here

Using these two groups I can get a tangent difference between two different normals and then apply it to the original normals. But I still need to get the other perturbed/custom normal in the first place!

I've also been looking at Mikkelsen2020, which talks about taking normals that have been perturbed in a variety of ways (weather tangent maps, object, or bump), converting them to Surface Gradients, combining or transforming them, and then converting back to regular Normal space. I've been able to build the stuff in code snippets as nodes, and it mostly seems to work, but I'm not entirely sure how to use it. Frankly, I can't read the mathematical formulas properly. The thing I'm looking for may well be in there, but I wouldn't be able to tell.

Anyone got any ideas? This seems like something that ought to be very straight forward and common, but I can't find any examples of it being done out there. What am I missing?

Ascalon
  • 6,579
  • 8
  • 55
  • 121

0 Answers0