Archived

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

JohnBSmall

Can you verify a rumour about the speed of ID3DXSprite?

Recommended Posts

I heard somewhere (can't remember where) that the ID3DXSprite interface is not as fast as it could/should be, and it is better (for efficiency) to write your own wrapper. Does anyone know if this is correct? Should I write my own 2D wrapper for DX8? John B Edited by - JohnBSmall on March 19, 2002 5:32:26 PM

Share this post


Link to post
Share on other sites
I''ve also heard this rumor, but never found an answer or a solid reason - I guess If no-one knows a benchmark is in order
(I would like to know too)

Share this post


Link to post
Share on other sites
I think the reason people have said this is because they have not coded it in properly, writing your own wrapper would be the same code anyway in many respects.

Downloads, Free GoldLib game library, D3DXSprite tutorial, New platform game: .-= The ZeroOne Realm =-.

Share this post


Link to post
Share on other sites
The only reason I can think of that might make ID3DXSprite relatively slow is lack of batching. But I don''t know anything about the internals of ID3DXSprite, so I don''t know whether this is a potential problem, or whether the interface does do a reasonable amount of batching.

John B

[and why does the server keep eating my post - I''ve had to write this 3 times to get it posted]

Share this post


Link to post
Share on other sites
G''day!

D3DXSprite doesn''t batch, which means that a well-written batch-friendly version could perform significantly better.

That being said, D3DXSprite is pretty fast. Check out Anarchi''s game, it uses D3DXSprite and it was plenty fast.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
when I wrote my particle engine a while back, i''ve had problems drawing it with directx in terms of speed. I used "batching", which means I filled up the vertex buffer with about 512 sprites before I drew it (I actually drew different amounts and still get the same results).

It seemed when I was close to the particle engine the frame rate would DROP bad. But I would move out a little and it would jump from say 20 to 40 fps. then I moved out a little more and it would jump to like 80fps and then I move out a little more and it would jump to 100fps.

These jumps in speed seem to happen at certain distances away from the particle system. I found this wierd.

-Pac

Share this post


Link to post
Share on other sites
quote:
Original post by Brobanx
errr.... what''s batching?

Batching is (AFAIK) trying to send data to the card in the largest chunks possible - so that (for example) instead of calling Draw*Primitive 5 times in a row, you call it just once, with more data.

To DrunkenHyena: Thanks for the info - I''ll probably try using ID3DXSprite first, and then replace it if it''s too slow (or if I have enough free time)

John B

Share this post


Link to post
Share on other sites