Texture Matrix Rotation

I have a simple square texture which maps to a simple quad.

I want the the mapped quad to rotate as it moves.

Is it faster to

  1. rotate the vertices of the quad using the modelview matrix
  2. rotate the texture coords using the texture matrix
    the same?

Thanks for any feedback

1+2 are gonna give different visual results

both aint super fast
your best bet would be
A/to update the rotated texcoords or verts on the cpu + send them to be drawn
B/do the rotation in the vert shader

I’m hard pressed to imagine why you’d ever want to do anything more than (1) if you don’t have to.

i thought that too, but then considered he might be talking about drawing 600,000 of these hypothetical quads - maybe billboarded or something. If so, a modelview matrix change for each quad becomes an issue.

Seems no more expensive than a texture matrix change, no?

no, but a shader (as suggested by zed) would be a better solution, yes?

Yes, but it depends on the hardware, no?

Love these one-liner responses. :slight_smile:
If you use a shader to simplify, then it doesn’t matter much whether you use it to rotate the quad or its texture coords.

Rotating the texture will result in a different look, because the texture might be cut of at the corners, when it is rotated by 45 degrees.

Also the hardware is optimized to work with an identity-matrix as the texture matrix. So it might be slower.

Haven’t tried it yet, although i will need to do it soon. Tell me what solution you used and how well it worked.