Vignette with changeable blur size

vignetter shader ported from shadertoy to godot4 with changeable blur size 

Shader code
//Vignette Shader

//see more info about shaders here --> https://github.com/TechnoLukas/My-favourite-shaders-links
//ported with https://github.com/jayaarrgh/shadertoy2godot (with some hand fixing)
//on shadertoy https://www.shadertoy.com/view/WsGSD3

shader_type canvas_item;
uniform float size;

void fragment() {
	
	vec2 uv=UV;
	vec2 suv = abs(uv * 2.0 - 1.0);
	vec4 col = texture(TEXTURE, uv);
	vec2 u = vec2(size / (1.0/TEXTURE_PIXEL_SIZE));
	u = smoothstep(vec2(0), u, 1.0 - suv);
    
	COLOR = col * u.x * u.y;
}
Tags
godot4, shader, vignette
This shader is a port from an existing Shadertoy project. Shadertoy shaders are by default protected under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) license unless anything else has been stated by the author. For more info, see our License terms.

More from TechnoLukas

Combine two Shaders

Related shaders

Blur Vignette (Post Processing / ColorRect) [Godot 4.2.1]

Chromatic Aberration Vignette

Player Vignette

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
smone
smone
1 year ago

How Do i Apply it