DriftTexture · interface

MaterialTileGrid

One latent's tiles, level by level, by content.

Explained in DriftTexture.

interface MaterialTileGrid
import type { MaterialTileGrid } from '@driftengine/texture';

In depth

Level k is max(1, width >> k) by max(1, height >> k) texels, cut into tiles of tileSize from the top-left, the last row and column short. levels[k][ty * across + tx] is that tile's hash, where across is ceil(levelWidth / tileSize).

Properties

NameTypeDescription
widthreadonlynumberLevel 0's texels across.
heightreadonlynumberLevel 0's texels down.
tileSizereadonlynumberTexels along a tile's edge, the same at every level.
addressModereadonlynumberOne of ADDRESS_MODE, from the graph that samples this latent.
levelsreadonlyreadonly (readonly string[])[]