Terrain · interface

TerrainMaterialsOptions

Explained in Terrain.

interface TerrainMaterialsOptions
import type { TerrainMaterialsOptions } from '@driftengine/terrain';

Properties

NameTypeDescription
materialsreadonlyreadonly TerrainMaterial[]The materials being blended. At least one.
widthreadonlynumberSamples of the weight map across x. It need not match the heightfield's own resolution.
depthreadonlynumberSamples across z.
weightsreadonlyArrayLike<number>width * depth * materials.length weights, row-major with the material running fastest.
More

They need not sum to anything: terrainMaterialWeights normalises what it reads, because a map is painted or generated and nothing balances its channels.