Account for inverted tangents on normal-mapped objects (bug #3733)

pull/2151/head
Capostrophic 5 years ago
parent 650ac65510
commit 731f91759e

@ -3,6 +3,7 @@
Bug #2987: Editor: some chance and AI data fields can overflow
Bug #3623: Fix HiDPI on Windows
Bug #3733: Normal maps are inverted on mirrored UVs
Bug #4329: Removed birthsign abilities are restored after reloading the save
Bug #4383: Bow model obscures crosshair when arrow is drawn
Bug #4411: Reloading a saved game while falling prevents damage in some cases

@ -68,7 +68,7 @@ void main()
vec3 normalizedNormal = normalize(passNormal);
vec3 normalizedTangent = normalize(passTangent.xyz);
vec3 binormal = cross(normalizedTangent, normalizedNormal);
vec3 binormal = cross(normalizedTangent, normalizedNormal) * passTangent.w;
mat3 tbnTranspose = mat3(normalizedTangent, binormal, normalizedNormal);
vec3 viewNormal = gl_NormalMatrix * normalize(tbnTranspose * (normalTex.xyz * 2.0 - 1.0));

Loading…
Cancel
Save