Mirage examples

What this is:

Mirage is an immediate-mode 3D engine for simple games, on the desktop and in the browser. Every example below is the browser build of the one in the repository, packaged by cargo mirage web and served cross-origin isolated so the game runs on a worker over shared memory.

Click an example to play it. On the desktop the same example runs with cargo run --example <name> from a checkout.

Examples:

  • the player beside the pond, the portal beyond Play

    sprite-adventure

    • Sprites
    • Relief lighting
    • Custom surface
    • Save data

    A two-area world with a custom water surface, a torch-lit cave through a portal, and progress saved across runs. The sprites are lit in 3D through relief maps.

  • the elf dancing in front of the lamp post, the butterfly and its light above Play

    animation

    • glTF
    • Skinned animation
    • Blending
    • Shadows

    A character under an animator over ten states, with clips that loop, play once, or blend by walking speed. A sun, a shadowed lamp post and a spot light light the scene.

  • the ball at the bricks, one of them broken and scattering sparks Play

    breakout-game

    • Fixed-step tick
    • Point lights
    • Sound
    • Menus

    A paddle bats a ball at a grid of bricks under fixed-step physics, the ball and its spares the only lights in the court, with sound, music and menus.

  • the selected unit, its reachable tiles marked, a hovered tile named Play

    isometric-board

    • Orthographic
    • Ray picking
    • Generated mesh

    A fixed diagonal view through an orthographic projection. A click selects a unit, a click on a tile orders it there, and a rock is built by arithmetic per seed.

  • a station's name and a line typing out in the game's custom fonts Play

    ui-fonts

    • Custom fonts
    • UI

    Custom fonts in the UI, and a line of text that types out when you click a station.

  • the South button held under Space, the left stick at full deflection Play

    input-lab

    • Gamepad
    • Actions
    • Rebinding

    Every pad button, axis, stick, mouse button and wheel lane as a row in a table, each with its live bindings and buttons to rebind by capture.

  • the loaded sky over the scene, reflected in a sphere at roughness zero Play

    material-playground

    • Skybox
    • Materials
    • Post chain
    • Fly camera

    Sky, light, material and post chain controls on panels. Choose between skyboxes and their lighting, then fly through the scene.

  • the three passes over two spheres and a glowing cube Play

    post-effects

    • Post effects
    • WGSL

    A vignette, grain and scanlines over a lit scene, each one a custom post effect with live controls, showing how a game writes its own screen-space effects.

  • the sound panels over the room, one sustained cue checked Play

    sound-lab

    • Spatial audio
    • Sustained cues
    • Falloff

    One-shots, sustained cues, and three placed sources you drag around the room. Walk with WASD or a stick to hear the mix change.

  • a field of instanced cones drawn to the horizon Play

    stress-preview

    • Instancing
    • Frame cost

    A field of thousands of generated rocks instanced to the horizon. Set the instance count to see what the engine handles, with a report of what each frame costs.