Simple noise overlay

Noise Texture overlay on top of Texture.

Usage Instructions:

– use this shader on a Texture

– use noiseTexture with var noise

Shader code
shader_type canvas_item;

uniform vec2 direction = vec2(1, 0);
uniform float speed = 0.1;
uniform sampler2D noise;

vec4 overlay(vec4 base, vec4 blend){
	vec4 limit = step(0.5, base);
	return mix(2.0 * base * blend, 1.0 - 2.0 * (1.0 - base) * (1.0 - blend), limit);
}

void fragment()
{
	// image texture
	vec4 base = texture(TEXTURE, UV);
	// noise texture
	vec4 blend = texture(noise, UV + ( direction * speed * TIME));
	
	COLOR = overlay(base, blend);
}
Tags
bar, noise, overlay
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 MacNaab

Input / Ouput

Related shaders

Simple moving noise with glow

Simple UI Noise Mask

Texture based overlay (animated)

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Rajbir Modak
Rajbir Modak
1 year ago

Cool shader

Last edited 1 year ago by Rajbir98
TheYellowArchitect
2 months ago

Excellent shader. Gif doesn’t do it justice. I personally used it for some status orbs which felt static, now they feel mystical