DriftTexture · function

latentTileGrid

Cut a latent and its chain into content-addressed tiles.

Explained in DriftTexture.

function latentTileGrid(image: LatentImage, tileSize: number, addressMode: number): MaterialTileGrid
import { latentTileGrid } from '@driftengine/texture';

Parameters

ParameterTypeDescription
imageLatentImage
tileSizenumber
addressModenumber

In depth

Hashed as every tile in this package is, by hashTile over the texels' own bytes row by row, so a tile shared by two materials — or by a material and an overlay — is one address and one fetch. Refuses a chain whose levels do not halve, because the grid could not then say which texels a tile holds.