speedin-santa/Shaders/Snow.gdshader

14 lines
482 B
Plaintext

shader_type spatial;
uniform sampler2D noise;
uniform float noiseScale = 1;
uniform float snowLevel = 0.9;
uniform float speedScale = 1;
void fragment() {
float val = texture(noise, vec2(UV.x * noiseScale + -TIME * speedScale, UV.y * noiseScale + TIME * speedScale)).x;
float val2 = texture(noise, vec2(UV.x * noiseScale + TIME * -speedScale / 2.0, UV.y * noiseScale + TIME * speedScale)).x;
EMISSION = vec3(0.5, 0.5, 0.5);
if (val < snowLevel && val2 < snowLevel) discard;
}