View Full Version : world space z coords from depth buffer
01-08-2004, 07:14 PM
is it possible to derive the world space z-coordinate of a point from its z value in the depth buffer? meaning that after rendering the scene, i wan to noe the value of the 3d coords of each point on the screen....
01-09-2004, 11:30 PM
There is no easy way to do it, the only functions in openGL that can do the conversion for you is gluProject/gluUnproject, as the values in the depth buffer is not linear it is a bit tricky to convert the values back to it's true depth value by hand, at least there is no simple way that I know of.
01-09-2004, 11:53 PM
hmm.... the problem is that the depth buffer values are quantized according to the precision of the zbuffer right? thats why the infomation is lost once we get to the depth buffer...
what about fragment programs? the values that it get are still before the quantization operation? if so is it possible to output the values during that stage via some textures?
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.