I've enabled face culling with glEnable(GL_CULL_FACE)
, and I'm trying to cull the back faces, but whenever I do glCullFace(GL_BACK)
nothing gets rendered.
If I do glCullFace(GL_FRONT)
it works as expected (that is, renders the inside of my cubes, but not the outside).
I've tried to change the winding, but it doesn't seem to be that since GL_FRONT
works.
What could be the reason for this?
It is rendered to a framebuffer with a depth renderbuffer enabled, if that matters. Disabling culling makes everything render as expected.
Edit
The winding used is counter-clockwise, i.e. the nearest side:
x, y, z
0, 0, 0
1, 0, 0
1, 1, 0
0, 0, 0
1, 1, 0
0, 1, 0
Here is an image of what it looks like with GL_FRONT
:
(without the back of the cubes, so you can see the effect). Again, this is what I expected it to look like.
And what it looks like without culling: