Sign in to follow this  
rjackets

Sprites vs Quads

Recommended Posts

Just a quick question. I know it's been discussed in other threads but I haven't found a difinitive answer yet. So, does anyone know whether which is faster/more efficient : sprites or quads? At the moment I'm rendering my (9 pass) scene using screen-aligned quads, but I'm drawing my HUD with sprites (2d screen space, not object space). I would like to know which is fastest so that I'm not slowing my program down unnecessarily. If their about the same then I guess I can continue to do what I am doing. Thanks in advance.

Share this post


Link to post
Share on other sites
if you're using DirectX you should stick to the ID3DXSprite interface 'cause that's pretty good and it'll require alot of coding to get a system that's capable of compete with that interface.

don't do the same mistake that everybody else's doing: do NOT create a ID3DXSprite interface for each of your sprite 'cause the interface is a batcher that'll batch you ID3DXSprite->(...) functions into one call (or something like that.. hasn't worked with the ID3DXSprite long enough)

Share this post


Link to post
Share on other sites
Don't worry, I've only got one Sprite instance that I apply various textures to. But I've also got my own custom (very basic) Quad class too, which does the same thing (also, only one instance). And from what you've said, if the Sprite class is an "intelligent" quad rendered I'll just stick with my "dumb but hopefully faster" one ;)

Thanks all.

Share this post


Link to post
Share on other sites
The thing is that with the spriteinterface you can just sort of draw textures in the next frame and it will then only have to render one picture each frame. With the simple quad rendering engine it just renders them immidiately to the frame. Which is basically the same as if you used d3dxspriteinterface->Flush() every time after d3dxspriteinterface->Draw(), meaning that the spriteinterface should be faster unless you draw only one texture per frame. (It's nearly as fast in that case also.)
I don't know how incorrectly I explained that but you propably got the idea.

With 600-950 fps on the spriteinterface for a typical scene on a fairly typical quite modern computer anyone should not complain.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this