Fix basic wall normal shading
This commit is contained in:
@@ -18,13 +18,17 @@ void main()
|
|||||||
vec4 p4 = vec4 (p2.xy,100,1);
|
vec4 p4 = vec4 (p2.xy,100,1);
|
||||||
vec2 d = vec2(p1.xy - p2.xy);
|
vec2 d = vec2(p1.xy - p2.xy);
|
||||||
vec4 norm = vec4( d.y, -d.x, 0, 0);
|
vec4 norm = vec4( d.y, -d.x, 0, 0);
|
||||||
gNorm = p1 - norm;
|
gPos = p1; tPos = vec2 ( 1,-1) ; gl_Position = vec4(theMat * p1);
|
||||||
gPos = p1; tPos = vec2 ( 1,-1) ; gl_Position = vec4(theMat * p1); EmitVertex();
|
gNorm = gPos - norm;
|
||||||
gNorm = p1 - norm;
|
EmitVertex();
|
||||||
gPos = p3; tPos = vec2 ( 1, 1) ; gl_Position = vec4(theMat * p3); EmitVertex();
|
gPos = p3; tPos = vec2 ( 1, 1) ; gl_Position = vec4(theMat * p3);
|
||||||
gNorm = p1 - norm;
|
gNorm = gPos - norm;
|
||||||
gPos = p2; tPos = vec2 (-1,-1) ; gl_Position = vec4(theMat * p2); EmitVertex();
|
EmitVertex();
|
||||||
gNorm = p1 - norm;
|
gPos = p2; tPos = vec2 (-1,-1) ; gl_Position = vec4(theMat * p2);
|
||||||
gPos = p4; tPos = vec2 (-1, 1) ; gl_Position = vec4(theMat * p4); EmitVertex();
|
gNorm = gPos - norm;
|
||||||
|
EmitVertex();
|
||||||
|
gPos = p4; tPos = vec2 (-1, 1) ; gl_Position = vec4(theMat * p4);
|
||||||
|
gNorm = gPos - norm;
|
||||||
|
EmitVertex();
|
||||||
EndPrimitive();
|
EndPrimitive();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user