breadwinner/shaders/blur_shader.gdshader

15 lines
559 B
Text
Raw Normal View History

2026-07-26 15:03:12 +02:00
shader_type canvas_item;
// Fetches the screen texture with mipmaps enabled for the blur effect
uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
2026-07-26 15:03:12 +02:00
// Allows you to adjust the blur strength in the inspector
uniform float blur_amount : hint_range(0.0, 5.0) = 2.5;
void fragment() {
// Sample the screen texture at the current screen UV, using the blur_amount as the mipmap level (LOD)
vec4 blurred_color = textureLod(screen_texture, SCREEN_UV, blur_amount);
// Output the blurred color
COLOR = blurred_color;
}