Builtin Library
- ..
- .metadata254 B
- README.md2.6 KB
- mat.yaml1.7 KB
- preview.png30.0 KB
README.md
terrainStandard (material)
Built-in default material for the terrain system. Uses the
~terrainSystem.shaders.terrainBlend shader, which renders a four-layer
surface blended by altitude and slope, with a procedurally-detailed
cliff override for steep faces.
Layers
| Slot | Source field | Default | Role |
|---|---|---|---|
| 0 (valley) | colors.base_color | green | Low ground, grass, valley floor. |
| 1 (mid) | colors.layer1_color | tan | Mid-band: dry grass / scrub between grass and rock. |
| 2 (high) | colors.attenuation_color | grey | High band: rock, exposed cliff face. |
| 3 (peak) | reflectance (engine default ≈ white) | white | Peaks: snow, ice. |
Tunables (re-purposed StandardMaterial slots)
| Material field | Shader role |
|---|---|
parallax_depth_scale | layer1_height — Y where layer 1 mid-band peaks. |
max_parallax_layer_count | layer2_height — Y where layer 2 rock takes over. |
lightmap_exposure | layer3_height — Y where layer 3 snow takes over. |
normal_scale | blend_width — width of each altitude transition. |
clearcoat | slope_start — cos-θ where cliff blend begins. |
clearcoat_roughness | slope_end — cos-θ where cliff fully overrides. |
anisotropy_strength | detail_scale — boundary-breakup noise frequency. |
anisotropy_rotation | (detail_amp, macro_scale) — boundary amp + macro tiling. |
Authors who want different colours / heights just override the
respective floats. / colors. blocks in their own material.
Customizing per terrain
Material.Create("alpine_meadow", "~terrainSystem.shaders.terrainBlend", {
base_color = { 0.18, 0.45, 0.22, 1 }, -- meadow green
emissive = { 0.35, 0.42, 0.30, 1 }, -- scrub
attenuation_color = { 0.55, 0.55, 0.55, 1 }, -- granite
parallax_depth_scale = 12, -- layer1 (scrub) peak
max_parallax_layer_count = 24,-- layer2 (rock) onset
lightmap_exposure = 38, -- snow onset
clearcoat = 0.7, clearcoat_roughness = 0.3,
})
Caveats
- This iteration paints solid colours per layer. Texture sampling
per layer is a planned extension — swap the
mix(albedo, layerN_color, wN)in the shader for a tiledtextureSample(layerN_texture, ...)and add the texture slots to the material schema. Tracking issue: filed alongside the terrain system PR. - Author-controlled splatmap (an RGBA texture that paints which layer is at each pixel) is similarly planned. The current altitude/slope blend is procedurally driven only.