diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-23 21:18:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-23 21:18:51 +0300 |
commit | 839fe4e01c43328dd43562b03c68564e597d7e7f (patch) | |
tree | 56195b2f8185d3c99f34b3b1be35c7eeaaf41045 /source/blender/draw/engines/eevee/eevee_lights.c | |
parent | b40aa83910b49efe75071aa8a78b9dbf22e2fe1b (diff) |
Eevee: Opti: Don't consider lights that have no power
This may be usefull if power is animated ans is to be activated at one
particular point in time.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lights.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lights.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index b27aa159a94..ae1634b9d9c 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -336,13 +336,18 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) const DRWContextState *draw_ctx = DRW_context_state_get(); const float threshold = draw_ctx->scene->eevee.light_threshold; - /* Step 1 find all lights in the scene and setup them */ if (linfo->num_light >= MAX_LIGHT) { printf("Too many lights in the scene !!!\n"); } else { Light *la = (Light *)ob->data; + + /* Early out if light has no power. */ + if (la->energy == 0.0f || is_zero_v3(&la->r)) { + return; + } + EEVEE_Light *evli = linfo->light_data + linfo->num_light; eevee_light_setup(ob, evli); |