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