Skrevet av Emne: Perl_SDL: Hardware supports stencil buffers but it doesn't work in OpenGL  (Lest 4245 ganger)

ATC

  • Gjest
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.



ATC

  • Gjest
  • [applaud]0
  • [smite]0
  • 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()