Jump to content
  • Advertisement
Sign in to follow this  
Kada2k6

Stencil buffer issue

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

Advertisement
Sorry, I don't see any difference in the screenshots...

Are the drivers up to date on these other computers? What hardware are they using? IIRC you have to be set to 32bit color mode to have a stencil buffer.

Share this post


Link to post
Share on other sites
Hidden
The difference is that there are no shadows in the second screenshot. Instead, the entire ground is darkened down.

I have no idea what drivers or cards they use, but they have all been different. And I am using 32-bit mode.

It's as if the stencil buffer I prepare is simply ignored, so that when I finish by drawing a black quad over the entire screen, it fills up everything instead of just the places where I've placed textures.

Share this post


Link to post
Hidden
I *finally* managed to solve my own problem. This wasn't an easy task, and the error was far from obvious! Also, different results on different computers made it even harder to track down the problem.

But here's the solution. I'll post it here in case somebody else should get this problem in the future.

Because I was using SDL, this line needs to be added *before* SDL_SetVideoMode():

SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);

That's it! Now the stencil buffer works properly on all computers.

Share this post


Link to post
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!