Scene Depth capture does not work

When using Capture Source: Scene Depth in a Scene Capture Component it is always just rendering plain red and nothing else, no matter what. It also appears someone forgot to add any range settings for it.

Hi Davision,

First, what are you trying to accomplish with SceneDepth? SceneDepth returns the distance (in cm) from the camera. This is a scalar value (there is no X, Y, or Z element to depth) and anything farther away than 1 cm gets an R value of >1.

A number greater than 1, in terms of color, renders as white. When you send white in the R channel with ‘SceneDepth in R’ as the Capture Source (and Black in G and B since we aren’t using them) the result is pure red.

It sounds like you are plugging your sceneTexture node into color, then setting it to SceneDepth, which will return bright red. You would want to mask out the result while also keeping in mind that Depth is a single number, not a vector.

As an example, here is a screen shot showing SceneDepth being used as intended. The ‘MaxDepth’ represents the distance from the camera that you expect depth to render as white (or return a value of 1.0).

220045-scenedepth.png

Regarding range settings, we actually try not to set limits unless hardware requires it.

2 Likes

Yea that is what I already did as a workaround now, making it with a post process material instead. It seems nobody ever tested all those scene capture settings. Writing only depth 0-1 in a texture hardly makes sense. The normal scene capture also makes no sense, it is normal -1 to 1 but the rendered texture is only 0-1. I also did a post process material for that instead.