2019-07-05 04:20:59 +02:00
|
|
|
shader_type canvas_item;
|
|
|
|
|
2023-02-28 13:38:01 +01:00
|
|
|
uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
|
2019-07-05 04:20:59 +02:00
|
|
|
uniform sampler2D vignette;
|
|
|
|
|
|
|
|
void fragment() {
|
|
|
|
vec3 vignette_color = texture(vignette, UV).rgb;
|
2020-02-03 09:53:07 +01:00
|
|
|
// Screen texture stores gaussian blurred copies on mipmaps.
|
2023-02-28 13:38:01 +01:00
|
|
|
COLOR.rgb = textureLod(screen_texture, SCREEN_UV, (1.0 - vignette_color.r) * 4.0).rgb;
|
2019-07-05 04:20:59 +02:00
|
|
|
COLOR.rgb *= texture(vignette, UV).rgb;
|
|
|
|
}
|