Fastest way to render 2D sprites

Started by
67 comments, last by 2dcoder 18 years, 9 months ago
yeah, I'm here, however I'm pretty busy due to a beta-deadline this wednesday... but do not lose hope... :)
Ethereal
Advertisement
ok, perhaps shoot me a pm when you have a chance. Looks like it's just you and me in this thread anyway. :) Thanks for looking into it.
I'd appreciate it if you kept it public. I'd really like to see if someone was able to make something faster than the D3DX Sprite. Some source code would be nice to see too =)

BTW, I get 69 fps on 2dcoder's sprite test on an Athlon 2500+ (1.8GHz) and GeForce 6600GT (AGP), although it starts at 260 or so and slows down to 69 after about 3 seconds...I dunno what that's about.

"although it starts at 260 or so and slows down to 69 after about 3 seconds"

Probably because all the sprites aren't on screen at one time at first. They lauch at slightly different times. ;)

Thanks for running the demo.

I'm sure there's "cheats" we could make to increase performance. It seems rotating and scaling sprites also takes a hit in performance so perhaps pre-rendering one or both would help.

Direct Draw (DirectX7) sprite drawing is probably faster, but ofcourse you don't get all the fx either.

DirectX9's D3DXSprite() class is supposed to be faster than DX8's version. That would be a worth while test to see performance between the 2.

The only other method that is probably going to be faster than the D3DXSprite method is to render the sprites as quad primitives and batch them up. We'll have to see if anyone takes the time to code a similar demo using that method. ;)
Quote:Original post by 2dcoder
...

The only other method that is probably going to be faster than the D3DXSprite method is to render the sprites as quad primitives and batch them up. We'll have to see if anyone takes the time to code a similar demo using that method. ;)



that is exactly what the ID3DXSprite Interface does...
Ethereal
"that is exactly what the ID3DXSprite Interface does..."

Yep, I know that at least the DX9 version is supposed to do that, I've never seen any official statement on rather the DX8 version is batching or not.

But still, from the research I've done, and after talking with a few 3D developers, it seems a custom 2D sprite system using quads, sorting, batching, etc,etc, would be faster, but I've yet to see it.

So Metus, any update on your sprite testing?
Quote:Original post by Metus
Actually, i've just implemented a simple sprite demo (no demo.. sorry)...

I think it's interesting that you have a demo, and yet you have no demo... Please teach us how you do this! :)
Quote:Original post by Mattman
Quote:Original post by Metus
Actually, i've just implemented a simple sprite demo (no demo.. sorry)...

I think it's interesting that you have a demo, and yet you have no demo... Please teach us how you do this! :)


no, sorry, if i learned you that, i'd had to kill you :)
what i meant was - that i bet you understand - that i had a demo running in my bench-environment, not ready to be released as a standalone demo :)
Ethereal
On 2dcoder's sprite demo I get 99FPS on a Athlon64 3500+ (2.2GHz) 6800GT on Win x64, when using fraps to do a 60second benchmark.
Finally :)
student.powerhouse.net/patrik.wixner/spritedemo.zip

I don't know for how long this file will be available.. but here it is:
my sprite demo.

in the sprites.txt file there are 3 values; amount of sprites, max width and max height.

a little know-about: each sprite are individually rotated and translated each frame using std::rand() and some tiny logic.
Ethereal

This topic is closed to new replies.

Advertisement