View Full Version : Lighting or darking???

03-16-2004, 01:01 PM
Hi there, it's me again.

As always, I've got problems. Today my problem is lighting.

Why are polygons getting dark when I am closing light-source to them? I think it is caused by method of calculating color, but how to make it works correctly?

I've got another problem too. But maybe it is the same as above. Distant objects are not lighted, even if I don't use attenuation and light-source is placed correctly.

Thanks for all answers. Maybe you know some interesting pages about lighting (other than NeHe Page).

03-16-2004, 03:14 PM
It sounds like an interpolation problem. Lighting is done at the vertices and interpolated so if you have a light source near the middle of a large polygon, it will be dark. The only solutions I've used are to subdevide the polygon or do do per-pixel lighting.

03-16-2004, 03:56 PM
I was thinking about that, and about dividing polygon into may polygons. And this is at this time only answer to this problem.

But what about distant polygons. Why are they dark?

03-17-2004, 01:10 PM
I missed that part of the question. It sounds like it would be a problem with normals somehow. How do they fade away as they become distant? Smoothly or do they dissapear all at once?

03-17-2004, 02:22 PM
Yes, you're right. I have set wrong normals. Sorry for taking your time. And Thanks of course. Thanks.