Model loading · function
resolveDrawGrouping
Resolve what a part will actually be drawn with.
Explained in Importing models.
function resolveDrawGrouping(material: DrftMaterial | undefined, override?: DrawSurfaceOverride): DrawGroupingimport { resolveDrawGrouping } from '@driftengine/assets';Parameters
| Parameter | Type | Description |
|---|---|---|
material | DrftMaterial | undefined | |
override? | DrawSurfaceOverride |
In depth
The defaults are the loader's and are not arbitrary. A missing texture index is -1 rather
than 0, because 0 is a real image. Opacity and the two scales default to 1 and the rest to
0, which is the identity that lets a file saying nothing about a property draw the same as one
that did not have the property to say.
The override wins over the material for the fields it may carry, because a consumer dressing a surface by name knows more than a default an exporter wrote. A cutout is not among them: it is a fact about the image a material wears, so nothing outside the file has anything to say about it.