DriftTexture · const
ADDRESS_MODE
Where a coordinate lands, and what happens outside the unit square.
Explained in DriftTexture.
const ADDRESS_MODE:import { ADDRESS_MODE } from '@driftengine/texture';In depth
Two conventions, because two kinds of data need them. A lattice puts u = 0 on the centre
of the first texel and u = 1 on the centre of the last, which is what a height field sampled at
its own vertices wants — terrainTexture.ts reads x / (width - 1) and lands on texel x
exactly. A centre mode puts u = 0 on the first texel's edge, which is what every GPU sampler
does and what a surface texture tiled across a mesh wants. Added 2026-09-17 so the device
interpreter has a reference to agree with; modes 0 and 1 did not move.
Lattice wrap has a seam a tiling texture shows: u = 0.999 reads the last texel and u = 1
the first. Centre wrap blends across it, as a repeating sampler does.