Tested versions
- Reproducible in Godot Engine v4.3.stable.steam, with Compatibility renderer
System information
Window 10 - Godot Engine v4.3.stable.steam - Compatibility renderer
Issue description
When the screen resolution is changed, the shader that use hint_screen_texture will turn black, this radioactively happen to all shader that used hint_screen_texture even when they're not in the scene yet
I noticed that this will always happen when I look at a water, because my water shader use 'hint_depth_texture'
Steps to reproduce
- create a CSGBox3D with Shader material that use spatial shader, this shader will use "hint_depth_texture" here is the simple script :
shader_type spatial;
uniform sampler2D DEPTH_TEXTURE : hint_depth_texture;
void fragment() {
vec4 depth_texture = texture(DEPTH_TEXTURE, SCREEN_UV);
}
- create a color rect with Shader material that use canvas_item shader, this shader will use 'hint_screen_texture' here is the simple script :
shader_type canvas_item;
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture;
void fragment() {
COLOR = texture(SCREEN_TEXTURE, UV);
}
- If when the scene is running, the CSGBox3D is visible, the ColorRect will become black right away
- if when the scene is running and the CSGBox3D is not visible, ColorRect shader will work fine BUT when CSGBox3D turn visible later and then resize the window, it will become black
before resize :

after resize :

Minimal reproduction project (MRP)
test_depth_problem.zip
Tested versions
System information
Window 10 - Godot Engine v4.3.stable.steam - Compatibility renderer
Issue description
When the screen resolution is changed, the shader that use hint_screen_texture will turn black, this radioactively happen to all shader that used hint_screen_texture even when they're not in the scene yet
I noticed that this will always happen when I look at a water, because my water shader use 'hint_depth_texture'
Steps to reproduce
before resize :
after resize :
Minimal reproduction project (MRP)
test_depth_problem.zip