diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-12 15:01:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-12 15:01:54 +0300 |
commit | f1a14740bafc83bfd86774db4dfca2cbe8568cdc (patch) | |
tree | 1336864f6683880ad3834e7c590ee892ddb0fb9a /source/blender/gpu | |
parent | 673c9dce0850f2e6a13570ade132024c34bdb11c (diff) | |
parent | 60ab0b841827457fe0f8a321afca5bbc8ea9ff50 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_lamp.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_lamp.c | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/gpu/GPU_lamp.h b/source/blender/gpu/GPU_lamp.h index e08fbede80a..f6fd817cc3f 100644 --- a/source/blender/gpu/GPU_lamp.h +++ b/source/blender/gpu/GPU_lamp.h @@ -54,7 +54,7 @@ GPULamp *GPU_lamp_from_blender(struct Scene *scene, struct Object *ob, struct Ob void GPU_lamp_free(struct Object *ob); void GPU_lamp_engine_data_free(LampEngineData *led); -bool GPU_lamp_override_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma); +bool GPU_lamp_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma); bool GPU_lamp_has_shadow_buffer(GPULamp *lamp); void GPU_lamp_update_buffer_mats(GPULamp *lamp); void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[4][4], int *winsize, float winmat[4][4]); diff --git a/source/blender/gpu/intern/gpu_lamp.c b/source/blender/gpu/intern/gpu_lamp.c index 8bf343568b1..23bfb1dfb6b 100644 --- a/source/blender/gpu/intern/gpu_lamp.c +++ b/source/blender/gpu/intern/gpu_lamp.c @@ -52,9 +52,11 @@ #include "gpu_lamp_private.h" -bool GPU_lamp_override_visible(GPULamp *lamp, SceneRenderLayer *srl, Material *ma) +bool GPU_lamp_visible(GPULamp *lamp, SceneRenderLayer *srl, Material *ma) { - if (srl && srl->light_override) + if (lamp->hide) + return false; + else if (srl && srl->light_override) return BKE_group_object_exists(srl->light_override, lamp->ob); else if (ma && ma->group) return BKE_group_object_exists(ma->group, lamp->ob); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index f62c599a9b6..a08bef4472a 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -280,8 +280,8 @@ void GPU_material_bind( for (LinkData *nlink = material->lamps.first; nlink; nlink = nlink->next) { GPULamp *lamp = nlink->data; - if (!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay)) && - GPU_lamp_override_visible(lamp, srl, material->ma)) + if ((lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay)) && + GPU_lamp_visible(lamp, srl, material->ma)) { lamp->dynenergy = lamp->energy; copy_v3_v3(lamp->dyncol, lamp->col); |