Log inGet started
Package

terrainSystem.package

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

terrainStandard (material)

The default material for the terrain system. It is the ~terrainSystem.shaders.terrainSplat shader with ground_fill at 1 and no layer bound, so the whole ground is the share no layer claims and is painted by altitude and slope: four colour bands climbing with height, a cliff over steep faces, noise breaking each band's edge and a slow macro variation (zero_terrain_ground_bands). A landscape that states its vertical reach (a .terrainData does) has the bands begin at fractions of it (ground_altitudes, 0.18, 0.5 and 0.78 of the relief), so the same ground reads alike on a hill and on a massif; the peak's snow is drawn only where the ground lies down. It carries the shader's geomorph hook and shades with the landscape's own normal per pixel.

Bands

SlotPropertyDefaultRole
0 (valley)layer0_colorgreenLow ground, grass, valley floor.
1 (mid)layer1_colortanMid-band: dry grass / scrub between grass and rock.
2 (high)layer2_colorgreyHigh band: rock, exposed cliff face.
3 (peak)layer3_colorwhitePeaks: snow, ice.
cliffcliff_colordark brownSteep faces, whatever the altitude.

Tunables

PropertyRole
ground_altitudesFractions of the landscape's relief where the mid, high and peak bands take over.
layer1_height, layer2_height, layer3_heightWorld Y where the bands take over, for a landscape that states no relief.
blend_widthWidth of each altitude transition, for a landscape that states no relief.
slope_start, slope_endCosine of the surface normal's Y where the cliff blend begins and where it fully overrides.
detail_scale, detail_ampFrequency and strength of the noise breaking each band's edge.
macro_scaleFrequency of the macro variation.
smoothness, metallicSurface response.

Authors who want different colours or heights override the respective floats. / colors. blocks in their own material on terrainSplat.

Customizing per terrain

asset.create("material", "alpine_meadow", {
    shader = "@builtin::systems.terrainSystem.shaders.terrainSplat",
    properties = {
        ground_fill = 1,
        layer0_color = { 0.18, 0.45, 0.22, 1 },   -- meadow green
        layer1_color = { 0.35, 0.42, 0.30, 1 },   -- scrub
        layer2_color = { 0.55, 0.55, 0.55, 1 },   -- granite
        layer1_height = 12, layer2_height = 24, layer3_height = 38,
    },
})