Support for Batching , SubBitmapData and MultiTextureBatching?

Yesterday on HaxeUP Hamburg Nenad Bojkovski talk about batching in Openfl ( using SubBitmapData and MultiTextureBatching ) for better performance for WebGL , video is here
https://www.twitch.tv/videos/548219549 ( starts from 53:40 min )
Is this available in OpenFL branch or is part of InnoGames OpenFL branch only ?
Batching and multitexture batching looks like a good idea and also if OpenFL combine all images in one ( or many ) texture atlases in runtime ( if there are not similar to https://github.com/bendmorris/hxpk) can give performance boost too.

1 Like

The current branch of openfl in github is what was once called the “Batcher” branch where all those improvements are being worked on. I am not sure the current state of that.

Right now, the somewhat sane way of having texture batching is with the “Tilemap” control and you are right with the “combine all images in one ( or many ) texture atlases in runtime” idea. I made a fastrect packer and I pack all my assets into one or two atlases in runtime and make my entire games with Tilemap so I can squeeze every drop of extra performance.

Biggest disadvantage of a Tilemap workflow is that Tiles don’t play nice with other DisplayObjects and that Tiles aren’t event emitters so no Mouse/Touch input. (On the advanced side, masks are not implemented and shaders act in an unexpected manner).

I don’t know if I answered anything but these are my two cents.

It is definitely interesting information. So if DisplayObjects is render via Tilemap and have event emitters that will give some performance boost.
I’m not sure how InnoGames did that , but maybe they still use DisplayObject instead Tilemap.

I’m wondering: if I use textures and push it to GPU and then use it in Bitmap
indent preformatted text by 4 spaces
var bmp = newBitmap(BitmapData.fromTexture(texures));
Does it still render my bitmap as texture in GPU with 1 draw call?

I didn’t check the code but I don’t think so. I’m pretty sure it will recreate a BitmapData so you will have an increase of memory used plus one more draw call.

I’m working on a new renderer that will expand the batching significantly.

Bottom-line is that Bitmap + bitmap.scrollRect is all we’ll need to batch on the display list

3 Likes