PDA

View Full Version : Lights without Opengl



07-28-2000, 03:19 AM
I'm want to do some lighting on my own. I'm just curious how you would combine the effects of more than one light. For example:

One light contributes (Red:255 Blue:128) to a vertex.
Another light contributes the same amount.
By adding these values, you get white illumination, but I think it should be more red than blue. Any suggestions?

Thr33d
07-28-2000, 09:55 AM
I myself am not sure... it seems the best way would be to have use sort of camera exposure... either that or resample the light down when it goes over 255.

-mike

Gorg
07-28-2000, 06:38 PM
One simple way is to scale all the components by the biggest one
ex : l1 : (255, 128, 0 ), (255,128,0)

total light(if the light žntensity stays constant over the distance):

(310,256,0) == (255, 256*255/310, 0) == (255,46,0)

That way you keep the color the only problem is the intensity, will it be the right one?? It should be close enough in most case because two bright yellow light added together gives another bright yellow light!!!

07-29-2000, 05:30 AM
Thanks for the help. The numbers you gave don't make sense to me, but I think I get the idea. I thought about scaling them down, but I wasn't sure if that was the right thing to do. I'll try it and see you it works.

Gorg
07-29-2000, 07:47 AM
oups. You are right, the last intensity should be (255, 211, 0)!!!