Re-add face culling as required for instanced shadow caps

This commit is contained in:
2023-03-14 11:26:32 +00:00
parent 6af041bb8c
commit bfd079ed2a
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -16,9 +16,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()
{
+3 -3
View File
@@ -22,13 +22,13 @@ 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);
};
vec4 shiftNear(vec4 pos) {
vec4 sp = shift(pos);
if (sp.z > 140) {
if (sp.z > 100) {
return projNear(pos);
} else {
return sp;
+1 -1
View File
@@ -261,7 +261,7 @@ instanceLightMap cfig pdata lightPoints nWalls nSils nCaps toPos = do
GL_UNSIGNED_SHORT
nullPtr
--draw caps on the near plane as required
--glEnable GL_CULL_FACE
glEnable GL_CULL_FACE
glCullFace GL_BACK
--glCullFace GL_FRONT
glUseProgram (_shadName lcapShad)