Static Overlay Shader

Modified version of the Static Overlay by jordancjb.

Changes:

  • Updated for Godot 4 to use uniform sampler2D screen_texture.
  • Removes cos() around TIME. Change is consistent across frames.
  • Adds contrast and multiplier shader arguments.
  • Makes noise additive instead of multiplicative.

Usage:

This works as a screen shader, and so can be applied to a ColorRect node that is filling the screen, any color, and drawn over your content (bottom of the scene tree).

The shader takes three arguments:

slow determines the rate at which the static changes over to time. Higher is slower.

multiplier determines the intensity the overal static.

contrast scales the white vs the blacks against each other.

Examples:

The settings in the cover image were multiplier to 0.75 and contrast to 4.0

The first screenshots includes a CRT shader.

Shader code
// Original by: Jordancjb (https://linktr.ee/jordancjb)

shader_type canvas_item;

uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;

//Noise Texture
uniform sampler2D noise;

//Settings
uniform float slow = 25.0;
uniform float multiplier = 0.5;
uniform float contrast = 2.0;

//Shader Code
void fragment() {
	vec4 noise_sample = texture(noise, texture(noise, UV).xy + mod(TIME, 1.0) / slow);
	noise_sample.rgb = pow(noise_sample.rgb, vec3(contrast));
	COLOR = texture(screen_texture, SCREEN_UV) + (noise_sample * multiplier);
}
Tags
Static
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Maaack

Tilt-Shift Shader (minimal)

Wind Area Effect

Related shaders

Static Overlay

Animated TV-Static Border Shader

Static grid (Rejilla estática)

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments