Trouble with depth sampling

Godot Version

4.2.1

Question

so i’m trying to sample the scene depth behind a fragment, and it seems like the depth sample has gone through some recent changes. in particular DEPTH_TEXTURE looks like it’s been deprecated and DEPTH seems to be a custom parameter that doesn’t actually return the depth by default. i’ve been trying to read depth from uniform sampler2D depth_tex:hint_depth_texture; and add VERTEX.z but it seems like that’s also not set up correctly for me, because it always returns zero. i have my shader’s depth-write disabled so it shouldn’t just be sampling its own vertex.z anymore. is there some other step i need to do to sample depth?

solved! i was using the wrong UV. it was supposed to be SCREEN_UV. oops!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.