Continue work on shadow rendering

This commit is contained in:
2023-03-14 11:20:38 +00:00
parent 9947979b52
commit 6af041bb8c
20 changed files with 417 additions and 380 deletions
+3 -3
View File
@@ -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 {}