Jump to content
  • Advertisement
Sign in to follow this  
Trapper Zoid

OpenGL What level of stencil/depth buffer support can I assume?

This topic is 4253 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 am presently working on a hobby 2D game project, using textured quads in OpenGL (and SDL) to display my sprites. Previously I have only been using OpenGL as an easy way of transforming and rotating sprites, but for this game I would like to play around with a few more advanced effects. I have between reading up in my copy of the OpenGL Superbible on the various hardware buffers available, and am starting to come to grips with at least the theory of how most of those are meant to work (or at least I think so). However one question I have revolves around the functionality offered by the hardware available in today's computers. Thinking things through most of the effects I'd like to implement in my 2D games such as shadows and transition effects could be done with masking, whether implemented via the stencil buffer or the depth buffer. However given I am not very knowledgeable about the capabilities of graphics hardware I am unsure exactly what functionality I can expect in standard computers today. From what I have read I assume I can expect at least a one bit stencil buffer under OpenGL, even if that is implemented via software emulation. I am uncertain about the depth buffer, but I expect an OpenGL implementation has to at least have one, although to what bit depth I am unsure. But I don't know what is reasonable to assume for a halfway decent computer these days. I don't particularly need to put in a lot of special effects so I don't want to use a feature that limits my game to higher-end graphics cards, and from the date of some of the articles I've read on the internet and here at GameDev suggest that most computers would have more than enough for my 2D games. But exactly what can I expect a computer to do? Sorry if this is a bit vague or newbie-ish, as I'm pretty new to OpenGL and gaming hardware related topics. Thanks in advance for any replies.

Share this post


Link to post
Share on other sites
Advertisement
well, you can't assume anything, but I think most cards support 24/8 these days, 24-bit depth and 8-bit stencil. You can query the formats in windows to find out all the supported formats of a card.

Share this post


Link to post
Share on other sites
Quote:
Original post by GrumpyAndTired
well, you can't assume anything, but I think most cards support 24/8 these days, 24-bit depth and 8-bit stencil. You can query the formats in windows to find out all the supported formats of a card.

Thanks - that's the impression I got. Am I right though in assuming that OpenGL is assured to have a depth buffer of at least 8 bit resolution? Given my game is fairly simple in 2D it's possible I could fudge the functionality I need for masking using the depth buffer. I'd prefer to use the buffer that's most widely supported if possible.

Share this post


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

  • 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!