Rain and more

This commit is contained in:
Gabrieal Jimmy
2026-10-02 13:04:49 -05:00
parent 2c99305fb0
commit 16c03afd16
15 changed files with 374 additions and 46 deletions

View File

@@ -35,7 +35,10 @@ void main() {
vec2 ps = pc.xy / pc.w * 0.5 + 0.5;
vec2 d = (gl_FragCoord.xy * uScreen.zw - ps) * vec2(uScreen.x * uScreen.w, 1.0);
float fragDepth = (uViewProj * vec4(v.worldPos, 1.0)).w;
float fade = (1.0 - smoothstep(0.07, 0.15, length(d))) * step(fragDepth, pc.w - 1.0);
// Only geometry above the sprite's head fades: low walls and trunk bases
// stay solid, the player is still readable over them.
float aboveHead = smoothstep(uBlob.y + 0.9, uBlob.y + 1.4, v.worldPos.y);
float fade = (1.0 - smoothstep(0.07, 0.15, length(d))) * step(fragDepth, pc.w - 1.0) * aboveHead;
if (ign(gl_FragCoord.xy) < fade * 0.85) discard;
}