PDA

View Full Version : Z-buffer



passalis
09-15-2005, 02:18 AM
Hello,
I am using OpenGL's z-buffer for scientific caclulations. I want to emulate what OpenGL does in software, but the code I wrote is giving me different results with respect to the z-buffer values and the rasterized pixels on the edges of polygons. I know that its impossible to get the exact same values since OpenGL uses non linear accuracy and usually 24bits for the z-buffer, but does anyone know where can I find any specifications about OpenGL's rasterizer (for example how exactly does it do the rounding of floats to integers,the interpolation between z-values etc), or even better some code?

jabe
09-15-2005, 02:54 AM
have a look at mesa3d (http://www.mesa3d.org/) which implements opengl in software and comes with full source code.

Overmind
09-15-2005, 02:56 AM
And there's the OpenGL sample implementation by SGI:
http://oss.sgi.com/projects/ogl-sample/