[Bf-committers] Fixing dynamically added lights (BGE)

Daniel Stokes kupomail at gmail.com
Tue Jun 21 01:51:47 CEST 2011


To clarify this is for the Cucumber Summer of Code branch, and by "we" I
mean myself, my mentor, and a few other members of the community.

On Mon, Jun 20, 2011 at 3:36 PM, Daniel Stokes <kupomail at gmail.com> wrote:

> After some discussion yesterday, we came up with a plan for dynamically
> adding lights while in the Blender Game Engine. The problem is the shader
> code currently relies on Blender light objects, and recompiling it is too
> slow to do frequently in the BGE.
>
> So the plan is to create a user settable number of Blender lights and put
> them into the blender scene during the conversion process. At this time the
> shaders can be recompiled to so they include this pool of lights. From
> there, whenever a Ketsji light is dynamically added, it can "borrow" one of
> these Blender lights so it can affect the compiled shaders. These lights
> will be distributed on a first come first served basis. When a Ketsji light
> is done with a Blender light, the "borrowed" Blender light's energy can be
> set to 0 to avoid affecting the scene.
>
> When the engine is done running, it of course will remove these added
> Blender lights.
>
> I am sending this to the mailing list for review and feedback.
>
> Thanks,
> Daniel Stokes
>


More information about the Bf-committers mailing list