Archived

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

Depth buffer value calculation..!

This topic is 5183 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 all, As some of you are probably aware of the depth buffer isn''t mapped linearly. So, I''m currently doing a project where I need to write the depth buffer values myself and I tried using the equation derived in this document: http://www.cs.unc.edu/~hoff/techrep/perspective.doc The main problem with the above document''s equation is basically that it''s VERY unprecise. The smaller the distance between the near and far clip plane, the more unprecise the calculated result gets! So, what I''m basically looking for here is a link, some help or just something that could point me in the direction of calculating a much more precise value! Even a slight difference on the third decimal is enough to make the depth comparison go crazy! Please.. somebody enlighten me :D

Share this post


Link to post
Share on other sites