vignette.shader 316 B

1234567891011
  1. shader_type canvas_item;
  2. uniform sampler2D vignette;
  3. void fragment() {
  4. vec3 vignette_color = texture(vignette, UV).rgb;
  5. // Screen texture stores gaussian blurred copies on mipmaps.
  6. COLOR.rgb = textureLod(SCREEN_TEXTURE, SCREEN_UV, (1.0 - vignette_color.r) * 4.0).rgb;
  7. COLOR.rgb *= texture(vignette, UV).rgb;
  8. }