Closed ndee85 closed 1 year ago
Working fine here: https://labs.phaser.io/view.html?src=src/bugs/6367%20text.js&v=dev
Text objects will only batch together up to the maximum texture count under the Multi Pipeline, as each of them uses a unique texture, just like in 3.55. Under the Mobile Pipeline they will be a drawcall each, as is everything else. They're never batched beyond the texture limit though (which is typically 16 texture units)
Hi, thanks for the quick response. I will try and isolate the problem on monday and see if the issue is occuring in combination with something else.
Will update the issue on monday.
Hi Rich, I just tried to see in which situations it works and it which not. It seems to work fine when running in Desktop mode. As soon as setting chrome dev tools to mobile and reload the page, it will break the batch. Here is what spector has to say: (Mobile)
(Desktop)
You said that there is a limit of 16 for some mobile devices. But we have only 3 elements. So I thing that this issue is caused by something else. I see a difference in the commands. PHASER_SINGLE_VS is called on mobile. On Desktop PHASER_MULTI_VS is called.
This is working correctly. On Mobile we use the new single batch renderer, which is massively faster than the multi pipeline one which is optimized for desktop GPUs. Mobile GPUs need handling very differently.
Yes, there are more draw calls, but they're all faster than the combined batch draw.
You can force mobile to use the multi pipeline if you like, but I'd strongly recommend against it unless you like tanking performance on iOS especially. See related threads about this
From the Change Log:
shaders/Mobile.vert
and shaders/Mobile.frag
are the two shaders used for the Mobile Pipeline.PipelineManager#MOBILE_PIPELINE
is a new constant-style reference to the Mobile Pipeline instance.autoMobilePipeline
is a new Game Configuration boolean that toggles if the Mobile Pipeline should be automatically deployed, or not. By default it is enabled, but you can set it to false
to force use of the Multi Tint pipeline (or if you need more advanced conditions to check when to enable it)defaultPipeline
is a new Game Configuration property that allows you to set the default Game Object Pipeline. This is set to Multi Tint as standard, but you can set it to your own pipeline from this value.PipelineManager.default
is a new propery that is used by most Game Objects to determine which pipeline they will init with.PipelineManager.setDefaultPipeline
is a new method that allows you to change the default Game Object pipeline. You could use this to allow for more fine-grained conditional control over when to use Multi or Mobile (or another pipeline)PipelineManager.boot
method is now passed the default pipeline and auto mobile setting from the Game Config.Thank you for your detailed clarification!
Version
Description
Batching for Phaser.GameObjects.Text seems to be broken in Beta 18. In 3.55.2 it is working fine, where texts are batched together and drawn in a single drawcall. Not so in Beta 18. Every new text objects creates a single drawcall. Found this with spector.js.
Example Test Code
Additional Information