forked from team-sg/hero-mark-2
add noise shader to laser graphics
This commit is contained in:
parent
90cc0f0550
commit
5a9751946c
3 changed files with 51 additions and 2 deletions
17
shaders/color_noise.gdshader
Normal file
17
shaders/color_noise.gdshader
Normal file
|
@ -0,0 +1,17 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform bool animate_noise = false;
|
||||
uniform float noise_intensity = 1.0;
|
||||
|
||||
float random (vec2 uv) {
|
||||
return fract(sin(dot(uv.xy,
|
||||
vec2(12.9898,78.233))) * 43758.5453123);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
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