I can’t seem to capture the SceneDepth with a SceneCapture2D component in 4.27 that works normally in 4.17-4.26 and am wondering if that’s a known issue or what. Neither SCS_SceneColorSceneDepth nor SCS_SceneDepth produce valid pixels in the SceneDepth channel, instead just showing pure black or pure white (or not updating the channel at all!).
Any ideas on what I’m doing wrong? I’ve attached a screenshot of the configuration and the incorrect output.
This is how it has always worked in my experience… Scene depth is captured using Unreals base unit which is centimeters, any pixel with a depth more than 1 centimeter from the camera is going to display as white in the texture viewer. It’s not meant to be human readable.
If you want to view it you need to make a material to sample the texture and divide it by a large value.
To answer your question directly, yes capturing scene depth works in 4.27:
Interesting - I’ve actually been mostly working with the depth texture from C++ rather than using a SceneCaptureComponent2D and have been seeing differences between 4.26 and 4.27, but thought that what I was seeing with the SCC was the same issue. I guess not! Thanks for the help.
Can you show some better examples with some code snippets of what you’re doing?
Like Arklras said and demonstrated, you need to divide it by something so that you create a percentage range. In his case, he divided by 1000, which gives a 10m range. Anything further than that 1000 units will visually clamp to 1, unless you’re using it in some kind of HDR shader or emissive shader, in which case, it would glow brighter. Anything within that 0-1000 unit range will become a percentage of 1, so you get a greyscale out of it.
I’ve started a new question that addresses our actual concern since as ArkIras pointed out, this was a false alarm in that the SceneCapture approach does still work correctly in 4.27.