Prevent drawing of shadow caps when turned off
This commit is contained in:
@@ -3,6 +3,7 @@ layout (triangles) in;
|
||||
layout (triangle_strip, max_vertices = 3) out;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
layout(location=0)uniform vec3 lightPos;
|
||||
in float drawbit[];
|
||||
// this code is duplicated in lineShadow.geom, should not be changed on its own
|
||||
vec4 projNear (vec4 pos)
|
||||
{
|
||||
@@ -20,7 +21,8 @@ void main()
|
||||
vec4 p2 = gl_in[2].gl_Position ;
|
||||
if ( //if Light Source is below all vertices, draw cap
|
||||
// TODO think about when LS is beside the object
|
||||
( p0.z - lightPos.z > 0 )
|
||||
(drawbit[0] == 1)
|
||||
&& ( p0.z - lightPos.z > 0 )
|
||||
&& ( p1.z - lightPos.z > 0 )
|
||||
&& ( p2.z - lightPos.z > 0 )
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user