Continue work on shadow rendering
This commit is contained in:
@@ -9,9 +9,9 @@ vec4 projNear (vec4 pos)
|
||||
// note we project to a specific height
|
||||
// this is quite brittle, not ideal
|
||||
vec3 dir = pos.xyz - lightPos ;
|
||||
float a = (140 - pos.z) / dir.z ;
|
||||
float a = (100 - pos.z) / dir.z ;
|
||||
vec2 xy = (pos.xyz + a * dir).xy ;
|
||||
return vec4 ( xy, 140 , 1) ;
|
||||
return vec4 ( xy, 100 , 1) ;
|
||||
}
|
||||
void main()
|
||||
{
|
||||
@@ -28,8 +28,8 @@ void main()
|
||||
// the front cap
|
||||
vec4 v1 = vec4 (0,0,1,0) ;
|
||||
gl_Position = theMat * projNear(p0); EmitVertex();
|
||||
gl_Position = theMat * projNear(p1); EmitVertex();
|
||||
gl_Position = theMat * projNear(p2); EmitVertex();
|
||||
gl_Position = theMat * projNear(p1); EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
else {}
|
||||
|
||||
Reference in New Issue
Block a user