From 3a430c33d22d659ab3d73709f0dbc60a029e0893 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 30 Apr 2008 19:58:44 +0000 Subject: fix BGE bug #8869: Added objects are not lit correctly The current layer information is now stored in KX_GameObject and inherited from the parent object when dynamically added. This information is used during the rendering the select the lamps. As the selected lamps are always coming from active layers, their position and orientation are correct. --- source/gameengine/Rasterizer/RAS_MaterialBucket.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/gameengine/Rasterizer/RAS_MaterialBucket.cpp') diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 4642ffbaeb8..02e84f8a243 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -189,7 +189,7 @@ bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_I } else { - rendertools->ProcessLighting(m_material->GetLightLayer()); + rendertools->ProcessLighting(RAS_IRenderTools::RAS_LIGHT_OBJECT_LAYER/*m_material->GetLightLayer()*/); } drawmode = (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID ? @@ -204,7 +204,6 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa if (!ms.m_bVisible) return; - rendertools->SetClientObject(ms.m_clientObj); m_material->ActivateMeshSlot(ms, rasty); /* __NLA Do the deformation */ @@ -317,15 +316,12 @@ void RAS_MaterialBucket::Render(const MT_Transform& cameratrans, //rasty->SetMaterial(*m_material); - if (m_meshSlots.size() >0) - { - rendertools->SetClientObject((*m_meshSlots.begin()).m_clientObj); - } int drawmode; for (T_MeshSlotList::const_iterator it = m_meshSlots.begin(); ! (it == m_meshSlots.end()); ++it) { + rendertools->SetClientObject((*it).m_clientObj); while (ActivateMaterial(cameratrans, rasty, rendertools, drawmode)) RenderMeshSlot(cameratrans, rasty, rendertools, *it, drawmode); } -- cgit v1.2.3