diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-27 15:10:34 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-27 15:10:34 +0400 |
commit | c0ba0c1171bb78eac04fb4bccfea415b4378ed50 (patch) | |
tree | 006ce047c1dc7d9c103587c20a4127fce18d2736 /source/blender/gpu/intern/gpu_material.c | |
parent | 5e5b0cbb263d1e18867cfda5ce221221e1b1c2d4 (diff) |
Fix #22986: glsl didn't take object hiding into account yet for lamps.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index c81ddd6a770..9ed7729fea3 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -103,7 +103,7 @@ struct GPULamp { Object *par; Lamp *la; - int type, mode, lay; + int type, mode, lay, hide; float dynenergy, dyncol[3]; float energy, col[3]; @@ -256,7 +256,7 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim for(nlink=material->lamps.first; nlink; nlink=nlink->next) { lamp= nlink->data; - if((lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) { + if(!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) { lamp->dynenergy = lamp->energy; VECCOPY(lamp->dyncol, lamp->col); } @@ -1310,11 +1310,12 @@ void GPU_materials_free() /* Lamps and shadow buffers */ -void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]) +void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4]) { float mat[4][4]; lamp->lay = lay; + lamp->hide = hide; copy_m4_m4(mat, obmat); normalize_m4(mat); @@ -1355,7 +1356,7 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l lamp->col[1]= la->g*lamp->energy; lamp->col[2]= la->b*lamp->energy; - GPU_lamp_update(lamp, ob->lay, ob->obmat); + GPU_lamp_update(lamp, ob->lay, (ob->restrictflag & OB_RESTRICT_VIEW), ob->obmat); lamp->spotsi= la->spotsize; if(lamp->mode & LA_HALO) |