RenderType

View source

A render-entry value containing a material ID, mesh ID, and transform for one renderable item. Add instances to RenderLists passes when a caller needs to retain the data for that item.

Constructor


constructor<T>(materialid: AssetId, meshid: AssetId, transform: T)

View source

Creates a render-entry value for one material/mesh pair.

The argument order is material ID first, mesh ID second, and resolved transform third. Values are assigned directly to the corresponding fields; no asset lookup or transform clone occurs.

Examples

// Create the entry from material and mesh IDs plus a resolved transform.
const item = new RenderType(
  material.handle.id(),
  mesh.handle.id(),
  globalTransform
)
opaquePass.push(item)

// Read the entry's IDs and transform when preparing the draw.
const meshValue = meshes.getByAssetId(item.meshid)
const materialValue = materials.getByAssetId(item.materialid)
draw(meshValue, materialValue, item.transform)

Type Parameters

T

Parameters

NameDescriptionDefault
materialid

Material handle ID.

—
meshid

Mesh handle ID.

—
transform

Resolved global transform.

—

Properties


meshid: AssetId

View source

Mesh asset ID stored in this render entry.

Use this ID to identify the mesh asset for the draw. See Meshed.

materialid: AssetId

View source

Material asset ID stored in this render entry.

Use this ID to identify the material asset for the draw. See MaterialInstance.