The .drft container · interface
DrftSource
What a caller hands over to be baked.
Explained in The .drft container.
interface DrftSourceimport type { DrftSource } from '@driftengine/drft';Properties
| Name | Type | Description |
|---|---|---|
headreadonlyoptional | Partial<DrftHead> | |
meshesreadonly | readonly (MeshData | DrftAssembly)[] | The meshes by ordinal. An assembly — painted copies of kit pieces — stands in a slot like any
mesh and is written as one required MSHC chunk; see drftAssembly.ts. |
kitreadonlyoptional | readonly number[] | The ordinals of the meshes that are kit pieces, ascending: drawn only as copies inside the
assemblies, never on their own. One required KITS chunk, ahead of the geometry. A piece
comes before every assembly that copies it, is never an assembly itself, and is neither placed
by INST nor named by a region. |
materialsreadonlyoptional | readonly DrftMaterial[] | One material per mesh, by ordinal, or absent for an asset that names none.MoreAll or nothing: a partial list would make material n mean a different mesh depending on how many came before it, which is the kind of off-by-one that shows up as one wrong surface in a scene and is looked for everywhere except here. |
texturesreadonlyoptional | readonly DrftTextureSource[] | |
substancesreadonlyoptional | readonly DrftSubstanceEntry[] | Which substance each material is made of, or absent for a file that labels none.MoreWritten as one |
fieldsreadonlyoptional | readonly DrftSdfvEntry[] | The signed distance field of each mesh that has one, or absent for a file carrying none.MoreWritten as one |
networksreadonlyoptional | readonly DrftNetwork[] | The networks this file carries, or absent for a file carrying none.MoreWritten as one |
graphsreadonlyoptional | readonly DrftGraph[] | The graphs this file carries — networks built from operators rather than dense layers — or
absent for a file carrying none. Written as one NGRF chunk at 1.15, each found by its role. |
collidersreadonlyoptional | readonly Float32Array[] | The convex hulls this asset collides as, or absent for a file that carries none.MoreEach entry is xyz-packed points in the asset's own space, at most 64 of them, which is what
|
lodsreadonlyoptional | readonly MeshData[] | Coarse whole-asset levels of detail, coarsest first, or absent for a file with none.MoreEach one stands in for the entire model rather than for one part of it, which is the
argument docs/FORMAT.md §4.6 makes: a single decimated body reads as a car, and 187 coarse
fragments read as a mess. They are written first so a sequential fetch has an outline on
screen within the first few kilobytes, and they carry no material entry because they carry
their colour per vertex — |
levelsreadonlyoptional | readonly Uint8Array[] | Discrete levels of detail, finest first, each a complete .drft of its own.MoreDistinct from |
nodesreadonlyoptional | readonly DrftNode[] | The asset's own hierarchy, or absent for one mesh at the origin.MoreWhat |
instancesreadonlyoptional | readonly DrftInstanceGroup[] | Meshes drawn many times: one INST chunk, written ahead of the geometry and required. The mesh
a group names holds one copy; see drftInstances.ts. |
regionsreadonlyoptional | readonly DrftRegion[] | The regions of a streamed world: one required REGN chunk each, written just ahead of the
meshes it introduces. The meshes no region names come first, then each region's new meshes in
region order — the writer refuses any other order rather than renumbering what the regions and
the materials point at. See drftRegions.ts. |
lightVolumereadonlyoptional | DrftLightVolume | A world's fixed lights summed offline into one dense volume: one optional LVOL chunk, after
the geometry, since the world draws lit by its exact lights until it lands. See
drftLightVolume.ts. |
lightsreadonlyoptional | readonly DrftLight[] | The lights the scene was authored with: one LITE chunk, optional. See drftLights.ts. |
quantisereadonlyoptional | boolean | Write each mesh as MSHQ rather than MESH: constants, 16-bit ranges and octahedral
directions, about a third of the bytes, within the bounds drftQuantised.ts states. Off unless
asked, so a caller writing a file gets the bytes it always got; the baker asks by default. |
skinsreadonlyoptional | readonly DrftSkin[] | Skins, one SKIN chunk each, or absent for an asset that deforms nothing. |
clipsreadonlyoptional | readonly AnimationClip[] | Clips, one ANIM chunk each, or absent for an asset that animates nothing. |
splatsreadonlyoptional | DrftSplats | A Gaussian splat capture, or absent for a file carrying none.MoreWritten as several |
dtexreadonlyoptional | readonly DtexEntry[] | A decode program per material, or absent for a file whose materials are ordinary.MoreOne |
navigationreadonlyoptional | NavPolyMesh | A way across the scene, or absent for a file nobody navigates.MoreThe mesh carries the origin and cell size it was built at, because the numbers in it are cell indices and a reader without those has a mesh in the wrong units at the wrong place. |
entitiesreadonlyoptional | EntsScene | The things in the scene, as serializeWorld wrote them.MoreA scene, not an asset: this is what a capture proposes or an editor saves, and a file may carry geometry with no scene at all — which is every baked model this format has ever held. |
texturesFirstreadonlyoptional | boolean | The textures ahead of the geometry rather than after it. A model wants its outline before its pictures, so a viewer sees a shape early; a world whose every region wears the same texture arrays wants the pictures before its first region, or that region waits for the file's end. What it costs a model that asks: its first part arrives later by the size of its pictures. |