Rain and more
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user