Model loading · interface
DrftPart
Explained in Importing models.
interface DrftPartimport type { DrftPart } from '@driftengine/assets';Properties
| Name | Type | Description |
|---|---|---|
meshreadonly | MeshHandle | |
albedoreadonly | number | Which of the asset's images this surface wears, or -1 for none. |
ormreadonly | number | Which image carries its occlusion, roughness and metallic, or -1 for none. |
normalreadonly | number | Which image carries its surface-space normals, or -1 for none.MoreCarried by the container since |
emissivereadonly | number | Which image carries its emission, or -1 for none.MoreThe fourth and last index |
roughnessScalereadonly | number | glTF's three factors, in the shape SurfaceMaterial takes them.MoreCarried on the part rather than looked up from the material, because a caller building a
|
metallicScalereadonly | number | |
occlusionStrengthreadonly | number | |
opacityreadonly | number | |
reflectivityreadonly | number | |
cutoutreadonly | number | Alpha below which this surface's fragments are discarded, 0 for one that discards nothing.MoreThe pair to |
blendreadonly | boolean | Whether the part blends: its texture's alpha is coverage, so it is drawn translucent whatever its
opacity says. glTF's BLEND with a factor of 1 is the case: a leaf's shape is in its alpha. |
doubleSidedreadonly | boolean | Whether both faces are seen: glTF's doubleSided. Drawn without culling, each face lit as the front. |
glassreadonly | GlassOptions | null | The glass this part is, from its file or from DrftLoaderOptions.surface, or null for a part
that lets no light through. A glass part is also blend, so a caller drawing blended parts
translucent passes this as the draw's glass and every pane arrives as the file or the
override said. One object per merged group, shared by its parts, so it is not rebuilt per draw. |
instancesreadonly | DrftPartInstances | null | The copies this part is drawn as, or null for a part drawn once.MoreA mesh the file places many times ( |
reveal | number | 0 to 1 as this part arrives, for a caller that would rather it faded in than appeared.MoreAdvanced by |