optimize texture rotate calculation