octavesFor

function octavesFor
universe/src/bands.ts:93
octavesFor(radius: number, cycles: number, max: number, peak: number, floor: number) → number

How many octaves it takes a band to reach the canonical detail floor.

Two floors, and the tighter one wins. Wavelength: the coarsest feature is about R/cycles meters across and each octave is lacunarity times finer, so log(coarsest/floor) octaves reach 8 m. Amplitude: octaves halve, and a normalized fBm's i-th one carries peak · 2^-i / 2, so it drops under half a meter after log2(peak) of them.

peak is the band's whole contribution in meters — its share of the budget — and passing it is what makes a band that owns a tenth of a small moon's relief stop at four octaves where the arithmetic on wavelength alone would ask for eleven. The gain is assumed to be the default 0.5; a band that sets its own would need this to read it, and none does.

floor is the canonical wavelength floor for every sample the field takes. The drainage lattice passes its own cell size instead: it reads the same bands at a spacing of tens of kilometers, where an octave finer than a cell is noise the flow routing cannot see and would pay for at every node.

radiusnumber
Undocumented
cyclesnumber
Undocumented
maxnumber
Undocumented
peaknumber
Undocumented
floornumber
Undocumented
Returnsnumber