Archived

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

Abob

ID3DXSprite slow?

Recommended Posts

Is it true that ID3DXSprite is slow? (DirectX 8.1) I thought that D3DX was very well optimized. But I read in another post that ID3DXSprite is not as fast as it could be. Maybe I will have to write my own Sprite class and see if I can beat it. Anybody know how well optimized ID3DXSprite is? Or have another Sprite class I could test it against? Thanks for any help

Share this post


Link to post
Share on other sites
quote:
Anybody know how well optimized ID3DXSprite is?

I think it uses an internal dynamic buffer for rendering, or something similar. I mean a buffer where all sprites are appended to be rendered in a big DrawPrim call.

Did you test ID3DXSprite? Modern cards should be able to kick hundres of thousands of sprites to the screen with no trouble. What''s the frame rate you got?

Share this post


Link to post
Share on other sites
In my case the ID3DXSprite is faster than the Blit i wrote myself (maybe i wrote a special bad one, but i dont think so), when drawing 1400 tiles on the screen i got a speed increase of 40 fps by using ID3DXSprite.

So I beleive that ID3DXSprite buffer up it''s sprites as Coder says, to improve the speed.

Just make sure you only call Begin(), End() once every frame and not for each call to ID3DXSprite->Draw(), because Begin() End() restores ALL the renderstates, and you can easily gain huge advantage by restoring only those renderstates you have changed.

Share this post


Link to post
Share on other sites