init
This commit is contained in:
15
assets/shaders/rain.frag
Normal file
15
assets/shaders/rain.frag
Normal file
@@ -0,0 +1,15 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user