Emphasize the importance of mipmaps for textureLod() in Screen-reading shaders

This also mentions that reading the normal/roughness buffer is only
currently supported in Forward+.
This commit is contained in:
Hugo Locurcio
2023-10-26 02:25:20 +02:00
parent c1d835834d
commit 9773552257
4 changed files with 23 additions and 10 deletions

View File

@@ -30,14 +30,13 @@ Here is a complete shader example based on these guidelines:
shader_type canvas_item;
// Screen-space shader to adjust a 2D scene's brightness, contrast
// and saturation. Taken from
// https://github.com/godotengine/godot-demo-projects/blob/master/2d/screen_space_shaders/shaders/BCS.shader
// https://github.com/godotengine/godot-demo-projects/blob/master/2d/screen_space_shaders/shaders/BCS.gdshader
uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
uniform float brightness = 0.8;
uniform float contrast = 1.5;
uniform float saturation = 1.8;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
void fragment() {
vec3 c = textureLod(screen_texture, SCREEN_UV, 0.0).rgb;