Simplify ceiling oclusions

This commit is contained in:
2025-11-02 19:20:57 +00:00
parent 0d0c1a72e0
commit 2f0487a424
8 changed files with 178 additions and 171 deletions
+4 -12
View File
@@ -1,4 +1,5 @@
#version 450 core
layout(early_fragment_tests) in;
layout(location=0)uniform vec3 lightPos;
layout(location=1)uniform vec4 lumRad;
layout (binding = 0) uniform sampler2D screenTexture;
@@ -15,20 +16,11 @@ void main() {
}
vec4 normbit = texture(normals, vTexPos);
vec3 norm = normbit.xyz;
float y1 = dot(normalize(norm), normalize(distVec));
float y1 = dot(norm, distVec);
float y2 = float(y1 > 0 ? 1 : 0);
//float y3 = clamp(0.5 * (y1 + 1),0,1) ;
float y3 = clamp(2*y1 + 1,0,1) ;
//float y3 = clamp(0.5 * (y1 + 2),0,1) ;
//float y = float(normbit.w == 0 ? y3 : y2);
float y = y2;
//float x = 1 - dist / rad;
float x = 1 - (pow(dist / rad,4));
//float x = 1 ;
//float x = 1 - (dist / rad);
//float x = 1;
//float x = 1 - max(0, ((dist + 10000) - rad) * 0.0001) ;
//vec3 c = y* (x * x * x) * lumRad.rgb;
vec3 c = y* x * lumRad.rgb;
//vec3 c = x * lumRad.rgb;
vec3 c = y2* x * lumRad.rgb;
fColor = vec4(c, 0);
}
+4 -4
View File
@@ -67,10 +67,10 @@ void main() {
vec2 closeshift = (rad * normalize(closepoint - lightPos.xy)) + lightPos.xy - closepoint;
vec2 shifto = (rad * normalize(closepoint - lightPos.xy)) + closepoint;
//vec2 p1o = vec2( distance(p1,lightPos.xy) > rad ? p1 : shift(p1) );
vec2 p1o = xoo;
//vec2 p2o = vec2( distance(p2,lightPos.xy) > rad ? p2 : shift(p2) );
vec2 p2o = yoo;
vec2 p1o = vec2( distance(p1,lightPos.xy) > rad ? p1 : shift(p1) );
//vec2 p1o = xoo;
vec2 p2o = vec2( distance(p2,lightPos.xy) > rad ? p2 : shift(p2) );
//vec2 p2o = yoo;
gl_Position = theMat * vec4(p1o,-500,1); EmitVertex();
gl_Position = theMat * vec4(p1,-500,1); EmitVertex();