How many Direct3D Sprites?
I know to speed up drawing of sprites, you should use one Direct3D sprite and call multiple sprite.draw functions for each sprite. How many Direct3D sprites should I have? Should I have one for everything, or have one for the tile map, one for the UI, one for the text, etc? Or does it not matter?
I saw the post and just thought I'd ask. Where can I find a good tutorial on Direct3D Sprites. It sounds like something I'd like to try.
Thanks
boolean010
Thanks
boolean010
Quote:Original post by boolean010
I saw the post and just thought I'd ask. Where can I find a good tutorial on Direct3D Sprites. It sounds like something I'd like to try.
Thanks
boolean010
search the articles here.
as for the OP, I'm assumming you're talking about texture atlasing, in wich case more you combine onto one sheet the better aslong as the texture size doesn't get to big and slow your card down. Also if you're doing alot of switchs between dhaders and render states, atlasing isn't going to help as much as you will probably be making less use of it.
but your question isn't that clear, so i might just sound like i was rambling.
Quote:Original post by Tom
One for everything. You get no benefit whatsoever for having more than one.
That's not always the best choice. There are quite common scenarios when having more than one Sprite comes in handy. Specifically, if you're rendering some objects with Alphablending enabled, and some with it disabled, you'd want one per type. You can call begin on both, queue up the draws as you go, and then call end on both (on the opaque one first, most likely).
If you only use one Sprite, you'd need to either go through all the opaque objects first, then render the blended ones, or you could draw all objects with alphablending. Both options are inefficient.
I'd recommend using one Sprite per type of drawing. If some objects require a certain set of states, and others require a different set of states, they should use different Sprites.
Hope this helps.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement