Jump to content
  • Advertisement


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


do you guys use the stencil buffer for anything other then.....

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

ok i''v been trying to figure out how to use the stencil buffer to do some clipping and maybe a nice dissolve fade and i''v searched most of gamedev and my favorite programming sites and the only thing it seems people use it for is shadows so i''m wondering if you guys have any code to read through or any web sites discribing one of those technics i so happy would it be easier to understand the stencil buffer it i understood the depth buffer? cause i''m doing all this in 2d so i don''t really know 100% how it works only the jist of it thx for any help

Share this post

Link to post
Share on other sites
If you''re working in 2D, you don''t need the depth buffer although you could use it for some effects.

I don''t really get what you mean by the ''dissolve fade'' effect. I can see many different effects that would pretty do it. Please give more details.

You''re right that actually the stencil buffer is very popular for shadow volumes. In the past, stencil buffer has been famous for CSG (Constructive Solid Geometry) and the very first usage the stencil buffer was masking. Unlike the color buffer or the depth buffer, the stencil buffer is not responsible of a fixed, unique task. It''s up to you to do what you want with that buffer !

Just a note on performance : on some cards, stencil buffer is supported in software, which means horribly slow. If you expect real-time performance you should get information of the targeted hardware. NVIDIA cards, for instance, do support hardware stencil buffer only when depth buffer is in 24bit. That''s weird but that''s how it works and you have to deal with it if your program can run on NVIDIA hardware.

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!