This texture renders a sky with stars. Because this version works on a line-per-line basis, the distribution and shape of stars near the poles are not that good. The generated texture is intended for color maps. Click on a snapshot to open it online.
Code template of parameters with their default values.
import * as PET from "pet/patterns/stars.js";
:
model.material.map = PET.texture( );
PET.material( model.material );
The parameters of the texture generator are:
width
– texture width in pixels, default 1024height
– texture height in pixels, default 512density
– density of stars [0,100], default 20brightness
– brightness of stars [0,100], default 20variation
– hue variation [0,100], default 0color
– color of stars, default 0xFFF5F0 (light blue)background
– color of sky, default 0x000060 (dark blue)Hue variation is noticeable when the color of stars is not pure white.
All texture modules share the same API.
pattern( x, y, z, color, options )
– pattern implementationtexture( {params} )
– generator for a texture with given parametersdefaults
– object with default parametersmaterial( ... )
– material shader patcher