Skip to content

Commit f4dde1d

Browse files
committed
Fix terrain normal/displacement mapping
1 parent 942315d commit f4dde1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/shaders/compatibility/terrain.vert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void main(void)
4646
normalToViewMatrix = gl_NormalMatrix;
4747

4848
#if @normalMap
49-
mat3 tbnMatrix = generateTangentSpace(vec4(1.0, 0.0, 0.0, -1.0), passNormal);
49+
mat3 tbnMatrix = generateTangentSpace(vec4(1.0, 0.0, 0.0, 1.0), passNormal);
5050
tbnMatrix[0] = -normalize(cross(tbnMatrix[2], tbnMatrix[1])); // our original tangent was not at a 90 degree angle to the normal, so we need to rederive it
5151
normalToViewMatrix *= tbnMatrix;
5252
#endif

0 commit comments

Comments
 (0)