Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TechnoCore

Pages: [1]
1
Graphics / Does SFML batch render draw calls?
« on: January 07, 2009, 11:49:16 am »
Quote from: "irri"
Hmm.. is this the same as I'm experiencing in my game ( http://www.sfml-dev.org/forum/viewtopic.php?t=830 )???
I call the draw-method at least around 140 times per frame. And it goes really slow on my laptop.


Yeah, its because there is one draw-call per sprite. The graphics card can only handle around 1000 draw-calls per frame (or something like that) after that it will slow down alot.

In order to optimize things you can send a chunk (a batch) consisting of many sprites at the same time in a single draw-call. This is called batching.

Optimal size of a batch is something like 1000 vertices, and a sprite would consist of 4 vertices. (4 corners ), so maybe 250 sprites per draw-call could be rendered without any penalties in speed. 250 sprites  * 1000 draw calls = 250.000 sprites / frame on a modern gfx card.

And just like Laurent says it's in the to-do list :)

2
Graphics / Does SFML batch render draw calls?
« on: January 07, 2009, 11:28:22 am »
Thanks for your quick answer :)

I see the problem with the ordering. Nice to hear about the batching class.

So I could then maybe create a batch and add sprites to it, like:
my_batch.AddSprite( sprite )

...and when i want to draw all sprites in the batch i just call like Window.DrawBatch( my_batch )

Or ?

/TC :)

3
Graphics / Does SFML batch render draw calls?
« on: January 06, 2009, 05:50:34 pm »
When i draw more than around 1000 sprites each frame, the app really slows down. Why? Is there no batching of the draw calls?

I should be able to draw *a lot* more than that, should i not? Maybe I am doing something wrong.

My app is in C++, on an Intel quad 9550, with the radieon 4870 gfx card.

Thanks for any help!

/ TC :)

Pages: [1]