Skip to content

v2.11.0

Choose a tag to compare

@riebel riebel released this 25 Sep 19:20
· 22 commits to master since this release

Faster camera movement

Tile and object layers are now PixiJS render groups. PixiJS v8 bakes a batched mesh's transform into its vertices on the CPU, so panning or zooming a map, or applyParallax moving its layers, repacked every tile quad of every layer each frame. As render groups, only a group transform changes.

  • A panning and zooming 256x256 map with four tile layers drops from 4-6 ms to a few hundredths of a millisecond of render time per frame on a desktop CPU; mobile CPUs save correspondingly more.
  • Rebuilding one layer after an edit no longer rebuilds the other layers' render instructions.
  • Rendering is unchanged: identical pixels, except that layer alpha and tint are applied as a float uniform, which can move a channel by 1/255.
  • Layers with a Tiled blend mode other than normal, and layers inside a group layer that blends, stay plain containers, because PixiJS does not apply a render group's blend mode to its contents. A blend mode set on the TiledMap or one of its ancestors no longer reaches render-group layers; set isRenderGroup = false on the layers that must blend with it.
  • New npm run measure:camera measures the camera cost with the built package in headless Chrome.