Phaser AE

3D Terrain

Free packv3.0.0-43DWorld

Ground with shape in it for outdoor 3D scenes, plus the questions a game asks of the ground: how high is it here, which way does it face, how steep is it, and where does this ray hit it. The answers match the mesh you see, so anything you place sits on it.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 19, 2026

3D Terrain: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

What it does

The landform is data. Name a preset, hills, mountains, dunes, plateau or island, or pass your own function from a world point to a height, and nothing else in the pack cares which: a level can come from a seed, a hand-written function or a file. featureSize is in world units, so growing size gives you more hills rather than the same hills made bigger, which is what makes a large terrain feel large. An after function reshapes the result on top of a preset: a continental shelf, a river valley cut through hills, a levelled building site.

What makes it read as ground rather than a coloured surface is the colormap, baked once over the whole terrain. Colour comes from height bands with soft edges, blends towards each band's cliff colour on slopes, and is jittered at two scales so flat ground never looks airbrushed, with a fine turf mottle in the grass. Close up, the renderer lays a world-space grain over sandy ground that fades itself out with distance. The colour is baked, so it costs nothing per frame.

The mesh is cut into chunks that each cull on their own and join without seams. heightAt interpolates over the same two triangles per quad that the mesh draws, so a tree, a crate or a character placed with it sits exactly on the surface, and normalAt uses the same normals the shading does. With edits, biome masks and footprint checks, the terrain is an authoring tool as well as a backdrop.

Features

  • Five landforms or your own — hills, mountains with sharp crests, wind-aligned dunes with slip faces, flat-topped plateau and an island whose edges go under water, or a height function of your own.
  • A baked colormap — four surfaces (grass, sand, snow, rock) or your own colour bands, cliffs drawn on slopes, and a paint callback for your own ground classes such as beach, dirt or vegetation.
  • Queries that match the render — heightAt, normalAt, slopeAt, raycast and place, all of which answer exactly headless as well as drawn.
  • Saved edits — raise, flatten, road, valley and seeded landform patches, applied in order, with undo, redo, and a JSON-safe save and load.
  • Biome masks — feathered forest, lake, mountain, hills and path regions that tint the ground and that biomeAt reports to foliage and editor tools.
  • Building footprints — foundation samples a rotated rectangle and returns an upright base height and the relief beneath it.
  • Distance detail — detail: 'walk' or 'overview' coarsens far chunks, with skirts over the gaps and morphed transitions, while every query keeps the full-resolution surface.
  • Endless ground — wrap: true makes the terrain a torus that repeats on both axes, so a camera can fly on in one direction and never meet an edge.
  • Ground that changes in play — render a Heightfield you own, write its heights, and refresh only the region that changed.

Good for

  • Exploration and walking games — hills or mountains with a first-person character standing on heightAt.
  • Driving and vehicle games — normalAt aligns a car or a tank to the slope, and a road edit cuts an even route through the hills.
  • Strategy games and city builders — flatten pads and foundation checks for buildings on uneven ground.
  • God games that reshape the land — spells that raise a volcano or split an island, through a shared heightfield and refresh.
  • Flight over endless ground — a wrapped terrain with no edge, in the style of Magic Carpet.
  • Island and coastal scenes — the island landform with water shoaling against its beaches.
  • Level editors — edits with undo and redo, saved and loaded as JSON.

Make it yours

A build takes the size, the grid resolution, the landform, its amplitude, base height, feature size and seed, the surface or your own colour bands, the colormap resolution, the turf and grain strength and the chunk count. A procedural world is a seed and a preset; a designed level is a height function or a list of edits on top of one, kept separately so you can regenerate it. setDetailTexture swaps the procedural grain for your own 256×256 image, blended in three projections so cliffs do not stretch it.

Three quite different terrains from the same pack: a 400-unit grass island with a road and a flattened pad for a village, walked in first person; a wrapped mountain range, much larger, flown over endlessly with the fog kept inside half its size; and a strategy map whose own rules write the heights each turn and repaint only the ground that moved.

A quick look

A mountain range, then a valley, a road and a level building pad cut into it, and a footprint checked:

game.terrain.build({ shape: 'mountains', size: 800, featureSize: 120, seed: 7 });
game.terrain.edit([
    { kind: 'valley', points: [{ x: 0, z: -80, y: 3 }, { x: 20, z: 80, y: 7 }], width: 15, feather: 20 },
    { kind: 'road', points: [{ x: -30, z: 0, y: 12 }, { x: 30, z: 20, y: 16 }], width: 5, feather: 4 },
    { kind: 'flatten', x: 30, z: 20, radius: 12, value: 16, feather: 3 },
]);
const site = game.terrain.foundation(30, 20, 10, 8);   // an upright base for a 10 × 8 building
const saved = game.terrain.save();                     // JSON-safe, for an editor's save

Works with

  • world-3d — the 3D world it builds into; procgen supplies its noise.
  • rig-fps — give its floor the terrain's heightAt to walk the ground, and its canMove check for slope and step limits.
  • forest-3d and grass-3d — trees and grass planted on its height, with forests masked by its biomes.
  • water-3d — seas and lakes that shoal against its beaches.
  • terrain-world-3d — for landscapes too large to hold in one height array, streamed in tiles.
  • voxels-3d — for caves, overhangs and ground the player digs through.

Good to know

  • A heightfield has no overhangs, caves or arches; compose rock meshes or voxels-3d for those.
  • The whole height grid stays in memory with one mesh per chunk; for bounded paging across a very large world, use terrain-world-3d.
  • Edits are an authoring step, not per-frame sculpting, and history keeps up to 32 batches. Ground that changes in play goes through refresh, which keeps no history.
  • colormapRes is capped at 2048 and goes into the shared atlas with your other art, and there is no splat-mapped material stack beyond the colormap and detail texture.
  • A lake mask does not dig a basin or make water: flatten or carve one, and compose a water pack.

More World packs

Show all →