Geometry · function

buildLightVolume

Build the hull for a volume of light, in the volume's own space, opening along +Z.

Explained in Hello world, Meshes and geometry.

function buildLightVolume(options: LightVolumeOptions): MeshData
import { buildLightVolume } from '@driftengine/core';

Parameters

ParameterTypeDescription
optionsLightVolumeOptions

In depth

A closed cone frustum, wound outward so the renderer can cull whichever half it needs: it draws the front faces from outside and the back faces from inside, which is what lets a camera walk into a beam without the beam vanishing. The caps matter more than they look — without the near one, a viewer looking straight up a vertical shaft finds a hole through the middle of it exactly where the volume should be at its most solid.

Nothing here shapes the light. The hull says which pixels to run on and the pass decides what they are worth, so a coarser hull is a coarser outline and never a coarser beam.