Two-sided lighting of GL_POINTS

I have a bunch of points which I display as GL_POINTS. Each one has a normal
vector, and if the normal points towards the camera, then it gets nicely lit,
but if it points away, then we see the “back” of the point, which isn’t lit.

Is there some way of getting two-sided lighting of GL_POINTS like we can with
polygons?

Could u please elaborate a bit more? like are u using fixed func. pipeline (FFP) or are u doing it on your own in a shader?

Hi mobeen, I’ve considered having only diffuse lighting with pairs of opposing
lights, but I really want specular lighting. I think I might be able to do it
with a spherical texture map, or I could write a shader. I’m just wondering if
I’ve missed something simple before I set off down one of these paths.

Yeah i think u should go ahead with a custom shader it gives u full control. Two sided lighting should be quite easy since for basic diffuse model we do something like this


float NdotL = max(dot(N,L),0);

For two sided lighting you could do this


float NdotL = abs(dot(N,L));

You should start with diffuse lighting and make sure it works before u move on to specular lighting.

I dont think the FFP has anything like two sided lighting for GL_POINTS but this is based on my meager knowledge.

Hope this helps,
Mobeen

Or you could render triangles and turn on point mode rendering : glPolygonMode(GL_POINT).

If you are comfortable with shaders, sure, go for it. FFP is old news.

Thanks for the replies, I wrote a shader.