[lib] Massive : high performance quad rendering and texture animation for Starling through custom DisplayObject

You can think of this lib as some kind of Tilemap for Starling : it renders lots of quads/images in a single DisplayObject with far better performance than regular Starling Quad/Image classes.

You are currently limited to 16383 quads per MassiveDisplay instance (I’m gonna remove that limit)

It’s available on haxelib : haxelib install massive-starling

Github page : GitHub - MatseFR/massive-starling: High performance quad rendering and texture animation for Starling through custom DisplayObject

Benchmark demo MassiveDemo (README massive-starling/samples/demo at main · MatseFR/massive-starling · GitHub )

Hex grid demo MassiveHexGrid

Particle Editor demo (work in progress) ParticleEditor

I believe this lib has lots of potential and can be useful to many devs using Starling : feedback is warmly welcome !

Current version is 1.0.0-alpha, it should be pretty stable : only known issue is an error occuring with ParticleEmitter when building to cpp. It’s my first time with @:generic, I’ll welcome any help with that issue : the haxe part works fine, the error occurs when building the c++ source files

4 Likes

Awesome work and thanks for sharing this for all @Matse! I look forward to having a play with it!

1 Like

@Bink Thanks ! I’d love to get some feedback, good or bad :slight_smile:

Massive was updated to 1.0.0-alpha.1 on github and haxelib

  • MassiveDisplay now has a renderMode property which is expecting values from MassiveRenderMode
    Default renderMode is either MassiveRenderMode.FLOAT32ARRAY (non-flash targets) or MassiveRenderMode.BYTEARRAY_DOMAIN_MEMORY (flash/air target)
  • MassiveDisplay now has a colorMode property which is expecting values from MassiveColorMode. There is a new mode called REGULAR, which stores vertex color over 4 bytes. This prevents some cool color effects when setting color values higher than 1.0, but brings a small performance improvement (about 5-10% except with Vector render mode on flash/air target, where it’s slower)
    Default colorMode is MassiveColorMode.EXTENDED
    Note that there is an issue with MassiveColorMode.REGULAR which happens on Firefox but not on Chrome on my system : when using that color mode with FLOAT32ARRAY or VECTOR render modes quads with a blue color value over 0.5 appear all blue. I’ll have to look into it a bit more.
  • MassiveDisplay instances now share program, except when you set a custom one
  • MassiveDisplay index buffer creation was optimized
  • MassiveDisplay’s renderData and updateExactBounds methods were finalized
  • MassiveDisplay and DisplayData : colorAlpha, colorRed etc were renamed to simply alpha, red etc to avoid Starling’s Tween considering them as Ints
  • MassiveDisplay and DisplayData now have a color property (Int)
  • MassiveDisplay was reworked to be more flexible : setting rendering-related values after adding it to Stage could result in errors or weird results, this is no longer the case.
  • All demos were updated with those changes, particle editor demo now lets you set renderMode and colorMode
2 Likes