• Advertisement

Archived

This topic is now archived and is closed to further replies.

What is the Z Buffer?

This topic is 6521 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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.

Share this post


Link to post
Share on other sites

  • Advertisement