Use depth fail and front cap for geometry shadows (TODO back cap)

This commit is contained in:
2021-08-30 21:47:01 +01:00
parent f87b53bbf9
commit f797530cbc
3 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ void main()
vec4 p0 = gl_in[0].gl_Position ;
vec4 p1 = gl_in[1].gl_Position ;
vec4 p2 = gl_in[2].gl_Position ;
if ( dot( lightPos, cross( p0.xyz - p1.xyz, p1.xyz - p2.xyz)) < 0)
if ( dot( p0.xyz - lightPos, cross( p0.xyz - p1.xyz, p1.xyz - p2.xyz)) < 0)
{
gl_Position = theMat * p0; EmitVertex();
gl_Position = theMat * p1; EmitVertex();