Skip to content

PatternNoise beta ​

Interface of @v12-engine/client/ground

ts
export interface PatternNoise

Noise to write a pattern with (PatternDef.shade): it repeats across the picture, so the texture has no seam; it is seeded from the pattern's seed, so two tiles of one pattern look apart (salt tells two noises of one pattern apart); and it is as fine or coarse as the recipe says (GroundRecipe.fineness)

Members ​

layered ​

ts
layered(periods: readonly number[], salt?: number): (u: number, v: number) => number;

Several noises, each finer and fainter than the one before: what looks like ground and not like a pattern. 0..1

random ​

ts
random(index: number, salt?: number): number;

A number of its own for each whole number (index): the same for the same seed, 0..1. A plank's shade, a stone's

ridged ​

ts
ridged(periods: readonly number[], salt?: number): (u: number, v: number) => number;

Several noises as layered, each folded about its middle: sharp ridges where it was half way, the lines of cracks and veins. 0..1, 1 on a ridge

seed ​

ts
readonly seed: number;

The seed the texture is made with

tiling ​

ts
tiling(period: number, salt?: number): (u: number, v: number) => number;

A value noise that repeats every period cells of the picture: between 0 and 1, smooth

worley ​

ts
worley(period: number, salt?: number): (u: number, v: number) => WorleyPoint;

Cells about points scattered over the picture, period of them across (Worley noise), repeating: stones, plates, scales. Gives, for a point, how far it is from its cell's middle (near, 0 there), how far from the border with the next cell (edge, 0 on it: the seams) and a number of its cell (cell, 0..1, the same over the whole cell). The same object each call: read it before the next