This texture generates the surface colors of a planet. There are six types of terrains groups into three clusters: water area, land area and highlang (mountaneous) area. The generated texture is for color maps. Click on a snapshot to open it online.
import { planet } from "tsl-textures/planet.js";
model.material.colorNode = planet ( {
scale: 2,
iterations: 5,
levelSea: 0.3,
levelMountain: 0.7,
balanceWater: 0.3,
balanceSand: 0.2,
balanceSnow: 0.8,
colorDeep: new THREE.Color(4948895),
colorShallow: new THREE.Color(12642550),
colorBeach: new THREE.Color(16776680),
colorGrass: new THREE.Color(8772274),
colorForest: new THREE.Color(30720),
colorSnow: new THREE.Color(16318463),
seed: 0
} );
scale
– level of details of the pattern, higher value generates smaller but more numerous lands, [0, 4]iterations
– number of granulations of terrain, [0, 10]levelSea
– relative altitude for sea level, higer value generates more water [0, 1]levelMountain
– relative altitude for where a mountain starts, higer value generates less mountains [0, 1]seed
– number for the random generator, each value generates specific patternWater parameters:
colorDeep
– color of deep ocean watercolorShallow
– color of shallow coastal waterbalanceWater
– ratio between deep water and shallow water, [0,1]Land parameters:
colorBeach
– color of beach sandcolorGrass
– color of low land grassbalanceSand
– ratio between sand and grass, [0,1]Highland parameters:
colorForest
– color of forest part of highlangscolorSnow
– color of snowy mountains peaksbalanceSnow
– ratio between forest and snow, [0,1]