Advertisement

What is the Z Buffer?

Started by April 17, 2000 04:06 AM
0 comments, last by Muzzafarath 24 years, 8 months ago
Well, what is it? What''s it used for? /. Muzzafarath
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
The Z buffer is an implementation of the depth buffer method of enforcing proper object rendering on screen. That is to say, let''s say I draw an object ( a cube ) on the screen as part of my render pass. Later in the render pass I want to draw another object ( a sphere ) that would overlap on the screen, but is actually behind the cube. With depth buffering, I record the depth values for each of the pixels as they are put into the image buffer in a separate depth buffer. Later, when another object is blitted, it''s pixels are placed in the image buffer iff the pixel''s depth value is closer than the depth value currently in the depth buffer. Obviously, the depth value in the depth buffer for that pixel location is updated when a new (closer) pixel is drawn. Otherwise, in an out of order render, the sphere would be drawn over the cube, despite the cube being closer to the viewer.

This topic is closed to new replies.

Advertisement