Clarification with SceneDepth Visualization
I am looking at the SceneDepth buffer visualization and somewhat confused at what it's doing. It's taking the scene depth texture (which I assume is the depth buffer) and multiplying by 0.0001 and then doing a frac on it? Can someone explain what the 0.0001 is and why it's doing a frac?
Also I am trying to create a buffer visualization which gives something similar to SceneDepthWorldUnits but instead of radially from the camera position, it'll be the accurate z distance from the camera plane. I tried using PixelDepth node as a start, but it just returns 1.0. Is that being clamped due to shader precision, or something I am doing wrong?
I tried SceneDepth node and while the relative values seems right, the absolute values don't seem accurate. For example, I placed a plane parallel to the camera plane 50cm in front of the camera in the world. The SceneDepth values for parts of the viewport which is covered by that plane all have the same values, but they are shown to be 5.88672, which doesn't appear to be unreal units or cm or meters? And a mesh at 470cm away has a SceneDepth value of 15.7891. Is there anyway to convert the output to a real world unit?
P.S. Is there a way to upload patches for fixing bugs in the engine code like there was for UE3?
I needed to loop in some further support to get the correct information, but I was provided with some really helpful insight in regards to how the Scene Depth and its visualizer is calculated.
"The Normalization equation provided by the documentation was not necessarily accurate, but the principle of normalization still can be applied. The multiplication by 0.0001 and the frac is what creates that stripped pattern you see in Scene Depth Visualization because otherwise it would be a solid gradient from 0 to 2^24-1 which to most people looks like a bunch of whiteness. Multiplying Scene Depth by a Fractional Number (0.0001) is the same as Dividing by a whole number (1000) and they both limit what the range of the depth sampled. The frac is useful only in the visualization because it will help users see the depth based the divided amount. So x0.0001 is saying, make a gradient from 0 to 1000 units in Scene Depth, and anything after 1000 units will be 1. The frac then essentially tells the gradient to repeat because it is only taking fractional values." - Eric Ketchum
The correct terminology for GitHub when submitting code to be added into the engine, is called a pull request, since you are requesting that your submitted code be pulled from GitHub and integrated into the engine.
Hopefully this clarifies things, but let me know if you have further questions.
answered Nov 13 '15 at 08:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here