Model loading · function

drawKeyOf

The key two parts must share to be merged into one draw.

Explained in Importing models.

function drawKeyOf(material: DrftMaterial | undefined, override?: DrawSurfaceOverride): string
import { drawKeyOf } from '@driftengine/assets';

Parameters

ParameterTypeDescription
materialDrftMaterial | undefined
override?DrawSurfaceOverride

In depth

Grouped by opacity and reflectivity as well as by image, because two surfaces can share a map and differ in blend: merging on the image alone means one cannot be made translucent without taking the other with it. And by the ORM map and its three scales, for the same reason one step further out — two surfaces sharing a colour map and differing in roughness scale are not one draw, and merging them would silently give one of them the other's material.

A string because it is a Map key and nothing reads it back apart.