Scene Texture Depth?

I’m trying to set up a postprocess material that uses the scene depth, but the scene depth node doesn’t seem to be outputting the depth. When I plug it directly in to the output to see what’s going on, it seems to just be outputting a uniform white (output value 1?) for the entire screen regardless of depth. At first I thought that maybe the values were just all above 1, but I tried multiplying the result by a fraction and it really does seem to be completely uniform. Why is this and how can I access the per pixel scene depth?

Hi Steyr -

Scene Depth is correct but it has to be used in a comparative fashion so you want to look at it divide by some value to give you a range in which to compare a value. Look here for more information.

If you let me know exact the effect you are going for I can try to help you work out the comparison.

Thank You

Eric Ketchum

could i divide scene depth by pixel depth to get the distance from water surface to the ground beneath it

Hey Reactant -

Take a look at the informational page in documentation above. Yes, you could but you will need to set the limits of the pixel and scene depth being tested. (Look at the divide nodes in the Material examples).

Thank You

Eric Ketchum

The question might be old, but the problem is still valid.

Your guess is indeed correct: When using SceneTexture:SceneDepth you need to divide the Color Output by a “distance” value. And it should be quite high e.g. 2000. Additionally you probably need to boost the contrast of the result the way you like…

219832-depth.png