[Bf-blender-cvs] [3952fd199ac] master: Fix T59448: Eevee broken Area Light shadows for square and rectange shape

Clément Foucault noreply at git.blender.org
Wed Mar 13 16:06:37 CET 2019


Commit: 3952fd199ac9285049bb22e3f9bb9aac822030c5
Author: Clément Foucault
Date:   Wed Mar 13 16:06:23 2019 +0100
Branches: master
https://developer.blender.org/rB3952fd199ac9285049bb22e3f9bb9aac822030c5

Fix T59448: Eevee broken Area Light shadows for square and rectange shape

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

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 f4fe088157e..db7d5be7cf6 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -693,6 +693,14 @@ static void eevee_light_setup(Object *ob, EEVEE_Light *evli)
 	copy_v3_v3(evli->upvec, mat[1]);
 	normalize_v3(evli->upvec);
 
+	/* Make sure we have a consistent Right Hand coord frame.
+	 * (in case of negatively scaled Z axis) */
+	float cross[3];
+	cross_v3_v3v3(cross, evli->rightvec, evli->forwardvec);
+	if (dot_v3v3(cross, evli->upvec) < 0.0) {
+		negate_v3(evli->upvec);
+	}
+
 	light_shape_parameters_set(evli, la, scale);
 
 	/* Light Type */



More information about the Bf-blender-cvs mailing list