From abbd9971933e7bbca926d118a74f1d1f9c19d2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 9 Jul 2018 22:29:45 +0200 Subject: Eevee: LightCache: Use render visibility to select the probe If a probe is not visible during render, it will not be selected to be baked into the lightcache. --- source/blender/draw/engines/eevee/eevee_lightcache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 0828d7bfa93..8ae18c8deb8 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -407,6 +407,10 @@ static void eevee_lightbake_count_probes(EEVEE_LightBake *lbake) DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { + if (!BKE_object_is_visible(ob, OB_VISIBILITY_CHECK_FOR_RENDER)) { + continue; + } + if (ob->type == OB_LIGHTPROBE) { LightProbe *prb = (LightProbe *)ob->data; @@ -939,6 +943,10 @@ static void eevee_lightbake_gather_probes(EEVEE_LightBake *lbake) * This allows a large number of probe to be precomputed (even dupli ones). */ DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { + if (!BKE_object_is_visible(ob, OB_VISIBILITY_CHECK_FOR_RENDER)) { + continue; + } + if (ob->type == OB_LIGHTPROBE) { LightProbe *prb = (LightProbe *)ob->data; -- cgit v1.2.3