Jump to content
  • Advertisement
Sign in to follow this  
staticVoid2

implementing a z-buffer

This topic is 3756 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

hi, I was wondering how to approach implementing a z buffer in my software renderer. I thought maybe I could use my perspective correct texture mapping function as this interpolates the reciprocal of z anyway and then save the reciprocal in the z buffer at the specific x, y location, then if this value is greater than the last - copy the pixel to an adjacent array(surface in direct draw) which stores the pixels, then simply blit the image after all triangles are draw, but as this is the first time Ive tried this im not sure this is the way to do it? also, what would usally be required of a software renderer in terms of hidden surface removal, If im creating large (static) environments etc. I know the best thing to use would be BSP trees but this (im sure) has nothing to do with the renderer. would I have to create separate functionality for rendering using the z-buffer and without(when using bsp trees)?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!