Terrain maps#
From noise to a full set of terrain maps, entirely in COP: no AI and no mesh. It shapes and erodes a massif at 512 x 512 (the erosion solvers are tuned per pixel), upsamples it to 1024 x 1024 with a fine relief on top, then finds rivers and lakes, splits it into five material layers, shades it, and saves height, normal, splat, albedo, a lit image and a contour map.
Load it#
Drag example_workflows/pcg_cop_terrain_maps.json onto the ComfyUI canvas and press Queue. Only comfyui_pcg nodes plus ComfyUI's Save Image are used. Images are saved as pcg/terrain_lit, pcg/terrain_topo, pcg/terrain_albedo, pcg/terrain_height, pcg/terrain_normal and pcg/terrain_splat.
Step by step#
1. Shape
- COP Noise (PCG) (simplex,
hybrid_terrainfractal, frequency 2.5, 7 octaves, amplitude 0.08) is the base relief; a COP Wrangle (PCG) raises the middle into a massif (@Cplus a radial falloff). - COP HeightField Stream Power Erosion (PCG) cuts branching river valleys; COP Strata (PCG) adds rock-layer terraces; COP HeightField Thermal Erosion (PCG) collapses steep slopes into talus (the
debrislayer). - COP HeightField Hydraulic Erosion (PCG) carves gullies and adds the alluvium to
debris. This is the slowest step: about ten-odd seconds on numpy, and it uses the GPU automatically when CUDA is available.
2. Water
- COP Flow Accumulation (PCG) computes the catchment area and derives the river network (
river) and filled depressions (lake).
3. Materials
- COP HeightField Splat Map (PCG) splits the terrain into grass / sediment / rock / snow / water; the five layers sum to 1 everywhere. It also writes
splat_rgba, a packed weight map for an engine's terrain layers.
4. Shading
- COP Height to Normal (PCG) and COP Height to AO (PCG) add
Nandao. - A COP Wrangle (PCG) mixes a colour per material layer into
albedo: rock is banded by height (like sedimentary layers), wet grass is darker, and AO darkens the result. - COP Light (PCG) shades it with shadows into
lit; COP Visualize (PCG) (height_ramp,terrainramp, contour interval 0.005, hillshade) draws a contour map intovis. - The right-hand columns are COP Export (PCG) + Save Image pairs: the lit image, the contour map, albedo, height (
normalize), normal (signed) and the splat map.
Worth tweaking#
| Node | Parameter | Effect |
|---|---|---|
| COP Noise | rand_seed, frequency, octaves | A different landscape. |
| Massif Wrangle | code | Size and height of the central rise. |
| Stream Power | iterations, erodibility | Depth of the valleys. |
| Strata | spacing, strength | Terrace spacing and how pronounced the steps are. |
| Splat Map | rock_angle, snow_line | Where rock and snow appear. |
| Colour Wrangle | code | The palette of each material. |
See also#
- Terrain to AI texture: the same kind of terrain feeding a diffusion model.
- World tiles: a 2 km terrain delivered as engine tiles.
- Images (COP).
- Example index.