[Bf-blender-cvs] [839fe4e01c4] master: Eevee: Opti: Don't consider lights that have no power

Clément Foucault noreply at git.blender.org
Sat Mar 23 19:19:14 CET 2019


Commit: 839fe4e01c43328dd43562b03c68564e597d7e7f
Author: Clément Foucault
Date:   Sat Mar 23 19:18:51 2019 +0100
Branches: master
https://developer.blender.org/rB839fe4e01c43328dd43562b03c68564e597d7e7f

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.

===================================================================

M	source/blender/draw/engines/eevee/eevee_lights.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list