Ano-Tech Computers
Enter keyword:

Perl_SDL: Hardware supports stencil buffers but it doesn't work in OpenGL
Problem:
When using a 3D accelerator card which supports 32 bit Z/stencil buffers, OpenGL is only using 16 bits for Z (depth) buffering and stencils don't work at all. glGet(GL_DEPTH_BITS) returns 16 glGet(GL_STENCIL_BITS) returns 0 Also, when trying to glEnable(GL_STENCIL_TEST), rendering becomes extremely slow.
 
Solution:
Most OpenGL drivers require the depth of the Z and stencil buffers to be specified during initialization, otherwise the most common default values are 16 and 0 respectively.

In the case of Perl_SDL, use the options -depth and -stencil_size when calling SDL::App->new()

 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles