Dynamic lights + pre-baked lights


As a part of our pipeline, we’re pre-computing the lighting information into the vertices. That works fine. So at runtime, the textures are multiplied with the vertex colors

Now, I’d like to add a few dynamic (realtime) lights to this scene.
So what I would like to get is: the light contribution of the realtime lights should be added to the vertex color, and the total of that should be modulated by the texture.

Currently, panda does a multiplication of vertex colors and lights, so in effect my lights usually make things darker instead of brighter.

Is there a way to achieve this, without using shaders?
I was thinking along the lines of using the vertex colors as emissive part of the GL_COLOR_MATERIAL or so, but I’m not sure if that would work in the first place, and further I don’t know how to tell panda to do such a thing.

Any ideas anyone?



You can certainly do this with a shader, but there’s no way to do it without one. This behavior is built into the fixed-function pipeline, and is beyond Panda’s control.


What if you render the normal lighting in a separate buffer, then putting the contents of that buffer in a fullscreen card, and set the color mode to Add?

Yes, that would work of course, I just wanted to avoid the second pass.

It’s not a huge deal, we don’t really need the dynamic lights, I was just wondering if there would be an easy way to do it…



shaders are not that hard.