Jump to content
  • Advertisement

Archived

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

jho

Depth buffer bits

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

I''m writing some OpenGL code for laptops so I''m trying to cut down memory size and load, etc. I''m thinking for cutting down DepthBuffer size from 32-bit to 16-bit. My Frustrum set by GluPerspective have a zNear and zFar of 0 to 10000. Is it safe to say that 16bit depth buffer is sufficient in my case, because 2^16 > 10000? Is my reasoning correct? This is set with PixelFormatDescriptor, right? (What other flags can I set to optimize?) PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), // Size of this structure 1, // Version of this structure PFD_DRAW_TO_WINDOW / // Draw to Window (not to bitmap) PFD_SUPPORT_OPENGL / // Support OpenGL calls in window PFD_DOUBLEBUFFER, // Double buffered mode PFD_TYPE_RGBA, // RGBA Color mode 32, // Want 16bit color 0,0,0,0,0,0, // Not used to select mode 0,0, // Not used to select mode 0,0,0,0,0, // Not used to select mode 16, // Size of depth buffer 0, // Not used to select mode 0, // Not used to select mode PFD_MAIN_PLANE, // Draw in main plane 0, // Not used to select mode 0,0,0 }; // Not used to select mode

Share this post


Link to post
Share on other sites
Advertisement
Can someone please answer my question..? I don''t think it''s a tough question for you guys..

Share this post


Link to post
Share on other sites
You have the wrong idea about the z-buffer. More z-buffer bits means a more accurate z-buffer. This has nothing to do with the size of your viewing frustum. Also, in your reasoning (which is incorrect anyway you forgot to take into account what is right of the decimal point. Generally the z-buffer will range from 0.0 at the near clipping plane to 1.0 at the far clipping plane.

Hopefully that answers your questions.

-BacksideSnap-

Share this post


Link to post
Share on other sites
No he is right, the size of the frustrum CAN affect the z-buffer accuracy. If you have a super accurate 32 bit buffer, then a frustrum with a depth of say 0.01 units should appear ok because you have 429496729600 levels of buffering, but a 16 bit buffer would have only 6553600 levels of buffering. In a situation with a high number of polys the view frustrum determines the accuracy in between depths. However, most programs don''t have this problem, but just so you know, view frustrum can affect accuracy, and a 16 bit z buffer is less accurate than a 32 bit. I would suggest letting the user set an option or something so that those with better machines can get the better affect.

---
www.crazycrackerz.org

Share this post


Link to post
Share on other sites
No, he was wrong, and you can't read. Did I not mention accuracy in my post? Actually, **** it, I don't care anymore. Every time I try and clear something up someone comes in with some stupid ****. The original poster was thinking that the z-buffer had to be bigger than the size of the viewing depth. Yes, a larger viewing depth obviously affects accuracy, but it doesn't mean you couldn't use a 2-bit z buffer if you wanted (theoretically).

-BacksideSnap-

(Control your language, this is a public forum - WitchLord)

Edited by - WitchLord on June 26, 2000 3:01:02 PM

Share this post


Link to post
Share on other sites
Wow, censored twice by WitchLord. Don''t worry, I think I''m through posting here. You know your ****, but I think that people here are capable of handling a little bit of language every now and then. Live on Big Brother.

-BacksideSnap-

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!