generated from krampus/template-godot4
20 lines
536 B
Plaintext
20 lines
536 B
Plaintext
|
shader_type spatial;
|
||
|
render_mode unshaded;
|
||
|
|
||
|
uniform vec4 color_low: source_color = vec4(0.0, 0.0, 0.0, 1.0);
|
||
|
uniform vec4 color_hi: source_color = vec4(1.0, 1.0, 1.0, 1.0);
|
||
|
|
||
|
uniform float threshold: hint_range(0.0, 1.0) = 0.5;
|
||
|
uniform float speed = 0.5;
|
||
|
uniform float y_scale = 1.0;
|
||
|
|
||
|
uniform sampler3D noise: repeat_enable;
|
||
|
|
||
|
|
||
|
void fragment() {
|
||
|
vec4 noise_color = texture(noise, vec3(UV.x, UV.y * y_scale, TIME * speed)).rgba;
|
||
|
|
||
|
vec4 color = noise_color.r > threshold ? color_hi : color_low;
|
||
|
ALBEDO.rgb = color.rgb;
|
||
|
ALPHA = color.a;
|
||
|
}
|