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>2009-05-13 10:42:15 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2009-05-13 10:42:15 +0400
commit82b4975ccfa8fe2c72278388a3cf3a8432cc9fb0 (patch)
tree3bd0fb8c0c858fd4556f6865e3d79e1e5e9faac5 /source/blender/gpu
parentc19baf85cca1ecdd0b07c35a61a4999bc27d1e6b (diff)
BGE #18732: Python Light options don't work with GLSL materials. Commited patch from dfelinto and moguri, thanks for the good work.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_material.h1
-rw-r--r--source/blender/gpu/intern/gpu_material.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index ccc687858f4..49c0dc166c1 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -159,6 +159,7 @@ void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize
void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp);
void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]);
+void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy);
int GPU_lamp_shadow_layer(GPULamp *lamp);
#ifdef __cplusplus
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 87703bc73bf..f7052694fc7 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1306,6 +1306,18 @@ void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4])
Mat4Invert(lamp->imat, mat);
}
+void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy)
+{
+ lamp->la->energy = energy;
+ lamp->la->r = r;
+ lamp->la->g = g;
+ lamp->la->b = b;
+
+ lamp->col[0]= lamp->la->r*lamp->energy;
+ lamp->col[1]= lamp->la->g*lamp->energy;
+ lamp->col[2]= lamp->la->b*lamp->energy;
+}
+
static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *la, GPULamp *lamp)
{
float temp, angle, pixsize, wsize;