[Bf-committers] GLSL dynamic loading lighting bug (mostly addressed to Brecht and Campbell)

Mitchell Stokes mogurijin at gmail.com
Sun Feb 21 01:28:17 CET 2010


Hello devs,

I've been playing around with the dynamic loading features Campbell
added into the BGE and trying to fix bugs as they come up. Currently
I've been trying to tackle lighting issues when merging scenes: the
lights in the base scene do not affect the merged in scene and vise
versa. I fixed the problem for Multitexture by making sure the merged
in lights were set to the new scene (the patch is here:
http://projects.blender.org/tracker/index.php?func=detail&aid=21261&group_id=9&atid=127).

However, fixing the lights for GLSL is trickier. The dynamic loading
handles merging two BGE scenes, which multitexture uses for lighting,
but GLSL lights share code with Blender, which means lighting is done
per Blender scene, not per BGE scene. So, I see two ways to get around
this (and neither seem to great):

1. Make the dynamic loading code merge the Blender scenes as well as
the BGE scenes, and then make sure to unmerge them. The unmerging
could get nasty, and modifying Blender data from the BGE could be
dangerous, but some of the light code already is changing Blender data
and making sure to revert the data when it's done (ie, from the
destructor).

2. Modify the GLSL material lighting code in gpu_material.c to allow
scenes to light each other. This could also get kind of messy as we'd
be adding in specialty cases which would only be used by the BGE.

I don't know enough about the dynamic loading code nor the GLSL code
to decide what route to take. This is why I'm asking Brecht and
Campbell for any ideas on how I should proceed with fixing this bug.

Thanks,
Mitchell Stokes (Moguri)


More information about the Bf-committers mailing list