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_punctuallights, 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 samesetCurrentAnimation/play/pause/stopAPI asSprite. Sprite3d— 3D billboard sprites underCamera3d(false/"cylindrical"/"spherical"), frame animation via the sharedFrameAnimationengine, packed-atlas parity (rotated + trimmed regions), alpha cutout, andflipX/flipY.Light3d— manipulable directional + ambient lighting managed likeLight2d; glTF scenes light meshes by their authored sun.- Mesh materials —
textureRepeat,textureFilter(decoupled fromantiAlias),baseColorFactor+ vertex colors,KHR_materials_unlit,alphaCutoff,emissive; OBJ/MTLmap_Kdtextures auto-load. Mesh.getBounds3d(),Camera3d.worldToScreen(), exportedAABB3d, and meshes with >65,535 vertices.loader.preload()/loader.load()are nowawait-able (Promise form; callback forms unchanged).- Aligned 2D + 3D animation API —
Spritegains the options formsetCurrentAnimation(name, { loop, speed, onComplete, next }),getAnimationNames(), andplay/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). Camera3dno longer culls sizeless grouping containers and their whole subtree (fixes a nestedGLTFModelrig 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.0Full details in the CHANGELOG.