GP: Fix Shadow rotation bug

This commit is contained in:
Antonioya
2018-10-01 11:36:06 +02:00
parent 534009098e
commit be0e58d980

View File

@@ -60,6 +60,12 @@ void main()
/* move point to new coords system */
vec2 tpos = vec2(uv.x, uv.y) - loc2d;
/* rotation */
if (rotation != 0) {
vec2 rotpoint = vec2((tpos.x * cosv) - (tpos.y * sinv), (tpos.x * sinv) + (tpos.y * cosv));
tpos = rotpoint;
}
/* apply offset */
tpos = vec2(tpos.x - dx, tpos.y - dy);
@@ -67,10 +73,6 @@ void main()
tpos.x *= 1.0 / scale[0];
tpos.y *= 1.0 / scale[1];
/* rotation */
tpos.x = (tpos.x * cosv) - (tpos.y * sinv);
tpos.y = (tpos.x * sinv) + (tpos.y * cosv);
/* back to original coords system */
vec2 texpos = tpos + loc2d;