Reputation:
How to enable both side lighting for GL_POINTS
in opengl?
It seems glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
is working for only facets, but not GL_POINTS
.
What I am doing is supplying both vertices
and the vertex normals
with lighting enabled. With GL_LIGHT_MODEL_TWO_SIDE
disabled, GL_POINTS are lit according to the normal direction. But I cannot enable both sided lighting for GL_POINTS
.
Can this be done using OpenGL
legacy functions? Or would I have to render both sides by negating all the normals?
Thanks in advance. Please do not comment to use modern OpenGL
as that is not the answer to my question, but only a suggestion.
Upvotes: 1
Views: 928
Reputation: 473537
How to enable both side lighting for GL_POINTS in opengl?
You don't. Points and lines do not have sides. Only face primitives (triangles, quads, etc) have sides.
So if you want the lighting computation to reverse the normal if the normal is facing away or something, then yes, you will have to render your geometry twice.
Upvotes: 2