Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2013-08-17 08:37:25 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-08-17 08:37:25 +0400
commit82c845425f0a5e2805ed7e9f6cb74920fa96229f (patch)
tree04d6b5fe7db2952b1a402aa2219637b2f4b810f6 /source/gameengine/Ketsji/KX_Scene.cpp
parent51bca0d7dc8fb5033778796e14dd01c1c7f4355a (diff)
BGE: Adding partial support for LibLoaded lights with GLSL materials.
Any GLSL materials loaded after lights are LibLoaded will now use the lights in heir shaders. This includes materials loaded from the same scene as the LibLoaded lights. We could later add a new flag to LibLoad to recompile all existing shaders, but this commit should offer a lot more flexibility as is.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 35084061ab0..0b90e0227c8 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1953,8 +1953,6 @@ bool KX_Scene::MergeScene(KX_Scene *other)
GetBucketManager()->MergeBucketManager(other->GetBucketManager(), this);
- /* move materials across, assume they both use the same scene-converters */
- GetSceneConverter()->MergeScene(this, other);
/* active + inactive == all ??? - lets hope so */
for (int i = 0; i < other->GetObjectList()->GetCount(); i++)
@@ -1991,7 +1989,12 @@ bool KX_Scene::MergeScene(KX_Scene *other)
if (env) /* bullet scene? - dummy scenes don't need touching */
env->MergeEnvironment(env_other);
#endif
-
+
+ /* move materials across, assume they both use the same scene-converters
+ * Do this after lights are merged so materials can use the lights in shaders
+ */
+ GetSceneConverter()->MergeScene(this, other);
+
/* merge logic */
{
SCA_LogicManager *logicmgr= GetLogicManager();