Skip to content
Snippets Groups Projects
Commit 28ea6f60 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Apply beq's fix for vertex normals on normal mapped surfaces

parent 444d417b
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ void main()
vec3 n = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz);
#ifdef HAS_NORMAL_MAP
vec3 t = normalize((mat*vec4(tangent.xyz+position.xyz,1.0)).xyz-pos.xyz);
vec3 b = cross(n, t)*tangent.w;
vec3 b = normalize(cross(n, t)*tangent.w);
vary_mat0 = vec3(t.x, b.x, n.x);
vary_mat1 = vec3(t.y, b.y, n.y);
......@@ -123,7 +123,7 @@ vary_normal = n;
vec3 n = normalize(normal_matrix * normal);
#ifdef HAS_NORMAL_MAP
vec3 t = normalize(normal_matrix * tangent.xyz);
vec3 b = cross(n,t)*tangent.w;
vec3 b = normalize(cross(n,t)*tangent.w);
//vec3 t = cross(b,n) * binormal.w;
vary_mat0 = vec3(t.x, b.x, n.x);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment