Sign in to follow this  

lighting

This topic is 4401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have one light source and I want the light to shine "through" all my polygons so that they are the same color on both sides and not light on one side and dark on the other side. What's the best way to do this?

Share this post


Link to post
Share on other sites
You can turn on the ambient light: It lets all the vertices to be brighter/darker at an equal value. Without further informations (Graphics engine, programming language...) I don't know how to give you a sample.

Share this post


Link to post
Share on other sites
Well logically the backsides should be BLACK because no light fall on them, however you can make OpenGL Process them by simple adding something.. I cant remember what its called, but its a simple OpenGL call. You can try glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);

But i think it was more to do with a light setting

Share this post


Link to post
Share on other sites
Like already pointed out, because the polygon is facing the opposite way, it will always less or more light than the one on the other side (assuming there's only one light source). They can still have the same basic material/color, but the direction/range of the light will determine its final color (unless you flip the polygon's normal).

You can temporarely disable culling (glCullFace) so your polygon is rendered not matter which way it's facing. Also, you could disable lighting entirely and use either glColor or set a material to color your vertices.

Share this post


Link to post
Share on other sites
Sign in to follow this