Depth to World Position
In a post process material, what would be the best way to get the World Position of a pixel rendered in the CustomDepth GBuffer?
I tried CameraPosition - (CameraVector * CustomDepth.r), but the result is obviously wrong.
asked Apr 22 '15 at 02:25 PM in Rendering
That doesn't seem far off. You probably just need to divide the CustomDepth value by the dotproduct of cameravector and cameraforwardvector.
Remember that depth is actually from an orthographic perspective, whereas real distance is shaped like a circle around the camera (ie, the side of the frame actually is further from the camera for a given 'depth').
answered Apr 22 '15 at 04:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here