Terrain · class
TerrainMaterials
Explained in Terrain.
class TerrainMaterialsimport { TerrainMaterials } from '@driftengine/terrain';Constructor
new
constructor(options: TerrainMaterialsOptions)| Parameter | Type | Description |
|---|---|---|
options | TerrainMaterialsOptions |
Properties
| Name | Type | Description |
|---|---|---|
materialsreadonly | readonly TerrainMaterial[] | |
widthreadonly | number | |
depthreadonly | number | |
weightsreadonly | Float32Array | |
shinesreadonly | boolean | Whether any material shines, so a patch built from this uploads a specular buffer only if one
is wanted — the promise MeshData.specular makes and the reason it is optional. |
glowsreadonly | boolean | The same question for emissive, and for the same reason. |
Methods
colorAt
colorAt(u: number, v: number, out: Float32Array): Float32ArrayThe blended colour at a point in the field's 0..1 extent.
| Parameter | Type | Description |
|---|---|---|
u | number | |
v | number | |
out | Float32Array |
emissiveAt
emissiveAt(u: number, v: number): numberThe blended self-illumination, on the same weights the colour used.
| Parameter | Type | Description |
|---|---|---|
u | number | |
v | number |
specularAt
specularAt(u: number, v: number): numberThe blended highlight, likewise.
| Parameter | Type | Description |
|---|---|---|
u | number | |
v | number |