diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2009-05-22 10:12:18 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2009-05-22 10:12:18 +0400 |
commit | ec60c74f081b006a6e8aebefe930a37aac95b865 (patch) | |
tree | bd56d584c9b3fab323ec50292e7c5f136e034465 /source/blender/gpu/intern/gpu_material.c | |
parent | 612f3b326662498207e6e051feeceaac81e09343 (diff) |
Fix for: energy IPO not supported in glsl mode (reported in the forum).
in fact I redid part of the last "fix", making it working properly now.
Before we were changing Lamp->la . This is the Blender Lamp, we shouldn't touch it.
So this part of the code is correct now.
Things that could be tackled:
- color attribute is returning negative values when NEGATIVE is toggled
- objects with no material (default gray one) still don't support lamp spots (not spot lamp but the spot of the lamps)
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 93604e76527..818b67170c7 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1308,14 +1308,12 @@ 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) { - lamp->la->energy = energy; - lamp->la->r = fabs(r); - lamp->la->g = fabs(g); - lamp->la->b = fabs(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; + lamp->energy = energy; + if(lamp->mode & LA_NEG) lamp->energy= -lamp->energy; + + lamp->col[0]= r* lamp->energy; + lamp->col[1]= g* lamp->energy; + lamp->col[2]= b* lamp->energy; } static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *la, GPULamp *lamp) |