Merge pull request #47591 from lawnjelly/ewok_normal_polarity

Batching - flip normal map polarity for rects
This commit is contained in:
Rémi Verschelde 2021-04-03 20:57:15 +02:00 committed by GitHub
commit 34c23002ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2121,11 +2121,11 @@ bool C_PREAMBLE::_prefill_rect(RasterizerCanvas::Item::CommandRect *rect, FillSt
// apply to an x axis
// the x axis and y axis can be taken directly from the transform (no need to xform identity vectors)
Vector2 x_axis(tr.elements[0][0], tr.elements[1][0]);
Vector2 x_axis(tr.elements[0][0], tr.elements[0][1]);
// have to do a y axis to check for scaling flips
// this is hassle and extra slowness. We could only allow flips via the flags.
Vector2 y_axis(tr.elements[0][1], tr.elements[1][1]);
Vector2 y_axis(tr.elements[1][0], tr.elements[1][1]);
// has the x / y axis flipped due to scaling?
float cross = x_axis.cross(y_axis);