Files
Vibe-HD-2D/assets/shaders/rain.frag
Gabrieal Jimmy 2c99305fb0 init
2026-10-02 12:42:00 -05:00

16 lines
530 B
GLSL

#version 450 core
#include "common.glsl"
// Thin, slightly bright streak lit by the overcast sky. Premultiplied alpha.
in vec2 vLocal;
in float vAlpha;
layout(location = 0) out vec4 fragColor;
void main() {
float across = 1.0 - abs(vLocal.x);
float along = (1.0 - vLocal.y) * smoothstep(0.0, 0.15, vLocal.y + 0.05); // bright head, fading tail
float a = across * across * along * vAlpha * 0.6;
vec3 c = hemiAmbient(vec3(0.0, 1.0, 0.0)) * 2.0 + uSunColor.rgb * uSunDir.w * 0.2;
fragColor = vec4(c * a, a);
}