Lights without Opengl

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?

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

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!!!

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.

oups. You are right, the last intensity should be (255, 211, 0)!!!