This texture renders a sky with stars. Click on a snapshot to open it online.
import { stars } from "tsl-textures/stars.js";
model.material.colorNode = stars ( {
scale: 2,
density: 2,
variation: 0,
color: new THREE.Color(16774640),
background: new THREE.Color(96),
seed: 0
} );
scale
– level of details of the pattern, higher value generates finer details, [0, 4]density
– density of stars, [0,3]variation
– hue variation, [0,1]color
– color of starsbackground
– color of skyseed
– number for the random generator, each value generates specific patternDarker stars color reduces the amount of visible stars, same like reduction in density. Hue variation is noticeable when the color of stars is not pure neutral (i.e. white or black).