Lighting: don't use large polygons?

The current scene I’m testing lights in consists of a
40 x 40 x 40 cube which is made up of only 6 polygons.
When I place a diffuse light in the South West corner of the room the South wall and West wall light correctly, but the North and East appear fully lit with a bright, even light, when they should be much darker.

I thought perhaps I had the winding backwards on the polygons, or had something screwed up with the normals, so I moved the light to the opposite corner (NorthEast) and now the North and East walls light correctly, with the South and West behaving in the same incorrect manner as noted above.

If smaller polygons is the answer, what size is the largest acceptable?

If any other hints come to mind that are related to this I would really appreciate hearing them :slight_smile:

This is directly related to your other post. Since OpenGL lighting works on a per-vertex basis only the vertices “close enough” to the light are being lit. Each of the vertices is being evaluted against the light and the colours between them is interpolated. This is what gives the effect you are seeing.

There isn’t a too big or too small polygon. Its a balancing act between lighting accuracy and rendering speed.

You might consider looking up Per Pixel Lighting on google or take a look a Light Maps. Both of these will provide alternatives to adding lots of polygons but impose their own restrictions.

Kev

Hi,

have you enabled Gourand Shading?

ciao torsten

Actually, the problem SEEMS to be gone now. I tried messing around with different types / values for attenuation, and it cleared up.

Thanks though :slight_smile: