PDA

View Full Version : What is depth value refer to in OpenGL?

hawaii
04-08-2007, 07:46 PM
Dear everyone,

who knows what is depth value refer to in OpenGL? Is it refer to the distance from the viewpoint and the objectpoint, or the distance from the nearplane to the objectpoint?

Thanks before :)

V-man
04-08-2007, 10:42 PM
It could be any of them unless you put it into context as to what you are talking about. Post a paragraph or something here.

It could also be the screen space depth value, 0.0 to 1.0 range.

zeoverlord
04-09-2007, 10:00 AM
it's always near plane to object point in the depth buffer.

dorbie
04-11-2007, 12:14 AM
It is the value stored in the depth buffer (nominally 0-1) and that can be calculated using an equation derived from the transformation process through the projection matrix and the frustum stored on it.

It is a non linear function of frustum near, frustum far and eyespace z.

http://www.opengl.org/resources/faq/technical/depthbuffer.htm

dorbie
04-11-2007, 12:16 AM
Can anyone find a reference for deriving eye z from depth value read from OpenGL, Google search let me down and I lost a link to an awesome paper that not only presented the equation but derived it too.

Kumar K
04-11-2007, 12:49 AM
Dorbie,

may be this is what you are looking for...
https://wiki.medien.ifi.lmu.de/pub/Main/AugmentedRealityVorlesungSoSe2005/hoff2000derivingOpenGL.pdf

zed
04-11-2007, 02:39 AM
theres a couple of wyas ive seen this is the easiest/fastest

D = far*near / ( far - z * (far-near))

(then again u prolly mean something else)

Jackis
04-11-2007, 05:19 AM
Hi!
The same topic. already discussed here couple of monthes ago:
http://www.opengl.org/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic;f=3;t=014925;p=0

dorbie
04-12-2007, 10:09 PM
Kumar, yup that's the one although that website was blocked due to a bogus security certificate. Adding Hoff to my google search found the original.

Google for Hoff deriving opengl and it finds the paper.