Skip to content

v19.8.0

Latest

Choose a tag to compare

@github-actions github-actions released this 26 Jun 02:22
2488bde

What's New

3D grows up. glTF / GLB scene loading lands — author a scene in Blender (or any DCC tool), export a .glb, and load it like a Tiled map with level.load(...), with node animation, authored lighting, and real 3D bounds. And Sprite3d brings the 2.5D workflow: billboarded, frame-animated cut-out sprites that face a Camera3d (the Paper Mario look), sharing one FrameAnimation engine with the 2D Sprite.

New Features

  • glTF / GLB scene loader (Tier 1)level.load() instantiates every mesh node; parses the node graph, primitives, materials, perspective cameras, KHR_lights_punctual lights, scene bounds, and node animations. loader.getGLTF() exposes the raw descriptor.
  • glTF node animation + GLTFModel — rig-driven, hierarchy-preserving TRS animation (LERP/SLERP/STEP/CUBICSPLINE), driven through the same setCurrentAnimation / play / pause / stop API as Sprite.
  • Sprite3d — 3D billboard sprites under Camera3d (false / "cylindrical" / "spherical"), frame animation via the shared FrameAnimation engine, packed-atlas parity (rotated + trimmed regions), alpha cutout, and flipX / flipY.
  • Light3d — manipulable directional + ambient lighting managed like Light2d; glTF scenes light meshes by their authored sun.
  • Mesh materialstextureRepeat, textureFilter (decoupled from antiAlias), baseColorFactor + vertex colors, KHR_materials_unlit, alphaCutoff, emissive; OBJ/MTL map_Kd textures auto-load.
  • Mesh.getBounds3d(), Camera3d.worldToScreen(), exported AABB3d, and meshes with >65,535 vertices.
  • loader.preload() / loader.load() are now await-able (Promise form; callback forms unchanged).
  • Aligned 2D + 3D animation APISprite gains the options form setCurrentAnimation(name, { loop, speed, onComplete, next }), getAnimationNames(), and play / pause / stop.

Bug Fixes

  • glTF/3D meshes no longer render at the wrong position under Camera3d (anchor-offset no longer leaks into the shared mesh view matrix).
  • Camera3d no longer culls sizeless grouping containers and their whole subtree (fixes a nested GLTFModel rig not rendering).

Performance

  • Allocation-free glTF animation pose path — sampling + re-posing an animated rig allocates nothing per frame.
  • ~30% faster mesh batching (and ~7x less GC) via a versioned typed-array vertex remap — benefits all 3D mesh rendering.

Compatibility

No breaking changes — everything additive / back-compatible. Pairs with @melonjs/debug-plugin@16.1.0 (3D bounding-box overlay).

Install

npm install melonjs@19.8.0

Full details in the CHANGELOG.