Renderer · interface

GlobalFieldCascade

One level of the clipmap: a grid the composer fills and sampleGlobalField reads.

Explained in Hello world.

interface GlobalFieldCascade
import type { GlobalFieldCascade } from '@driftengine/core';

Properties

NameTypeDescription
fieldreadonlyFloat32Array
albedoreadonlyFloat32ArrayThe colour of whatever surface won the union at each sample, three floats a sample.
More

A union loses which instance won, and a ray that lands on a wall needs to know what colour it is. demo/dev/bounce.html is what made this necessary: a trace whose radiance came from a rasterised capture could not follow a wall that changed colour, and one that read the probe volume's irradiance returned the same answer for a red wall and a white one — irradiance is light arriving, and what leaves a surface is that times its albedo.

White where no instance reached, rather than black: the colour of a sample no ray can hit is never read, and black would turn a read that did happen into light quietly vanishing instead of a picture that is obviously wrong.

dimsreadonlyreadonly [number, number, number]
boundsreadonlyFloat32ArrayWhere this cascade stands, written by composeGlobalField. Six floats.
stepnumberMetres between samples, the same on all three axes. Written by composeGlobalField.