Skip to content

LittleJS 1.30 - Lit Billboards, Mesh Colliders and Grass

Latest

Choose a tag to compare

@KilledByAPixel KilledByAPixel released this 12 Nov 06:13
· 12 commits to main since this release

New Demos

  • 3D Grass - A field of 20000 blades in one draw call, bent by a vertex shader as gusts of wind roll across it
  • 3D Lit Billboards - A cloud of sprites lit by a light drifting through it, bright near the light and dark in the shade
  • 3D Mesh Collider - Walk a level made of one mesh: ramps, stairs and walls

New Changes

  • 3D sprites, particles and billboards are lit: by the lights, the sun, the ambient and the shadows, and roundLighting lights them as balls, for smoke and clouds a light shines into
  • MeshCollider makes any mesh part of the 3D level's collision: objects walk up ramps, climb steps and slide along walls as capsules, and a prop placed in the 3D level editor can collide by its shape with meshCollision
  • A Shader takes uniforms of the game's own, new Shader(code, '', {wind: vec2()}), changed each frame with setUniform and no recompile, in 2D and 3D
  • InstancedMesh3D.setDataAt gives each instance four numbers of its own that a Shader reads, like each blade of grass's sway
  • Icons in text: setTextIcon('coin', tile(5)) and any text shows the tile where :coin: is written, in drawText, drawTextScreen, the UI system and ImageFont
  • 3D solid collision goes through a grid once there are many solids: 1000 solids update about four times faster, 2000 about ten times
  • Many more fixes from four review passes, see the changelog

Breaking Changes

  • 3D sprites, particles and drawBillboard were always unlit and are now lit, so they look different: set emissive = 1 on a sprite object or particle emitter, or render3D.emissive = 1 before a drawBillboard of your own, for the old look; additive ones, like fire and sparks, are unchanged

Fixes

  • The gamepad sticks' dead zone is round, so diagonals respond as straight pushes do
  • A glTF OPAQUE material that shares a texture with a MASK or BLEND one draws solid
  • A 3D collision callback that moves its object, like a portal, has its next contacts tested where it went
  • The 2D and 3D level editors: many fixes to areas, properties, paste, prefabs and autosaves
  • A small level, LDtk file or example link can no longer make millions of objects or hang the page

Check out the latest on GitHub to see everything we've been working on!

grass meshCollider litBillboards