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

Started by
0 comments, last by baddrizz 21 years ago
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
Advertisement
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.

This topic is closed to new replies.

Advertisement