Skip to content

AssetRenderRequest

AssetRenderRequest = { dimension: "3d"; opacity?: number; tint?: AssetTint; transform?: AssetTransform; type: "gltf"; url: string; } | { cell: CellRect; dimension: "2d"; hex: HexDims; opacity?: number; shape?: "quad" | "hex"; sheetUrl: string; tint?: AssetTint; transform?: AssetTransform; type: "tileset-cell"; }

Defined in: packages/declarative-hex-worlds/src/asset-source/source.ts:96

A resolved, renderer-agnostic render request. A renderer BINDING (the declarative-hex-worlds/three subpath today, /pixi tomorrow) subscribes to the koota placement signals and dispatches on type + dimension to reconcile its own scene nodes. New source kinds add new members here (a discriminated union), and each binding grows a matching arm. Every request carries its dimension so a binding can place/sort/orient a 2D sprite and a 3D model correctly on the same board.

{ dimension: "3d"; opacity?: number; tint?: AssetTint; transform?: AssetTransform; type: "gltf"; url: string; }

dimension: "3d"

optional opacity?: number

Optional per-placement opacity in [0, 1]. < 1 makes the placement translucent (e.g. a fog shroud over an explored tile); omitted or >= 1 leaves it fully opaque.

optional tint?: AssetTint

Optional per-placement multiplicative tint (fog/season/team shading). White ⇒ identity. Applied by the binding to the resolved object’s material colour.

optional transform?: AssetTransform

type: "gltf"

url: string


{ cell: CellRect; dimension: "2d"; hex: HexDims; opacity?: number; shape?: "quad" | "hex"; sheetUrl: string; tint?: AssetTint; transform?: AssetTransform; type: "tileset-cell"; }

cell: CellRect

dimension: "2d"

hex: HexDims

optional opacity?: number

Optional per-placement opacity in [0, 1]. < 1 makes the cell translucent (e.g. a fog shroud over an explored tile); omitted or >= 1 leaves the opaque-queue path (seamless cutout tessellation) unchanged.

optional shape?: "quad" | "hex"

How the sheet cell is drawn onto the board plane:

  • 'quad' (default): the FULL cell rect is drawn as a rectangle spanning hex.width × hex.height. Painterly hex atlases (e.g. JackleEarth) paint each cell as a flattened hex with TRANSPARENT corners — a full quad lets neighbouring cells’ opaque bodies fill each other’s transparent corners, so the board tessellates SEAMLESSLY into continuous terrain. This is what the canvas-2D binding already does (drawImage blits the whole cell), so 'quad' makes the 3D binding match.
  • 'hex': the cell is clipped to a hexagon silhouette (UV-mapped to the cell). Use only for sheets whose cells are opaque edge-to-edge and must NOT bleed past the hex outline. Leaves gaps for transparent-corner art. Omitted ⇒ 'quad'.

sheetUrl: string

optional tint?: AssetTint

Optional per-placement multiplicative tint (fog/season/team shading). White ⇒ identity. Multiplies the sampled cell colour, so one atlas serves every shading state without re-authoring art.

optional transform?: AssetTransform

type: "tileset-cell"