As of Defold 1.2.106 this is no longer true. Instead of issuing one drawcall per emitter, we now batch on:
- Emitter material
- Texture (tile source)
- Blendmode
- Render constants
As of Defold 1.2.106 this is no longer true. Instead of issuing one drawcall per emitter, we now batch on:
@britzl wrote a nice summery here How to "merge" sprites in defold here is a blatant copy of it!
To clarify:
Rendering of sprites, spine models, particle fx etc
Rendering of gui scenes
Layers are used to group different nodes to reduce the number of draw calls. Some images:
Example of the complexity stencil add
A basic scene
Same scene with a stencil
Does somebody can to explain why?
In gui the color is sent as vertex attributes as opposed to uniforms (I’m quoting Sven here).
Thank you, as I thought. And I have been to look into shaders before ask =)
And why is that? You could have the possibility to set vertex attributes for sprites as well to be used for tinting (or other things) in the sprite shader as well.
Or do you use them internally for something?
Could you post your overdraw shaders?
If we could get the ability to set tinting / alpha with sprites in a way which didn’t break batching it would be super great.
The answer to that is customizable vertex formats, which I think is on our roadmap for this second half of this year. (@britzl knows more)
agree,
sprite tinting is required to create a retro lighting like the old X-Com, for example:
Yeah, it’s in our roadmap. Not sure when we’ll tackle it, but if I’m guessing it’s somewhere in December or January.
Hi! When are you planning on fixing the issue(batching tint and other)?
We mentioned custom vertex formats in our most recent Roadmap Post. We’re slightly behind in terms of what we had hoped to deliver by now due to in part some stability issues during the autumn and in part because of internal needs that was given higher priority. The roadmap post is still accurate, but I will post an update in beginning of January with some updates.
any news?
News on custom vertex formats or on the roadmap (there was a new roadmap post made in January as promised)?
News about this:
as I understood “custom vertex formats” solve this.
I’d like to hear some clarifications on this amazing post, namely if and how the situation changes when using custom render predicates / materials / shaders, since if I understand it correctly, this guide assumes that the builtins are used everywhere.
Would different component types break batching if they were to use the same material? Or different materials but the same rendering predicate?
Do different materials break batching by themselves, or is it ultimately because they use different shaders?
Tint is explicitly said to break batching (as long as the values are not the same), but I assume this goes for any other custom constant I might be using, right?
Does this apply only to fragment shaders, or do different vertex shader constant values also break batching?
Thanks for any insight you can give me.
The batch rules are documented here: