Noise & Grain
This shader adds random noise to the image, creating a “grainy” or distorted effect that can be used to create a retro atmosphere, simulate old technologies (such as analog TV signals), or generate visual distortions typical of old video tapes and games.
Parameters:
- noise_intensity: Controls the intensity of the noise. The higher the value, the stronger the graininess and distortions on the image.
Shader code
shader_type canvas_item;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture;
uniform float noise_intensity : hint_range(0.0, 1.0) = 0.05;
float random(vec2 uv) {
return fract(sin(dot(uv, vec2(12.9898, 78.233))) * 43758.5453);
}
void fragment() {
vec2 uv = SCREEN_UV;
vec4 color = texture(SCREEN_TEXTURE, uv);
float noise = random(uv + TIME) * 2.0 - 1.0;
color.rgb += noise * noise_intensity;
COLOR = color;
}




