07.01.2013 Views

3D graphics eBook - Course Materials Repository

3D graphics eBook - Course Materials Repository

3D graphics eBook - Course Materials Repository

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Z-buffering 251<br />

~<br />

This shows that the values of are grouped much more densely near the plane, and much more sparsely<br />

farther away, resulting in better precision closer to the camera. The smaller the ratio is, the less precision<br />

there is far away—having the plane set too closely is a common cause of undesirable rendering artifacts in<br />

more distant objects. [2]<br />

To implement a z-buffer, the values of are linearly interpolated across screen space between the vertices of the<br />

current polygon, and these intermediate values are generally stored in the z-buffer in fixed point format.<br />

W-buffer<br />

To implement a w-buffer, the old values of in camera space, or , are stored in the buffer, generally in floating<br />

point format. However, these values cannot be linearly interpolated across screen space from the vertices—they<br />

usually have to be inverted, interpolated, and then inverted again. The resulting values of , as opposed to , are<br />

spaced evenly between and . There are implementations of the w-buffer that avoid the inversions<br />

altogether.<br />

Whether a z-buffer or w-buffer results in a better image depends on the application.<br />

References<br />

[1] The OpenGL Organization. "Open GL / FAQ 12 - The Depth buffer" (http:/ / www. opengl. org/ resources/ faq/ technical/ depthbuffer. htm). .<br />

Retrieved 2010-11-01.<br />

[2] Grégory Massal. "Depth buffer - the gritty details" (http:/ / www. codermind. com/ articles/ Depth-buffer-tutorial. html). . Retrieved<br />

2008-08-03.<br />

External links<br />

• Learning to Love your Z-buffer (http:/ / www. sjbaker. org/ steve/ omniv/ love_your_z_buffer. html)<br />

• Alpha-blending and the Z-buffer (http:/ / www. sjbaker. org/ steve/ omniv/ alpha_sorting. html)<br />

Notes<br />

Note 1: see W.K. Giloi, J.L. Encarnação, W. Straßer. "The Giloi’s School of Computer Graphics". Computer<br />

Graphics 35 4:12–16.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!