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:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-04-30 23:58:44 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-04-30 23:58:44 +0400
commit3a430c33d22d659ab3d73709f0dbc60a029e0893 (patch)
treed7bb536d8731b6668413ed9d55affae6cfe9fc8d /source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
parent93ba2dd6a1b5a841a49469e12a3671957e6a3500 (diff)
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.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_MaterialBucket.cpp')
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.cpp8
1 files changed, 2 insertions, 6 deletions
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);
}