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

This commit is contained in:
Clément Foucault 2019-03-13 16:06:23 +01:00
parent 0e9ea707b5
commit 3952fd199a
Notes: blender-bot 2023-02-14 10:21:15 +01:00
Referenced by issue #62634, View-oriented Light Threshold & Incorrect Scattering for SSS Materials [EEVEE]
Referenced by issue #59448, Eevee broken Area Light shadows for square and rectange shape
1 changed files with 8 additions and 0 deletions

View File

@ -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 */