Jump to content
  • Advertisement
Sign in to follow this  
nhatkthanh

ID3DXSprite SetTransform

This topic is 2995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I couldn't find any more information or docs regarding how DirectX implementing ID3DXSprite SetTransform, so if someone can shed some light on this, I would greatly appreciated. Consider this example where you have a large number of sprites, each with their own transformation. When it's time to draw, you set transform for each and draw for each then finally flush. for each sprite do sprite->SetTransform( ... ); sprite->Draw ( ... ); end sprite->Flush( ... ); ID3DXSprite batch all this sprite draw up and make the DIP call when you flush, but what I'm wondering is how SetTransform work, does it transform the sprite on the CPU at the time SetTransform and Draw are called? That way all vertices are transformed by the time it's send to the GPU. Is my assumption on this correct? If not can someone gives more details on how the SetTransform gets batch up? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by nhatkthanh
ID3DXSprite batch all this sprite draw up and make the DIP call when you flush, but what I'm wondering is how SetTransform work, does it transform the sprite on the CPU at the time SetTransform and Draw are called? That way all vertices are transformed by the time it's send to the GPU. Is my assumption on this correct? If not can someone gives more details on how the SetTransform gets batch up?
I would assume that the vertex transformation is done on the CPU, using the most optimal CPU instruction set available; SSE, 3DNow!, etc (Which the D3DX library already does).
The reason being that I expect that doing the vertex transform on the CPU for 4 vertices is likely to be considerably more lightweight than making several DIP() calls.

The easiest way to find out is to make a test app that does a few SetTransform() and Draw() calls, and then run that through Pix and see if it results in a single DrawIndexedPrimitive() call.

Share this post


Link to post
Share on other sites
Quote:
Original post by nhatkthanh
does it transform the sprite on the CPU at the time SetTransform and Draw are called?


Yup.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!