Vignette

For this shader to work in your project you must:

1. Create a Color Rect.

2. Within the Color Rect, go to Material and create a Shader Material.

3. You attach this shader to the Shader Material.

Shader code
shader_type canvas_item;

uniform float outerRadius : hint_range(0.0, 5.0) = 1.0;
uniform float MainAlpha : hint_range(0.0, 1.0) = 1.0;
uniform vec4 vignette_color: source_color;

void fragment() {
	float x = abs(UV.x-.5)*2.0;
	float y = abs(UV.y-.5)*2.0;
	float v = (sqrt((x*x)+(y*y))/outerRadius);
	COLOR = vec4(vignette_color.rgb,v*MainAlpha);
}
Tags
4.x, black, canvas_item, Color, customizable, godot, vignette, white
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.

Related shaders

Vignette with reduced banding artifacts

Chromatic Aberration Vignette

Aberration Vignette – Phasmophobia effect

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments