From b5bed328a3339b983933da8533bc1308db0defd0 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 3 Apr 2021 10:53:20 +0100 Subject: [PATCH] Batching - flip normal map polarity for rects An earlier PR #46898 had flipped the rotation basis polarity. This turns out to also need a corresponding flip for the light angles for the lighting to make sense. --- drivers/gles_common/rasterizer_canvas_batcher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gles_common/rasterizer_canvas_batcher.h b/drivers/gles_common/rasterizer_canvas_batcher.h index 025d2fcd8835..1404d8a56f71 100644 --- a/drivers/gles_common/rasterizer_canvas_batcher.h +++ b/drivers/gles_common/rasterizer_canvas_batcher.h @@ -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);