Cleanup, correcly filter unimportant shadow silhouettes

This commit is contained in:
2025-11-12 23:10:33 +00:00
parent 5e9d337288
commit b012d3c41e
3 changed files with 10 additions and 19 deletions
+4 -13
View File
@@ -1,15 +1,16 @@
#version 450 core
struct PosColNorm { vec4 pos; vec4 dummy; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 lumRad; };
layout (std430, binding = 3) readonly buffer Data { PosColNorm data[]; };
layout (std430, binding = 4) readonly buffer Indices { uint indices[]; };
layout(location=0)uniform vec3 lightPos;
layout(location=1)uniform vec4 lumRad;
//layout(location=0)uniform vec3 lightPos;
//layout(location=1)uniform vec4 lumRad;
vec4 projNear (vec4 pos)
{
// note we project to a specific height
// this is quite brittle, not ideal
vec3 dir = pos.xyz - lightPos ;
vec3 dir = pos.xyz - lightPos.xyz ;
float a = (100 - pos.z) / dir.z ;
vec2 xy = (pos.xyz + a * dir).xy ;
return vec4 ( xy, 100 , 1) ;
@@ -27,13 +28,3 @@ void main() {
: vec4(1,1,1,0)
);
}
//layout (location = 0) in vec4 position;
//layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
//uniform vec3 lightPos;
//uniform vec4 lumRad;
//out float drawbit;
//void main()
//{
// gl_Position = vec4(position.xyz,1);
// drawbit = position.w;
//}