Skip to content

Writing a node ​

Nodes are plain Rust: one struct, one schema, one evaluate function, registered in terrain_nodes::registry(). The inspector and graph editor are generated from the schema, so no Godot code is needed. crates/terrain-nodes/src/basic.rs has small examples.

The schema ​

A node's schema declares its stable type_id (for example terrain.mountain, stored in project files, so never rename it), its label, category and description, its input and output ports, and its settings.

Each setting (ParamDef) has a key, a label, a default, a range and a description. The description is what users see when they hover the setting in the app, and it's also what this website's node reference shows. Write it for users.

Rules every node follows ​

  • All sizes are metres. Never think in pixels. The same settings must give the same landscape at any resolution.
  • All randomness comes from ctx.seed, so a node looks the same on every machine and thread count.
  • Nodes are frozen from 2026.1. A change to an existing node's output needs a higher type_version and a NodeKind::migrate, so old projects keep opening unchanged.
  • Heavy maths belongs in terrain-sim or terrain-field as a plain function of grids and a settings struct; the node reads its settings, calls it and returns the grids.

The test suite checks every node for determinism, resolution independence and unchanged golden output.

Updating the website ​

The node reference on this site is generated from the schemas. After adding or changing a node, a website maintainer runs scripts/sync-from-app.sh /path/to/LibreTerrain in the website repository to refresh it.

Code dual-licensed MIT / Apache-2.0. "LibreTerrain" and its logo belong to EllisonDigital.