Skip to content

Commit

Permalink
Batching - flip normal map polarity for rects
Browse files Browse the repository at this point in the history
An earlier PR godotengine#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.
  • Loading branch information
lawnjelly committed Apr 3, 2021
1 parent e6e1f62 commit 8348c97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gles_common/rasterizer_canvas_batcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8348c97

Please sign in to comment.