culling individual vertices( e.g. GL_POINTS)

i want to cull individual vertices of a vertices array. But glNormalPointer doesn’t seem to work for them, however i’ve reconstructed valid normals, since when putting lighting on the correct Points lit up. How can i ‘discard’ back ‘pointing’ Points

Paul

glCullFace only applies to polygon rasterization, not to point rasterization. The options I came up with are:

  • Application level culling of points
  • Discarding of back facing fragments using a vertex and fragment shader

You should be able to do this with:

glPolygonMode(GL_FRONT, GL_POINTS);
glCullFace(GL_BACK);

Then rendering ‘triangles’ with the correct winding order for the back face culling to work as normal. This has the advantage of not requiring any additional CPU work and doesn’t require shader support either. The down side is that rendering with glPolygonMode other than GL_FILL can be slower than the equivilent primative.