Model loading · class
PartDraws
Parts drawn, cast and prepared by every rule a container needs; DrftLoader.draw is one.
Explained in Importing models.
class PartDrawsimport { PartDraws } from '@driftengine/assets';Constructor
new
constructor(renderer: RendererApi)| Parameter | Type | Description |
|---|---|---|
renderer | RendererApi |
Methods
draw
draw(parts: readonly DrftPart[], textures: TextureSet<SurfaceTextureHandle> | null): numberDraw every part into the open mesh pass. Returns the draws issued.
| Parameter | Type | Description |
|---|---|---|
parts | readonly DrftPart[] | |
textures | TextureSet<SurfaceTextureHandle> | null |
cast
cast(sink: ShadowCasterSink, parts: readonly DrftPart[], textures: TextureSet<SurfaceTextureHandle> | null): voidOffer every part that stands in the light to a shadow pass, or to a mirror's replay.
| Parameter | Type | Description |
|---|---|---|
sink | ShadowCasterSink | |
parts | readonly DrftPart[] | |
textures | TextureSet<SurfaceTextureHandle> | null |
prepare
prepare(parts: readonly DrftPart[], textures: TextureSet<SurfaceTextureHandle> | null): Promise<void>Compile, off the frame, what every part's draw will take, then wait for it: each in its own
material, translucent as well where it will be drawn so, through its batch where it has copies.
What it cannot reach is the shadow passes' and a probe's own pipelines, which one frame drawn
behind a loading screen compiles; see RendererApi.prepareMesh.
| Parameter | Type | Description |
|---|---|---|
parts | readonly DrftPart[] | |
textures | TextureSet<SurfaceTextureHandle> | null |