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>2012-07-24 00:24:35 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-07-24 00:24:35 +0400
commit37246b3ca17cf908d8c5855c9f0a6f0686646ea2 (patch)
tree22434e355d883e9806e26cac00409a9a1ad79f48 /source/gameengine/Ketsji/KX_Light.cpp
parent541e46f7adca5b23928a6b110f4442c9435979d8 (diff)
BGE: Bringing over the dynamic lamp properties fixes from Cucumber (thanks to Daniel Stokes). This means the following KX_LightObject properties now have support when using GLSL materials (in addition to those already supported):
* distance * lin_attenuation * quad_attenuation * spotsize * spotblend
Diffstat (limited to 'source/gameengine/Ketsji/KX_Light.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Light.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index 5922e97aaf4..512dc4b931b 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -67,10 +67,13 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,
KX_LightObject::~KX_LightObject()
{
GPULamp *lamp;
+ Lamp *la = (Lamp*)GetBlenderObject()->data;
if ((lamp = GetGPULamp())) {
float obmat[4][4] = {{0}};
GPU_lamp_update(lamp, 0, 0, obmat);
+ GPU_lamp_update_distance(lamp, la->dist, la->att1, la->att2);
+ GPU_lamp_update_spot(lamp, la->spotsize, la->spotblend);
}
m_rendertools->RemoveLight(&m_lightobj);
@@ -206,6 +209,8 @@ void KX_LightObject::Update()
GPU_lamp_update(lamp, m_lightobj.m_layer, 0, obmat);
GPU_lamp_update_colors(lamp, m_lightobj.m_red, m_lightobj.m_green,
m_lightobj.m_blue, m_lightobj.m_energy);
+ GPU_lamp_update_distance(lamp, m_lightobj.m_distance, m_lightobj.m_att1, m_lightobj.m_att2);
+ GPU_lamp_update_spot(lamp, m_lightobj.m_spotsize, m_lightobj.m_spotblend);
}
}