diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-03-29 05:56:08 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-03-29 05:56:08 +0400 |
commit | f22f60e7c4b57b28add3658eaa86b21041cad241 (patch) | |
tree | 22e385be60b36129c1fe8911c5c69f65310dd763 /source | |
parent | 42076f0a1f46d165cf0eae364a3e3ebb3f870edc (diff) |
BGE: This fixes a problem where lamps in inactive layers were rendering shadows buffers that never got used, which was a huge performance sink.
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 9c59bf78041..1b7bb61fe79 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1918,16 +1918,20 @@ static KX_GameObject *gameobject_from_blenderobject( KX_BlenderSceneConverter *converter) { KX_GameObject *gameobj = NULL; + Scene *blenderscene = kxscene->GetBlenderScene(); switch(ob->type) { case OB_LAMP: { - KX_LightObject* gamelight= gamelight_from_blamp(ob, static_cast<Lamp*>(ob->data), ob->lay, kxscene, rendertools, converter); + KX_LightObject* gamelight = gamelight_from_blamp(ob, static_cast<Lamp*>(ob->data), ob->lay, kxscene, rendertools, converter); gameobj = gamelight; - gamelight->AddRef(); - kxscene->GetLightList()->Add(gamelight); + if (blenderscene->lay & ob->lay) + { + gamelight->AddRef(); + kxscene->GetLightList()->Add(gamelight); + } break; } |