Pindrought
Posts: 1
Joined: Wed Jul 17, 2019 4:09 pm

OpenGL - Does Stencil buffer not work on Raspberry Pi 3B+?

Mon Jul 22, 2019 4:51 pm

Edit: Solved.
I am using freeglut. When initializing my OpenGL context, I was not passing the GLUT_STENCIL flag. The stencil is working as expected now.




Code: Select all

glClear(GL_STENCIL_BUFFER_BIT);
glEnable(GL_STENCIL_TEST);
glStencilMask(0x00); // don't write to stencil buffer
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilFunc(GL_EQUAL, 0, 0xFF);
pitchLines.Render();

With

Code: Select all

glStencilFunc(GL_EQUAL, 0, 0xFF);
and

Code: Select all

glStencilFunc(GL_EQUAL, 1, 0xFF);
I am getting the same results. The sprite is still being rendered. My code works as expected on windows, but on the raspberry pi it seems like the stencil function is just ignored.
Any idea what gives? Is there something i'm missing that I need to do before using the stencil buffer on the PI?

Even tested with

Code: Select all

glStencilFunc(GL_NEVER, 0, 0xFF);
and it still renders.

Return to “Graphics programming”