Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Batching sprites into draw calls

Years of Service
User Offline
Joined: 13th Aug 2019
Posted: 19th Feb 2021 14:19
AGK attempts to batch sprites into as few draw calls as possible.

Is it possible to limit the number of batched sprites?

Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 22nd Feb 2021 09:00
Batch Rendering is quite difficult to handle, especially in Automated System by the Engine as opposed the Developer.
I'd actually say that in most Scenarios... the Batch and Draw Calls are going to be identical., as what is available to Draw is going to have a Unique Draw State; thus require being a Unique Draw Call.

This said Batch Calls actually do have their own overhead., meaning you actually DO NOT want to use Batch Calls unless you can guarantee what you've included in said Batch can be dispatched as a Single Draw Call because it has the same Draw State.
In essence I'd usually recommend Particle Systems are excellent candidates for Batch Draw Calls., and this is why these can have exceptionally good performance with Millions of Sprites On-Screen; where-as handling Millions of Sprites Manually; well that's going to be less ideal.

Now I think what would be useful would be "Instance" Commands., which would return an InstanceID... along with "AddToBatchGroup( )", "RemoveFromBatchGroup()" and "DrawBatch" Commands.
As this would also allow a breakdown of what can and can't be done with Instanced Objects / Sprites / etc. but also provide Control over Batch Processing.
Mind this said... honestly I don't think these are exactly the most important features improvements to focus on.

They'd be nice of course, but AppGameKit is VERY lacking in certain respects that there are other things I'd prefer to see to added / extended / improved / etc. first.

Login to post a reply

Server time is: 2023-12-09 15:41:39
Your offset time is: 2023-12-09 15:41:39