15 lines
568 B
Plaintext
15 lines
568 B
Plaintext
shader_type canvas_item;
|
|
|
|
uniform vec4 fog_color : source_color = vec4(0.85, 0.9, 0.95, 1.0);
|
|
uniform float clear_center_radius : hint_range(0.0, 1.0) = 0.4;
|
|
uniform float edge_softness : hint_range(0.01, 1.0) = 0.5;
|
|
uniform float max_opacity : hint_range(0.0, 1.0) = 0.8;
|
|
|
|
void fragment() {
|
|
float dist_from_center = distance(SCREEN_UV, vec2(0.5));
|
|
float fog_amount = smoothstep(clear_center_radius, clear_center_radius + edge_softness, dist_from_center);
|
|
|
|
fog_amount *= max_opacity;
|
|
|
|
COLOR = vec4(fog_color.rgb, fog_color.a * fog_amount);
|
|
} |