PDA

View Full Version : Computing Tangents after deforming mesh in shader



Moetman
07-11-2017, 05:50 PM
So I have a plane, I have sent in the Tangent attributes to the shader.
I have a normal and height map (normal map generated off line from height map). Height map is used to deform mesh, normal map (in tangent space) is used for lighting calcs
My question is: Now that I have deformed the mesh, how can I recalculate the tangents using only the old tangent value, the normal map, the old pos and the new pos? Especially if you are
using Tessellation shaders? The pre-computed tangent/binormal is going to be useless here isn't it?

Is this possible? or should I just use object space normal maps?

Regards

GClements
07-12-2017, 01:02 AM
Why would the tangents need to be recalculated?