Archived

This topic is now archived and is closed to further replies.

Estauns

Batching Quads : Rotations?

Recommended Posts

When you go to batch a bunch of quads (for 2D sprites), is there a way to still do rotations on the individual level? Or are you stuck batching by state, then texture, then rotation? If theres a way, please let me know.

Share this post


Link to post
Share on other sites
I doubt that you could handle rotations on an individual level if you were batch rendering them, since in order to do different transformations, you must:
(1) Build transformation matrix, set it
(2) Render that object
and then repeat for each separate object.

So, you are stuck batching by state, then texture, then rotation. I hope I understood your question correctly


Dustin Franklin
Mircrosoft DirectX MVP

Share this post


Link to post
Share on other sites
You can do the rotations yourself before adding the quads to a batch. Also make a lookup table for sin/cos to speed up calculations.

Share this post


Link to post
Share on other sites