move noise shader into shaders folder
This commit is contained in:
parent
6309bce63f
commit
6863a8a387
2 changed files with 1 additions and 1 deletions
19
assets/shaders/noise.gdshader
Normal file
19
assets/shaders/noise.gdshader
Normal file
|
@ -0,0 +1,19 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform bool animate_noise = false;
|
||||
uniform float noise_intensity = 1.0;
|
||||
uniform float fps = 60.0;
|
||||
|
||||
float random (vec2 uv) {
|
||||
return fract(sin(dot(uv.xy,
|
||||
vec2(12.9898,78.233))) * 43758.5453123);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
float time = floor(fract(TIME) * fps);
|
||||
vec2 noise_uv = SCREEN_UV + time * float(animate_noise);
|
||||
float noise = random(noise_uv);
|
||||
noise = mix(1.0 - noise_intensity, 1.0, noise);
|
||||
|
||||
COLOR = vec4(COLOR.rgb * noise, COLOR.a);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue