flutter3d_core library

The engine's rendering core, with no Flutter SDK behind it.

mcp-03n's own split. flutter3d named Flutter in five files out of eighty-nine, all in engine/assets/, for one of three reasons: rootBundle to read the asset bundle, kIsWeb to skip a background isolate the web does not have, and dart:ui to decode a PNG or JPEG. The other eighty-four already resolved without it and simply lived in a package that declared the SDK anyway — a modeller's document layer, the tool an agent starts with dart run, and a service checking an uploaded asset all want a Renderer that draws a frame with none of that behind it.

Two libraries sit beside this one, and this one exports both. package:flutter3d_core/geometry.dart is the mesh vocabulary — MeshData, VertexLayout, shapes, tangents, morph targets, Ray — and package:flutter3d_core/formats.dart is what a model arrives in and leaves in — ModelDocument, the glTF/OBJ/STL/.f3d/USDZ readers and writers, the FBX refusal, the image and KTX2 codecs. They were two packages of their own once, for callers that wanted a mesh or a .glb with no renderer; a plain Dart package costs such a caller nothing it does not import, so a caller that wants only one of them imports only that library.

flutter3d re-exports this package whole and stays the thin shell three things could not leave: BundleAssetSource (names rootBundle), assetUriResolver (the same), and defaultImageDecoder (names dart:ui) — plus ModelAsset and bindMaterial/loadMaterial, which default to that decoder and stayed beside it so every existing caller of either keeps compiling unchanged. A dart run caller with no Flutter SDK reaches the same uploadEncodedImage this package exports directly, handing it a decoder of its own.

Classes

AbsolutePixels
A fixed size, for anything whose extent is its own business — a shadow atlas is the same size whatever the window is doing.
AdaptiveQuality
Chooses a QualityRow of table each frame.
AdaptiveQualitySettings
What the controller aims at, and how cautiously.
AdaptiveScale
The scale to draw the next frame at, decided from the ones before it.
AdaptiveScaleSettings
How far the resolution may be pulled, and how fast.
AmbientOcclusionMethod
How the occlusion pass finds what hides a point — L5.
AmbientOcclusionSettings
Screen-space ambient occlusion.
AnimationClip
A named set of tracks that play together.
AnimationLayer
A clip played over part of a skeleton, on top of whatever the base is doing.
AnimationMask
The joints one animation layer writes, by node index.
AnimationPlayer
Plays AnimationClips onto animation targets.
AnimationPointer
One resolved pointer: property of the indexth object of its kind.
AnimationPointerSink
Where a pointer track's sampled value goes.
AnimationTarget
What a player can drive.
AnimationTrack
One animated property of one node.
AntiAliasSettings
Edges smoothed on the finished picture — gfx-04n's own row.
AssetRequest
What a resolver is being asked for.
AssetSource
Where a model and its sibling files live.
AutoExposureSettings
How the frame's own brightness decides its exposure.
BackendRegistration
What registerBackendOpener hands back, so a registration can be taken off again.
BakedPoses
A clip's worth of joint matrices, ready to become a texture.
BlendState
How a draw is combined with what the attachment already holds.
BloomSettings
How much of the frame's light spills into a glow.
BufferLayout
One buffer's worth of attributes, and how far apart its elements are.
CameraNode
A camera placed in the scene graph.
CapsuleShape
Capsule: a cylinder of height closed by two hemispheres of radius.
CapturedImage
One resource as one pass left it.
CapturedPass
One pass of a captured frame.
CheckedModelWriter
A writer whose files this package can also read, so a write can be checked by reading it back — what exportChecked does.
CheckerboardTexture
Two-tone checkerboard.
ClusterDraws
The index buffers the scene pass draws split meshes through, one per mesh node and view, repacked only when the clusters that view sees change — C9.
ColorHint
A colour of channels components — three for a tint, four when the fourth is opacity.
ColorTarget
One colour attachment of a pass.
CommandEncoder
A pass somebody opened, and must therefore close.
CompiledFrameGraph
The result: the nodes to run, in order, what was dropped, and how long each resource has to stay alive.
ComputeEncoder
Records one compute pass: bindings, then dispatches, then submit.
ComputePipelineHandle
A compiled compute stage, ready to dispatch.
ConeShape
Cone with the apex at +Y: a cylinder whose top radius is zero.
ContactShadowSettings
Contact shadows: a short march toward the light, in screen space — gfx-76n.
ContributorFrame
Everything something drawing into someone else's pass is given.
ContributorLights
The scene's lights, bound to a contributor's own stage — N6.
ContributorRegistry
The contributors a renderer draws, and the order it draws them in.
CpuMesh
A mesh that lives only on the CPU.
CuboidShape
Axis-aligned box centred on the origin.
CylinderShape
Cylinder or truncated cone, centred on the origin, axis along Y.
DebugColors
Colours used by the built-in overlays, so a screenshot is readable without a legend.
DebugDraw
Accumulates debug line segments into one reusable interleaved buffer.
DebugDrawOptions
Which debug overlays to build for a frame.
DecodedImage
A PNG decoded down to plain RGBA8 — top row first, four bytes a pixel, width * height * 4 bytes long.
DepthOfFieldSettings
Depth of field, from a lens rather than from a ramp — gfx-34n.
DepthTarget
The depth and stencil attachment of a pass.
DerivedShape
A shape defined by delegating to another one.
DeviceClass
A kind of device a build writes its own assets for.
DeviceClassMemory
Where the chosen class is kept between launches.
DeviceClassPicker
The class this device reads its assets as: picked once, remembered, and overridable by the player.
DeviceClassSelector
Which class a device is, from its DeviceTraits and one measurement.
DeviceMesh
A MeshData that has been uploaded to a device.
DeviceTraits
What a device says about itself that bears on its class.
DiscShape
Flat annulus in the XZ plane facing +Y. An innerRadius of 0 gives a disc.
DisplayTransform
A display transform read in place of the tone curve — L2.
DocumentAsset
What the source file said about itself, as opposed to what it contains.
DocumentDifference
One thing a round trip did not preserve.
DracoAttribute
One decoded attribute.
DracoAttributeType
Draco's GeometryAttribute::Type.
DracoMesh
What a decoded primitive carries.
DrawableGeometry
A mesh that has reached the device and can therefore be drawn.
DrawItem
One entry in a render list.
EffectiveAntiAliasing
What smoothed the edges of a frame, as opposed to what was asked for — gfx-20n.
EncodedImage
An image still in its source encoding (PNG, JPEG, …).
EnumHint
One of values, and nothing else.
EnumHintValue
One choice in an EnumHint: what is written into the file, and what a person reads in the list.
EnvironmentMap
Builds the cube a surface reflects: one environment, convolved by roughness.
ExportReport
One write, read back and checked against what went in.
ExposureAdapter
The exposure as it stands, and where it is going.
ExposureMeter
The other end of luminance.frag's encoding, and the arithmetic that turns a texture of stops into one exposure.
F3dAttributeFlags
Bit positions inside a surfaceAttributes record — one per name VertexLayout's own attributes use.
F3dDecoder
.f3d through the same ModelDecoder boundary an application's own formats come through, so every built-in reader is one: see builtInModelDecoder.
F3dDocument
A .f3d file, read as a ModelDocument.
F3dModelWriter
.f3d, the engine's own container.
F3dMorphFlags
Which optional streams a morph target record carries.
F3dRecord
Fixed record sizes, in bytes. All multiples of four.
F3dSamplingFlags
Bit positions inside a texture binding's samplingFlags.
F3dSection
Section kinds.
F3dWriter
Serializes any ModelDocument into the .f3d container.
FabrikIk
FABRIK — Forward And Backward Reaching Inverse Kinematics — for a chain of any length, anim-14's other row.
FbxDecoder
A ModelDecoder for Autodesk's FBX — the skeleton this package's own pubspec.yaml describes: recognises the format, and says plainly that reading one is not built here yet.
FieldPass
Two targets, a current one, and the kernels that step between them.
FileAssetSource
A model on the filesystem. Unavailable on web, which is why it is a separate source rather than a flag.
FogSettings
Distance fog.
FrameCapture
A whole frame, pass by pass.
FrameCaptureBuilder
Collects a capture while a frame runs.
FrameFraction
A fraction of the frame: full size at one, half at two.
FrameGraph
Collects nodes, then works out the frame.
FrameGraphNode
A pass, and the only thing an extension has to implement to become one.
FrameHistory
FramePassState
Counters and bound state shared across everything encoded into one pass.
FrameResourceIds
Everything the frame produces or hands around.
FrameResources
The textures a frame's nodes read and write, acquired late and released early.
FrameResult
One rendered frame.
FrameTextureSource
Where a frame's textures come from, and where they go back to.
FrameWorkBudget
How many microseconds a frame may spend on work that can be spread over frames. Irradiance probe updates and point-shadow faces ask it today; anything else a frame can put off is meant to ask it the same way.
FreeLook
Looking around from where the camera stands, and walking it there.
FullscreenDraw
One full-screen pass, described rather than assembled.
FullscreenEffect
One full-screen shader over the picture, as a graph node.
GeometryBuffer
A range of device memory holding vertices or indices.
GlbContainer
A parsed glTF container: the JSON document plus the optional binary chunk.
GlbModelWriter
A self-contained glTF binary.
GltfAccessorReader
Reads accessors out of the resolved glTF buffers.
GltfAsset
The decoded result of a glTF or GLB file.
GltfLoader
Decodes glTF 2.0 and GLB into engine geometry.
GltfWriter
Serializes any ModelDocument into glTF's binary container.
GpuFrameTimings
Every labelled pass of one frame, in the order they were submitted.
GpuPassTiming
One labelled pass and how long the GPU spent in it.
GraphicsDevice
Everything the engine needs a graphics backend for.
HitResult
What a ray hit.
HiZOcclusion
OcclusionMode.hiZ: last frame's depths, read back from the GPU and reprojected into this frame's view — C3.
ImmediateTextureSource
A source that returns textures to the pool at once.
ImpostorNode
An impostor, drawn — the coarsest level a LodGroup can end in.
InMemoryDeviceClassMemory
A DeviceClassMemory that lasts as long as the process — the default, and what a test uses.
InputAttribute
One input of a vertex stage, and where in its buffer it starts.
InstancedMeshNode
One mesh drawn many times in one call, each copy with a transform and a colour of its own.
IrradianceField
A grid of probes over a box.
JitteredProjection
base moved a fraction of a pixel across the screen — R1.
Ktx2ColorModel
The data format descriptor's colorModel, for the values that matter when vkFormat is undefined — gfx-78n.
Ktx2GlobalDataField
The Basis Universal "supercompression global data" a supercompressionScheme == basisLZ file carries: the endpoint and selector codebooks, the per-block bitstream's Huffman tables, and one ImageDesc per image telling where in the level's own bytes the RGB (and optionally alpha) slice lives.
Ktx2HeaderField
Byte offsets of the header fields, relative to kKtx2HeaderOffset.
Ktx2ImageDescField
Ktx2IndexField
Byte offsets of the Index section's fields, relative to kKtx2IndexOffset — the pointers to the data format descriptor, the key/value data, and (for a Basis Universal file) the supercompression global data this stage now reads.
Ktx2SupercompressionScheme
supercompressionScheme values this format defines.
Ktx2Texture
A KTX2 file, read down to what a texture upload needs: dimensions, an engine TextureFormat, and each mip level's bytes.
LatheShape
A surface of revolution: a profile polyline swept around the Y axis.
LayeredShaderLibrary
Two libraries consulted in order, the first winning.
LightBuffer
The scene's active lights, packed the way the fragment shaders read them.
LightChannels
The bit masks LightNode.channels and SceneNode.lightChannels meet on.
LightingModel
A lighting model: one pre-built fragment shader and what the engine may bind to it.
LightNode
A light placed in the scene graph.
LightShaftSettings
LoadedShaderLibrary
A library a device built from bytes it was handed, and can rebuild.
LocalExposureSettings
Local exposure by exposure fusion — R7.
LodGroup
Picks one of several meshes by how much of the screen the object covers.
LodLevel
One level of detail: a mesh, the screen size below which it takes over, and — when somebody measured it — how far it is from the full mesh.
LookSettings
The look put on the frame after it has been tone mapped.
Material
Surface appearance as plain data.
MaterialBinary
+ - * /, with GLSL's broadcasting: a float beside a vector spreads.
MaterialBindings
What describeMaterial found, in the shape LightingModel takes.
MaterialBuiltin
A function the language knows, its type rule and how to compute it.
MaterialCall
A call to one of MaterialBuiltin.all.
MaterialConstant
A literal, and the one place a vec3(1.0, 0.0, 0.0) that is entirely constant ends up: the parser folds a constructor whose arguments are all literals, because a parameter is a constant too and folding is what makes a variant's value reach the shader as a number.
MaterialConstruct
vec3(...), vec4(...) and the rest, with arguments that are not all constant.
MaterialDocument
A material as a file of its own, rather than as part of a model.
MaterialExpression
An expression, typed by the parser rather than by whoever reads it later.
MaterialExtensions
What a surface has beyond metal-rough: the KHR_materials_* layers glTF adds on top of the core model — M1.
MaterialHint
A kind with the words that go around it.
MaterialHintKind
What a control for one value should look like.
MaterialInput
One value the fragment body can read.
MaterialInputRef
One of kMaterialInputs.
MaterialLet
let name = expr; — single assignment, so nothing here is a variable.
MaterialLocalRef
A let bound earlier in the body.
MaterialNegate
Unary minus. The only unary operator, because ! needs a bool type the language has not got.
MaterialParameter
One declared parameter: a name, a type and the value a variant that says nothing about it gets.
MaterialParamRef
A declared parameter, before a variant has said what it is.
MaterialProgram
A material read from source: its name, what it declares, and its body.
MaterialReturn
return expr; — a vec4, rgb being the light the surface emits and a its opacity, which is what WriteSurface takes.
MaterialSample
sample(slot, uv).
MaterialSortIds
Assigns small dense integers to materials for use as a sort key.
MaterialStatement
MaterialSurfaceValues
What a fragment of the surface being shaded is, for evaluateMaterial.
MaterialSwizzle
.x, .rgb, .xy — component indices into the target.
MaterialTextureSlot
One texture slot the material samples, by the name the engine binds it under.
MaterialType
A type in the material language.
MaterialVariant
One compiled entry point: a program with its parameters pinned.
MeshBuilder
Accumulates vertices and indices into growing typed arrays.
MeshClusters
A mesh's index buffer read as consecutive runs of triangles, each with a box and a cone of normals — C9, for the scan or the CAD part too big to draw whole every frame.
MeshData
CPU-side geometry: interleaved vertices plus indices.
MeshGeometry
What the scene needs to know about a mesh, without knowing where it lives.
MeshNode
A node that draws a mesh.
MeshOverlay
What a modeller draws on top of the surface: edges, vertices, the selection.
MipChain
Builds the levels below the base, from half size down to one by one.
ModelCamera
A camera decoded from glTF's own cameras, or held for a writer to encode into it — fmt-28's own row, the other half beside ModelLight.
ModelCameraProjection
How a decoded camera projects — glTF's own two, perspective and orthographic, and no others: the core specification defines exactly these two camera.type values.
ModelDecoder
A decoder for a format the engine does not ship.
ModelDocument
A decoded model, whatever format it came from.
ModelImpostor
A node baked into two octahedral atlases — C4.
ModelLight
A punctual light, decoded from KHR_lights_punctual or held for a writer to encode into it — fmt-28's own row.
ModelLoadRequest
Everything a decode needs, in one sendable object.
ModelLod
One level of detail a node offers in place of its own full surface list — pro-eng-06's own row.
ModelNode
A node in a decoded model's hierarchy.
ModelOrthographicCamera
camera.orthographic — a view volume's own half-extents, both planes required.
ModelPart
One drawable piece of a model: geometry, appearance, and where it sits relative to the model's own origin.
ModelPerspectiveCamera
camera.perspective — a field of view and a near plane, an aspect ratio and a far plane that both may be absent.
ModelSkin
A skeleton: which nodes are joints, and how each undoes the bind pose.
ModelSplat
A cloud of Gaussian splats a node of a decoded model carries — C1.
ModelSurface
One drawable piece of a decoded model.
ModelWrite
What one write produced.
ModelWriter
A format a ModelDocument can be written as.
ModelWriteRequest
What to encode, and as which format — fmt-13's own row, the write-side mirror of ModelLoadRequest.
MorphBlend
Blends a mesh's morph targets into a copy of its vertices.
MorphSink
A mesh whose morph weights an animation can drive.
MorphState
What one drawn mesh is morphing towards, and by how much.
MorphTarget
One shape a mesh can be blended towards, as deltas from its base vertices.
MorphTexture
A mesh's morph deltas, packed the way lib/morph.glsl reads them.
MotionBlurSettings
R6's motion blur: what moved during the exposure, smeared along the way it moved.
MtlMaterial
A material exactly as written in a .mtl file.
NodeFrame
Everything a node is given to build its pass from.
NodeHistory
One node as it was at the end of the last frame it was recorded in.
ObjDocument
The decoded contents of an OBJ file.
ObjectIdFrame
Which mesh drew every pixel of one frame — what Renderer.captureObjectIds answers with.
ObjLoader
Decodes Wavefront OBJ, optionally with its .mtl material libraries.
ObjModelWriter
Wavefront OBJ, with its .mtl beside it when the document names a material.
ObjWriter
Encodes any ModelDocument as Wavefront OBJ, with its .mtl beside it.
OcclusionBuffer
A small depth-only rasteriser the scene pass culls against — C2.
OcclusionTest
Whether anything inside a world-space box may be seen this frame.
OffAxisProjection
A frustum whose four sides are given separately, so the axis need not be in the middle of it.
OrbitController
Turntable controls: orbit a node around a target point.
OrthographicProjection
OverlayBatch
One buffer of overlay vertices, grown rather than reallocated.
PackedIndices
Indices packed for GPU upload.
PagedSplatOctree
A splat tree whose pages arrive on request.
PassContribution
The difference between two frames of the same size.
PassContributor
Something that draws inside a pass it does not own.
PassEncoder
A pass that is open, into which draws are recorded.
PassSkip
Why a pass that was registered did not run — gfx-39n.
PassState
A pass's rasteriser state. Unset fields are not emitted.
PerspectiveProjection
Photometric
Lumens, candela and lux, into LightNode.intensity — gfx-13n.
PipelineHandle
A vertex and a fragment stage, linked into something that can be bound.
PlainModelDocument
A ModelDocument assembled by hand, from plain lists.
PlaneShape
Subdivided plane in the XZ plane, normal pointing at +Y.
PointerTargets
The materials and lights of one model instance, as a place for KHR_animation_pointer tracks to land.
Pose
A flat, scene-graph-free pose: one hierarchy's local TRS, sampled from a clip and composed into world and joint matrices without ever touching a SceneNode — anim-01's own row.
PosedMesh
Posed positions for one mesh and skeleton, reused while the pose holds.
PostFrameResult
What Renderer.renderPost handed back.
PresenterRegistration
What registerDevicePresenter hands back, so a registration can be taken off again. See BackendRegistration for why a registry needs this.
ProbeFace
Where each face looks and which way is up, in the order the faces are stored: +X, −X, +Y, −Y, +Z, −Z.
ProceduralTexture
A texture generated in code.
Projection
How a camera maps eye space onto clip space.
QualityRow
One measured row: a setting, what it costs and what it takes away.
QualitySetting
One combination of the levers: a render scale and an effect tier.
QualityTable
The rows of one device class, best picture first.
RangeHint
A number with two ends and, when it is not continuous, an increment.
Ray
A ray: an origin and a direction.
Raycaster
Casts rays against a Scene on the CPU.
ReactiveFrame
Everything a contributor is handed to mark its pixels reactive — R4.
ReflectionProbeNode
A point the scene is reflected from.
ReflectionSettings
Screen-space reflections.
Renderer
Draws a Scene through one or more RenderViews.
RenderList
Visible draws for one view, split into opaque and transparent halves.
RenderNode
Something that declares what it touches, owns a pass, and draws it.
RenderNodeRegistry
The nodes a renderer runs, and the order it runs them in.
RenderPassDescriptor
Everything a pass draws into.
RenderServices
What the renderer lends a contributor or a node.
RenderSettings
Scene-wide shading knobs that are not per-material.
RenderTargetPool
Reuses textures across frames, keyed by what makes them interchangeable.
RenderTargetSpec
What makes two render targets interchangeable.
RenderView
One camera rendering one target.
ResourceCache<K, V>
A reference-counted cache of asynchronously loaded resources.
ResourceDesc
What a node is asking for when it writes a resource.
ResourceHandle<V>
A borrowed reference to a cached resource.
ResourceSize
How large a resource is, relative to the frame or in its own right.
ResourceVersion
A resource as it stands between one write of it and the next.
Rgba8Image
A decoded source image: tightly packed RGBA8, row-major, top row first — exactly what ui.Image.toByteData(format: rawStraightRgba) hands the engine's own texture upload path, and what every encoder in encode/ takes in.
SamplerOptions
How a texture is sampled.
Scene
A scene: a hierarchy of nodes plus flat registries of what is in it.
SceneBvh
A bounding volume hierarchy over bounding spheres.
SceneNode
A node in the scene graph: a name, a place in the hierarchy, and a transform.
SceneShadows
The shadow textures one scene draw samples, as the frame answered for them.
ScreenRect
A rectangle of a render target, in pixels.
ShaderBundle
A loadable shader bundle: a name, the SDK it was compiled on, the stages it claims, and a compiled section per backend that needs one.
ShaderBundleStage
One entry point a bundle claims to hold.
ShaderHandle
ShaderLibrary
The stages a compiled bundle holds, addressed by name.
ShaderLightType
Light type codes as the shader reads them.
ShadowAssignment
Who owns which row, and whether the static atlas is stale.
ShadowCandidate
A light asking for a row this frame.
ShadowFaceScheduler
Which faces of the atlas are redrawn this frame.
ShadowFilter
How the directional light's shadow map is filtered into a soft edge — S2.
ShadowSettings
Shadow mapping settings: the directional cascades and the point and spot cube atlas.
ShadowSlotAllocator
Hands out atlas rows, and tries hard not to move them.
Shape
A parameterized generator of geometry.
Skeleton
A posed skeleton: joint nodes plus the matrices that undo their bind pose.
SkinBlend
Skins a mesh's positions, normals and tangent directions on the CPU, into a copy of its vertex buffer — anim-02's own row, the skinning half of what MorphBlend already does for morph targets.
SkyDome
An inside-out sphere, which is a sky the camera sits at the centre of.
SkyGradient
The cheapest description of a sky that still reads as one: three stops and a scattering lobe around the sun.
SkyLook
Where a SkyColour is being asked to look.
SkySettings
What the sky looks like, and whether there is one.
SoftwareOcclusion
OcclusionMode.software: this frame's occluders rasterised into an OcclusionBuffer before the render list is built — C2.
SolidColorTexture
A single flat colour.
SpatialUpscaleSettings
Bringing a frame drawn below full size up to it without a temporal resolve — R5.
SphereShape
UV sphere, a revolved meridian arc.
SplatAxes
Which axes a cloud read by parseSplatSpz comes back in.
SplatCloud
A fitted cloud, in the units the file stored.
SplatContributor
Draws a cloud into the scene pass.
SplatLens
What SplatQuads.build needs of a camera beyond its right and up axes: its view axis, and how the projection turns depth into pixels.
SplatLod
Draws a splat tree at a budget — what SplatQuads.lod takes in place of a single cloud.
SplatOctree
A cloud as a tree of levels of detail. Node 0 is the root.
SplatOctreeNode
One box of the tree.
SplatQuads
Builds the vertex data for cloud, back to front, as camera sees it.
SplatSorter
Keeps a cloud's back-to-front order and the scratch the sort needs.
StencilState
How the stencil test treats the draws that follow, for one face.
StlLoader
Decodes STL, binary or ASCII.
StlModelWriter
STL, binary or ASCII.
StlWriter
Encodes any ModelDocument as STL, binary or ASCII — fmt-20's own row.
StorageBuffer
A buffer a compute stage reads and writes.
SurfaceMaterial
Format-neutral description of how a surface looks.
TemporalSettings
Edges smoothed across frames — R1, R2.
TextureAllocator
Makes a texture. The one thing a pool cannot do on its own.
TextureBinding
A reference from a material to one of the document's images.
TextureBlockLayout
The block footprint and byte cost of a compressed TextureFormat — blockWidth by blockHeight pixels, bytesPerBlock bytes, however many channels or bits per channel the format packs into that block.
TextureHandle
A texture some backend owns, described in the engine's own vocabulary.
TextureHint
A path to an image, and what a file picker should offer.
TextureSampling
Filtering and wrapping requested for a texture.
TextureTransform
KHR_texture_transform's three fields — see TextureBinding.transform.
TiledProjection
One tile of a larger virtual frame, out of tilesX × tilesY — pro- eng-04's own row: a tiled screenshot at a resolution no single render target holds, stitched afterwards from tiles rendered one at a time.
TonemapCurve
Which curve the composite rolls highlights off with — gfx-17n.
TorusShape
Torus: a closed circular profile revolved around Y.
TriangleBvh
A bounding-volume hierarchy over the triangles of one mesh.
TwoBoneIk
Two-bone inverse kinematics — an arm or a leg, bent to reach a point — anim-14's own row.
UniformBlock
A block's members, by name, under the block's own name.
UniversalTarget
What a universal level can be turned into at load.
UsdzModelWriter
.usdz — geometry only, the spike UsdzWriter describes. Not a CheckedModelWriter: nothing here reads a .usdz.
UsdzWriter
Encodes a ModelDocument as .usdz — fmt-27's own row, and a spike rather than the feature-complete writer every other format here has: geometry only, no materials, no hierarchy past one Mesh prim per surface. What decides whether it grows past that is stated in the plan as a question — is there demand — and a spike is exactly the size of thing that can answer it without committing to the rest up front.
UsdzZip
A ZIP archive holding entries uncompressed, each one's data padded to start at a 64-byte offset — the one structural rule .usdz adds on top of an ordinary ZIP.
VertexAttribute
Describes a single vertex attribute.
VertexLayout
An ordered set of attributes making up an interleaved vertex.
VertexLayoutSpec
Every buffer a pipeline reads vertices from, in slot order.
ViewModelNode
Draws the first-person view model over the finished scene.
ViewportRect
Normalized viewport rectangle.
ViewportShading
Which viewport shading a frame is drawn with — gfx-43n, 44n, 45n.
ViewportShadingSettings
Shading read out of the surface buffer instead of out of the materials — gfx-43n, gfx-44n and gfx-45n.
VkFormat
The subset of Vulkan's VkFormat this loader maps to a TextureFormat.
VolumetricFogSettings
Air with a thickness, lit by the sun and by the torches in it — S4.
WrittenFile
One file a write produced.
XraySettings
Silhouettes of what the walls hide.

Enums

AnimationBlend
How a layer's pose meets the base's — gfx-10n.
AnimationInterpolation
How a track's values are blended between keyframes.
AnimationPath
Which node property a track drives.
AnimationPointerProperty
The property a pointer drives, with the number of floats in one value.
AnimationPointerTarget
The kind of object a pointer lands on.
AnimationWrap
How a clip behaves when it runs off its end.
BlendFactor
One term of a blend equation.
BlendOperation
How the two blend terms are combined.
CompareFunction
The test a depth or stencil comparison performs.
CullMode
Which faces the rasteriser discards.
DepthRange
What a backend's clip space maps depth onto.
DiffuseModel
The diffuse lobe of the metal-rough models, pbr and pbrLayered — L8.
FramebufferOrigin
Where a render target's first row of pixels is.
FramePhase
Where in the frame an application's node is registered.
GeometryUsage
What a buffer will be bound as.
GltfAccessorType
glTF accessor type values.
GltfComponentType
glTF componentType values.
GltfPrimitiveMode
glTF primitive topology.
IndexType
The width of one index.
LightType
What shape a light is, which decides how its contribution is integrated.
LoadAction
What happens to an attachment's existing contents when a pass begins.
MaterialAlphaMode
How a material treats the alpha channel, mirroring glTF's alphaMode.
MaterialMap
The maps of a metal-rough material, in the order the layered stage keeps their transforms — C8, LayerInfo.uv_transform and kMapBaseColor and the rest in lib/surface.glsl.
MinMagFilter
Filtering between texels.
MipFilter
Filtering between mip levels.
ModelFormat
Which decoder to use.
ModelLightType
The shape a light's falloff takes — KHR_lights_punctual's own three, and no others, since the extension defines exactly these three and a fourth is not a thing a decoded document can honestly claim to hold.
ModelWriteFormat
Which format encodeModel/encodeModelInIsolate writes.
ObjNormals
How to fill in normals that the file does not provide.
OcclusionMode
How the scene pass rejects what is hidden behind something else — C2, C3. RenderSettings.occlusion picks one; none is the default and the frame every golden was recorded from.
OutputTransform
Volumetric light shafts, marched through the directional shadow map — gfx-33n.
PolygonMode
Whether primitives are filled or drawn as edges.
PrimitiveType
How vertices are assembled into primitives.
ReactiveShape
How a reactive sprite's coverage is worked out — R4, and the shapes post/reactive_sprite.frag knows, in its order.
ResourceOrigin
Where the pixels behind a bound resource came from.
SamplerAddressMode
What sampling outside the 0..1 range does.
ShadowCasterFaces
Which faces of a caster are drawn into a shadow map.
ShadowCastingMode
How a mesh takes part in the shadow passes.
SortMode
How a sub-list of draws is ordered.
SplatColourSpace
The colour space a splat's colours were fitted in, as KHR_gaussian_splatting's colorSpace names it.
SplatComposite
How a cloud's overlapping splats are combined — N5.
StencilFace
Which side of a triangle a stencil configuration applies to.
StencilOperation
What happens to a stencil value once the stencil and depth tests have decided a fragment's fate.
StlNormals
How a facet's normal is chosen.
StorageMode
Where an allocation lives and how it may be used.
StoreAction
What happens to an attachment's contents when a pass ends.
SurfaceAlphaMode
How a surface treats the alpha channel.
TangentMethod
How MeshTangents.withGeneratedTangents derives a frame from the UVs.
TemporalClip
How the temporal resolve decides which of the history is still true — N4.
TextureFormat
The layout of one texel.
TextureType
What shape a texture is.
TextureWrap
TransparencyMode
How the transparent half of a view is composited — R8.
VertexFormat
The type of one vertex attribute, and how much room it takes.
VertexStepMode
Whether a buffer advances once per vertex or once per instance.
WindingOrder
Which winding counts as front-facing, wound in clip space: a transform that mirrors reverses the facing without touching the order the vertices arrived in, and every backend decides after the vertex stage rather than before it.

Extension Types

ResourceId
Something a node reads or writes, addressed by name.

Extensions

BindUniformBlockObject on PassEncoder
DebugDrawGizmos on DebugDraw
The shape-level overlays — boxes, axes, normals, frusta, spheres, light gizmos — and buildForScene, which assembles them from a Scene.
MeshTangents on MeshData
Tangent generation, split out of MeshData because it is a self-contained algorithm that only ever touches MeshData's public surface — an extension keeps it that way rather than granting it access to private state it does not need.
PassStateApply on PassEncoder
Applies a PassState to an encoder.
TextureFormatCompression on TextureFormat
Whether a TextureFormat is stored in fixed-size blocks rather than one value per texel, and — for the formats where it is — how big those blocks are.
TextureFormatStencil on TextureFormat
Whether a TextureFormat carries an eight-bit stencil beside its depth.

Constants

builtInModelExtensions → const Map<String, ModelFormat>
Every file suffix a built-in reader answers to, and which reader.
builtInModelWriters → const List<ModelWriter>
Every writer this package ships, in the order a menu would offer them.
kDefaultVertexCacheSize → const int
A FIFO post-transform vertex cache's own size on real GPUs, give or take — the number optimizeVertexCache scores triangle choices against when the caller does not name one.
kF3dHeaderBytes → const int
kF3dMagic → const int
F3D\n, chosen so a file opened in a text editor announces itself on line one and the trailing newline stops the magic from running into what follows.
kF3dSectionEntryBytes → const int
kF3dVersion → const int
Bumped when an existing record changes meaning. Adding a section does not need it — an old reader skips what it does not recognise.
kFmatVersion → const int
The version this reader writes and the only one it accepts.
kImpostorGrid → const int
Views along each side of an impostor atlas: the plan's eight, fixed in 0.8 so no shader block has to carry it.
kIrradianceReach → const double
How far a probe looks before deciding it is seeing the sky.
kKtx2HeaderBytes → const int
kKtx2HeaderOffset → const int
kKtx2Identifier → const List<int>
AB 4B 54 58 20 32 30 BB 0D 0A 1A 0A — the twelve-byte identifier every KTX2 file starts with.
kKtx2IndexBytes → const int
kKtx2IndexOffset → const int
kKtx2LevelIndexEntryBytes → const int
kKtx2LevelIndexOffset → const int
kMaterialInputs → const List<MaterialInput>
Every input, and the single list of them.
kMaterialTextureBindings → const List<String>
What the engine binds, and therefore the only names a texture declaration may point at.
kMaxPayload → const int
Largest payload the packing can represent.
kNoHit → const double
Returned instead of a distance when nothing was hit.
kPayloadBits → const int
Number of low bits reserved for the payload an entry carries alongside its key.
kPayloadMask → const int
Mask for the payload half of a packed entry.
kRadixThreshold → const int
Below this many entries a comparison sort wins.
kRootMotionExtra → const String
The key a clip's own extracted root motion sits under in AnimationClip.extras — anim-16's own flutter3dRootMotion.
kSortKeyBits → const int
Bits available to the sort key itself.
kSplatFloatsPerVertex → const int
Floats per vertex in VertexLayout.positionColorTexcoord: xyz, rgba, uv.
kSplatKeyMax → const int
The largest quantised distance: keys run 0..kSplatKeyMax.
kSplatLeanLimit → const double
How far off the view axis the perspective lean is taken, as a multiple of the half field of view: a splat centred beyond the frame's edge is leaned as if it sat at 1.3 times the edge, so one far off to the side and close to the eye does not become a streak across the whole screen.
kSplatLowPass → const double
The screen-space low-pass filter every splat's footprint is widened by, in pixels squared: the variance a Gaussian at least one pixel across has.
kSplatOctreeExtension → const String
The file suffix flutter3d_build convert writes a splat tree to.
kSplatOctreeHeaderBytes → const int
Bytes before the node table.
kSplatOctreeNodeBytes → const int
Bytes a node takes in the table.
kSplatOctreeVersion → const int
The tree file's format version.
kSplatPageBytesPerSplat → const int
Bytes a splat takes in a page: centre, colour, scale, rotation as float32.
kSplatReach → const double
How far out the quad reaches, in standard deviations.
kSplatShC0 → const double
The spherical-harmonic normalisation the 3D Gaussian Splatting papers and every exporter after them use for the zeroth band.
kSplatVerticesPerSplat → const int
Six vertices a splat: two triangles sharing no vertex between them, drawn through the identity index buffer MeshOverlay also reaches for, since this engine has no unindexed draw at all.
kSpzLatestVersion → const int
The highest format version this reads: version 4, zstd streams.
kUniversalBlockKey → const String
The KTX2 key/value key that says a file's blocks are these.
kUniversalBlockRgb → const String
The key's value for a texture whose alpha is opaque throughout.
kUniversalBlockRgba → const String
The key's value for a texture that carries alpha.
readbackFormats → const Set<TextureFormat>
The formats a readback hands back as they are: four bytes per pixel, one per channel, which is what GraphicsDevice.readback promises.

Properties

builtInMaterialHints → Map<String, MaterialHint>
Hints for the fields every material has, held here rather than written into every file.
final
kNeutralColor → Vector4
Opaque white: a vertex colour multiplies the surface, so this is the value that changes nothing.
final
kNeutralJoints → Vector4
Every vertex bound to joint zero.
final
kNeutralTangent → Vector4
A unit tangent along +X with a positive bitangent sign.
final
kNeutralWeights → Vector4
All the influence on the first joint.
final

Functions

advanceTime({required double time, required double deltaSeconds, required double length, required AnimationWrap wrap, required bool reversing}) → ({bool reversing, bool stopped, double time})
Where a playhead lands after a step, and what the wrap did to it.
animationTrackKey(AnimationTrack track) → int
Where a track sits in a pose: one number for a node and a path together.
applyBinary(String op, List<double> a, List<double> b) → List<double>
+ - * / on two values, with GLSL's broadcasting.
averageCacheMissRatio(Uint32List indices, {int cacheSize = kDefaultVertexCacheSize}) → double
Cache misses per triangle simulating a FIFO cache of cacheSize entries reading indices in order — the standard ACMR metric (Hoppe, "Optimization of Mesh Locality for Transparent Vertex Caching", 1999) for how well a triangle order reuses recently-transformed vertices.
bloomLevelsFor(BloomSettings settings, {required int frameHeight}) → int
How many halvings the bloom chain does on a frame frameHeight tall — gfx-31n.
broadcastArguments(List<List<double>> arguments, MaterialBuiltin builtin) → List<List<double>>
Spreads a one-component argument across the widest one, for the builtins that take a float beside a vector.
buildIdentityLut({int size = 33}) → Uint8List
The colour table that changes nothing, size slices wide — gfx-18n.
buildMipChain(Rgba8Image base, {bool srgb = false, bool isNormalMap = false, double? alphaTestThreshold}) → List<Rgba8Image>
Builds a full mip chain from base down to a 1×1 level, each level a proper Kaiser-windowed resample of the one above rather than a box average — ap-08 in doc/asset-pipeline-plan.md.
buildPolyline(List<Vector3> points, {required double width, List<Vector4>? colours, Vector4? colour}) → MeshData
points as one band width pixels across, coloured per point.
buildsMipChain(GraphicsDevice device, TextureSampling sampling, int width, int height) → bool
Whether an image of this size, sampled this way, gets a mip chain.
buildSplatOctree(SplatCloud cloud, {int leafCapacity = 512, int grid = 8}) → SplatOctree
Builds the tree over cloud.
builtInModelDecoder(ModelFormat format, ModelLoadRequest request) → ModelDecoder
The decoder this package ships for format, configured from request.
canDecodeFileName(String fileName, {List<ModelDecoder> decoders = const <ModelDecoder>[]}) → bool
Whether a file called fileName is one decodeModelBytes would read on its name alone — a built-in suffix, or one of decoders claiming it.
checkMaterialSurface(Map<String, List<double>> inputs) → void
Throws ArgumentError unless inputs answers every name in kMaterialInputs, with the right number of components.
chooseUniversalTarget(GraphicsDevice device, {required bool hasAlpha}) → UniversalTarget?
The best format device samples for a universal-block texture — gfx-83n, and the half of that row this package can answer that flutter3d_core's own formats library cannot.
clusterEye(Matrix4 viewProjection, Matrix4 world) → Vector3?
Where the eye of viewProjection stands in the space world maps from, or null when the projection is orthographic and there is no one point.
compareModelDocuments(ModelDocument source, ModelDocument readBack, {double tolerance = 0.0, bool allowVertexReorder = false}) → List<DocumentDifference>
What readBack lost or changed against source. Empty means the round trip held.
contributionBetween(ByteData without, ByteData with_, {required int width, required int height}) → PassContribution
Differences two RGBA frames of width by height.
decodeDataUri(String uri) → Uint8List
Decodes a data: URI payload.
decodeDraco(Uint8List bytes) → DracoMesh
Decodes bytes, the contents of the buffer view a primitive's KHR_draco_mesh_compression extension points at.
decodeImagePure(Uint8List encoded) → Future<Rgba8Image?>
Decodes encoded into straight RGBA8 pixels with no Flutter SDK and no dart:ui behind it — mcp-04n: the headless half of flutter3d_core's own ImageDecoder typedef, which this function's signature already matches structurally without needing to import it (flutter3d_formats sits below flutter3d_core in the dependency order, so the import would run backwards).
decodeJpeg(Uint8List bytes) → DecodedImage?
bytes decoded, or null on anything this reader cannot make sense of: a missing SOI, a precision or frame type this reader does not support, a Huffman code with no match, or entropy data that runs out before every MCU is accounted for.
decodeModel(ModelLoadRequest request) → Future<ModelDocument>
Decodes a model on the calling isolate.
decodeModelBytes(ModelLoadRequest request, Uint8List bytes, AssetUriResolver resolveUri) → Future<ModelDocument>
Decodes already-read bytes with an explicit resolver.
decodeModelInIsolate(ModelLoadRequest request) → Future<ModelDocument>
Decodes a model on a background isolate.
decodeOctahedral(double u, double v, [Vector3? out]) → Vector3
The inverse of encodeOctahedral.
decodePng(Uint8List bytes) → DecodedImage?
bytes decoded, or null on anything this reader cannot make sense of: a signature that does not match, a chunk running past the end of the file, a colour type or bit depth combination the PNG specification does not allow, interlacing, or an IDAT stream zlibInflate itself refuses.
decodeSplatPage(Uint8List bytes, int count) → SplatCloud
One node's page, count splats, as a cloud.
decodeUniversalBlock(Uint8List blocks, int index) → List<(int, int, int, int)>
The sixteen texels of block index, row-major — what the legs with no structural shortcut start from, and what a test compares against.
describeEmptyFrame(Scene scene, List<RenderView> views) → String?
Why scene drew nothing through views, or null when something did draw.
describeMaterial(MaterialProgram program) → MaterialBindings
What the engine may bind to program's compiled shader.
deviceClassPath(String path, DeviceClass deviceClass) → String
path with deviceClass put before its extension: chair.f3d becomes chair.phone.f3d, crypt.json becomes crypt.phone.json.
emitMaterialFragment(MaterialProgram program) → String
The .frag source for program, which should already be specialised.
encodeAstc4x4(Rgba8Image image) → Uint8List
Encodes image as ASTC 4×4 LDR (vkFormat.astc4x4UNormBlock): one 16-byte block per 4×4 tile — mat-30's own gap on top of fmt-22's BC1/BC3/ETC2 trio, doc/asset-pipeline-plan.md's ap-07.
encodeAstc4x4Block(List<(int, int, int, int)> pixels) → Uint8List
Encodes one 4×4 block (row-major, alpha ignored) as sixteen bytes: the 11-bit _kBlockMode, a 2-bit partition count of zero (one partition), a 4-bit CEM of _kCemLdrRgbDirect, six _kColorBits-wide endpoint channel values, then sixteen _kWeightBits-wide per-texel weights packed downward from bit 127 — 17 + 48 from the bottom and 48 from the top, leaving the fifteen bits between them zero.
encodeBc1(Rgba8Image image) → Uint8List
Encodes image as BC1 (vkFormat.bc1RgbaUNormBlock): one 8-byte block per 4×4 tile, two RGB565 endpoints and sixteen 2-bit palette picks.
encodeBc3(Rgba8Image image) → Uint8List
Encodes image as BC3 (vkFormat.bc3UNormBlock): sixteen bytes per 4×4 tile — an eight-byte alpha block, then the same eight-byte colour block encodeBc1Block writes, in that order.
encodeCompressedPng(int width, int height, Uint8List rgba) → Uint8List
rgba (width × height, four bytes a pixel, top row first — the same shape DecodedImage.rgba reads back) written as an 8-bit RGBA PNG.
encodeEtc2Rgb8(Rgba8Image image) → Uint8List
Encodes image as ETC2 RGB8 (vkFormat.etc2R8g8b8UNormBlock): one 8-byte block per 4×4 tile.
encodeEtc2Rgb8Block(List<(int, int, int, int)> pixels) → Uint8List
Encodes one 4×4 block (row-major, alpha ignored) as the eight bytes of an ETC1-compatible ETC2 RGB8 block — flip = 0, top and bottom 4×2 halves each with their own base colour and modifier table.
encodeModel(ModelWriteRequest request) → Uint8List
Encodes request in place — the same bytes encodeModelInIsolate would produce, run on the calling isolate instead of handed off. What encodeModelInIsolate falls back to on the web, and what a caller with no isolate to spare can call directly.
encodeModelInIsolate(ModelWriteRequest request) → Future<Uint8List>
Encodes a model on a background isolate — the write-side mirror of decodeModelInIsolate (model_loader.dart), for the same reason: writing a real model costs tens of milliseconds, which is jank on the UI isolate however fast the encoder is. See that function's own doc comment for why the web falls back to running in place instead.
encodeOctahedral(Vector3 direction, [Vector2? out]) → Vector2
A direction as a point in the unit square, and back.
encodeSplatOctree(SplatOctree tree) → Uint8List
tree as a file: header, node table, then every page breadth first. Every node must be loaded.
encodeUniversalBlock(List<(int, int, int, int)> pixels) → Uint8List
Encodes one 4×4 block (sixteen (r, g, b, a) tuples, row-major).
encodeUniversalBlocks(Rgba8Image image) → Uint8List
Encodes image as universal blocks, one per 4×4 tile.
ensureSphereCapacity(Float32List current, int count) → Float32List
Grows current to hold count spheres, reusing it when it already does.
escapesAssetBase(String relative) → bool
A glTF uri is always relative to the document. An absolute path or a .. segment means the file is trying to read outside the asset directory, which is worth refusing rather than resolving.
evaluateMaterial(MaterialProgram program, MaterialSurfaceValues surface) → List<double>
The colour program returns for one fragment: rgb the light the surface emits, a its opacity.
exportChecked(ModelDocument document, CheckedModelWriter writer, {String name = 'model'}) → Future<ExportReport>
Writes document through writer, reads the files back through the same writer and compares at CheckedModelWriter.tolerance.
exportToF3d(ModelDocument document, {String name = 'model'}) → ExportReport
Writes document to this engine's own .f3d container, reads the result back and compares. Synchronous, unlike the other three: .f3d is read as a view over its own bytes rather than decoded, and nothing in that path is asynchronous either.
exportToGlb(ModelDocument document, {String name = 'model'}) → Future<ExportReport>
Writes document as glTF, reads the result back and compares — a binary format, so the round trip is held to a tolerance of 0.0.
exportToObj(ModelDocument document, {String name = 'model'}) → Future<ExportReport>
Writes document as OBJ (with its .mtl beside it, when the document names a material), reads the result back and compares — held to ObjWriter.decimals' own precision rather than 0.0, since a decimal text format rounds on the way out by design.
exportToStl(ModelDocument document, {String name = 'model'}) → Future<ExportReport>
Writes document as binary STL, reads the result back and compares.
fileUriResolver(String baseDirectory) → AssetUriResolver
Resolves asset URIs relative to a directory on disk.
followCamera(MeshNode sky, CameraNode camera) → void
Moves sky to where camera is, which is what makes a ten-metre sphere a sky rather than a ball.
gather(IrradianceField field, Scene scene, {int rays = 128, Vector3? sky}) → void
Fills every probe of field from scene.
gatherProbe(IrradianceField field, Scene scene, int x, int y, int z, {int rays = 128, Vector3? sky, Raycaster? caster}) → void
Fills one probe. See gather; the field's gutters are not refilled here, because a caller updating a slice per frame should do that once at the end.
hasConflictingTextureTransforms(SurfaceMaterial material) → bool
Whether the textures of material name transforms that cannot all be honoured by one set of coordinates — the case a caller warns about.
hdrSizeOf(Uint8List bytes) → ({int height, int width})?
How big bytes says it is, without decoding a pixel of it — ux-49.
impostorCard({required Vector3 centre, required double radius}) → MeshData
The card an ImpostorNode draws, in the layout impostor.vert reads.
impostorDecode(double u, double v) → Vector3
The inverse of impostorEncode.
impostorEncode(Vector3 d) → Vector2
A direction on the sphere as a point of the unit square — the octahedral map with +Y at the centre and -Y at the four corners, so the views a tree is mostly seen from, level and from above, take the middle of the atlas.
impostorRight(Vector3 d) → Vector3
The right-hand axis of a card, or a baked view, facing along d: level with the ground, except looking straight up or down, where level has no direction and -Z stands in for up.
impostorViewDirection(int column, int row) → Vector3
The direction view column, row of the grid was baked looking back along: from the middle of the sphere towards the camera that took it.
inflate(Uint8List data) → Uint8List?
A raw DEFLATE stream, with no zlib wrapper around it — zlibInflate's own worker, public because a caller that already has the wrapper stripped (or none at all, as in a raw .deflate stream) should not have to fake one back on to call this.
isBasisUniversalKtx2(Uint8List bytes) → bool
True when bytes is a KTX2 file whose vkFormat is undefined — a Basis Universal file, whose pixels are a transcode rather than a copy.
isBinaryStl(Uint8List bytes) → bool
True when bytes is a binary STL file.
isF3dFile(Uint8List bytes) → bool
True when bytes begins with the .f3d magic.
isFmat(Uint8List bytes) → bool
Whether bytes look like a .fmat.
isKtx2BasisUniversal(Uint8List bytes) → bool
Whether bytes is a KTX2 file Basis Universal produced — fmt-21's own row, the check that decides whether a texture can travel as KHR_texture_basisu or has to be embedded the ordinary way instead.
isKtx2File(Uint8List bytes) → bool
True when bytes begins with the KTX2 identifier.
jitterOffset(int frame, int length) → (double, double)
Frame frame's sub-pixel offset, in pixels within [-0.5, 0.5), from a Halton(2, 3) sequence that repeats every length frames — R1.
lookAtRightHanded(Vector3 eye, Vector3 target, Vector3 up) → Matrix4
A right-handed look-at whose camera looks down its own −Z, which is what PerspectiveProjection and this engine's [0, 1] depth convention expect.
looksLikeAsciiStl(Uint8List bytes) → bool
True when bytes looks like the text dialect: solid (any case), once leading whitespace is skipped.
looksLikeSpz(Uint8List bytes) → bool
Whether bytes starts the way an SPZ does: the version 4 magic in the clear, or a gzip stream, which is what versions 1 to 3 are.
lookUpDevicePresenter(GraphicsDevice device) → Object?
The presenter registerDevicePresenter stored for device's own runtime type, or null if nothing ever registered one.
materialExtensionsFromJson(Map<String, Object?> extensions, {required TextureBinding? texture(Object? info), List<String>? warnings, String where = 'a material'}) → MaterialExtensions?
The layers extensions names — a glTF material's own extensions object, or the same shape in a .fmat or a .f3d — or null when it names none of MaterialExtensions.gltfNames.
materialExtensionsToJson(MaterialExtensions e, {required Object? texture(TextureBinding binding)}) → Map<String, Object?>
The inverse of materialExtensionsFromJson: each extension whose values differ from its defaults, or that carries a texture, keyed by its glTF name. texture writes one binding in the caller's format.
measureFrameMicros(FutureOr<void> frame(), {int warmUp = 2, int frames = 8}) → Future<int>
Times frame the way a loading screen can afford to: warmUp calls thrown away (the first frames pay for pipelines and uploads, which is not what is being measured), then the median of frames more, in microseconds.
mergeSplats(List<SplatCloud> parts, {required Vector3 centre, required double half, required int grid}) → SplatCloud
The splats of parts merged into at most grid³, one per occupied cell of a grid³ lattice over the cube of half-size half about centre.
modelWriterNamed(String asked, {List<ModelWriter> writers = builtInModelWriters}) → ModelWriter?
The writer in writers that asked names — by ModelWriter.name first, then by ModelWriter.suffix, with or without its dot, ignoring case — or null when none does.
openRegisteredDevice({required int width, required int height, void onFallback(String message)?}) → Future<GraphicsDevice>
Opens the first registered backend that starts, preferred backends before the fallback, calling onFallback with a message once for every refusal along the way.
optimizeTriangleOrder(Uint32List indices, int vertexCount, {int cacheSize = kDefaultVertexCacheSize}) → Uint32List
indices reordered so triangles sharing recently-drawn vertices are drawn near each other, by Forsyth's greedy scoring: each step emits the unemitted triangle whose three vertices score highest, then ages every vertex still in the simulated cache and rescores the triangles that touch it.
optimizeVertexCache(MeshData mesh, {int cacheSize = kDefaultVertexCacheSize}) → MeshData
mesh with its triangles and vertices reordered for GPU cache reuse: optimizeTriangleOrder on the index buffer, then optimizeVertexFetch to renumber vertices by first use in that new order — the same two-pass scheme real engines and meshoptimizer split into, because the two caches they target (post- and pre-transform) are optimized by different orders.
optimizeVertexFetch(Uint32List indices, int vertexCount) → ({Uint32List indices, Uint32List oldToNew})
indices renumbered so a vertex's new index is the order it is first referenced in — the pre-transform ("vertex fetch") half of GPU cache friendliness, meant to run on triangle-cache-ordered indices ( optimizeTriangleOrder's output) the way meshoptimizer's optVertexFetch follows its own optVertexCache. A vertex a GPU fetches right after the one before it in memory is a vertex its prefetcher already has queued; a triangle order optimized for the post-transform cache alone can still reference vertex data scattered across the buffer.
packLanes(List<PackedLane?> lanes) → Rgba8Image?
lanes — red, green, blue, alpha — packed into one RGBA8 image, or null when every lane is empty.
packSceneSpheres(List<MeshNode> meshes, Float32List out) → int
Packs a scene's world bounding spheres for SceneBvh.
paintSky(MeshData mesh, SkyColour colour) → void
Writes colour into every vertex of mesh, by the direction it sits in.
parseMaterial(String source) → MaterialProgram
Reads source as one material.
parseMtl(String text, {List<String>? warnings}) → Map<String, MtlMaterial>
Parses a .mtl library.
parseSplatOctree(Uint8List bytes) → SplatOctree
A whole tree file read at once, every page attached.
parseSplatOctreeIndex(Uint8List bytes) → SplatOctree
The tree's nodes out of the header and table, every page still to load.
parseSplatPly(Uint8List bytes, {bool keepHigherBands = false, SplatColourSpace colourSpace = SplatColourSpace.srgb}) → SplatCloud
The cloud in bytes, or a thrown SplatPlyException saying why not.
parseSplatSpz(Uint8List bytes, {SplatAxes axes = SplatAxes.rightUpBack, bool keepHigherBands = true, SplatColourSpace colourSpace = SplatColourSpace.srgb}) → SplatCloud
The cloud in bytes, or a thrown SplatSpzException saying why not.
probeFaceIsMirrored(FramebufferOrigin origin) → bool
Whether the view probeFaceViewProjection builds reverses the winding of every triangle drawn through it.
probeFaceViewProjection(int face, Vector3 position, {required double near, required double far, required FramebufferOrigin origin, required DepthRange depthRange}) → Matrix4
The view-projection that draws face of a probe at position into a cube face a sampler reads correctly, in the clip space of a backend with the given origin and depthRange.
projectPoint(Matrix4 viewProjection, Vector3 point, {required double width, required double height}) → ({double x, double y})?
Where point lands, or null if it is behind the eye.
radixSortPackedKeys(Int64List buffer, Int64List scratch, int count, {Uint32List? counts}) → void
Least-significant-digit radix sort over bytes, stable by construction.
rayAabb(Ray ray, Aabb3 box) → double
Distance along ray to box, or kNoHit.
raySphere(Ray ray, Vector3 centre, double radius) → double
Distance along ray to a sphere, or kNoHit. Inside counts as 0.
rayTriangle(Ray ray, Vector3 a, Vector3 b, Vector3 c, {Vector2? outUv, bool cullBackFace = false}) → double
Möller–Trumbore ray/triangle intersection.
readbackRegionOf(TextureHandle texture, ScreenRect? region) → ScreenRect
The region a readback of texture will copy, or an ArgumentError saying why there is none.
readFmat(Uint8List bytes, {String name = ''}) → MaterialDocument
Reads a .fmat material.
readHdr(Uint8List bytes) → HdrImage
bytes as an HDR image.
recognizedModelFormat(String fileName) → ModelFormat?
The format fileName's own extension names, or null when it names none of the four this package reads.
registerBackendOpener(String name, BackendOpener open, {bool asFallback = false}) → BackendRegistration
Registers open as a backend a caller of openRegisteredDevice may try, named name for the console line printed if it refuses to start.
registerDevicePresenter<T extends GraphicsDevice>(Object presenter) → PresenterRegistration
Registers presenter — a value only the caller knows the shape of — as what shows a frame from a device of exactly type T.
safeRelativeAssetPath(String uri) → String
A reference inside a model is always relative to the model. An absolute path or a .. segment means the file is reaching outside its directory, which is worth refusing rather than resolving.
samplerOptionsFor(TextureSampling info) → SamplerOptions
Maps decoded sampling settings onto the engine's sampler description.
screenBoundsOfBox(Matrix4 viewProjection, Aabb3 box, {required double width, required double height}) → ScreenBounds?
The axis-aligned rectangle covering box on the glass, or null when none of it is in front of the eye.
screenMotion(Matrix4 previous, Matrix4 current) → double
How far the picture moved between two frames, as a fraction of the screen's width: the mean distance five points spread over the view moved between previous and current, two unjittered view-projections (FrameHistory.viewProjection and CameraNode.viewProjection).
selectVisibleClusters({required MeshClusters clusters, required Matrix4 world, required Frustum frustum, required Uint8List visible, Vector3? eye, OcclusionTest? occlusion, Aabb3? scratch}) → int
Marks in visible (one byte per cluster) the clusters of clusters a view may see, and returns how many.
sharedTextureTransform(SurfaceMaterial material) → TextureTransform?
The one transform every texture of material asks for, or null.
skyNode(MeshGeometry mesh, {String name = 'sky'}) → MeshNode
A node holding mesh, flagged so that it behaves as a sky.
sniffImageMimeType(Uint8List bytes) → String?
Guesses an image's MIME type from its leading bytes.
sniffModelFormat(Uint8List bytes) → ModelFormat
Guesses a format from the leading bytes.
sortPackedKeys(Int64List buffer, Int64List scratch, int count, {Uint32List? counts}) → void
Sorts the first count packed entries of buffer ascending.
sortSplatKeys(Uint32List keys, Uint32List order, Uint32List keyScratch, Uint32List orderScratch, int count, Uint32List counts) → void
Sorts the first count entries of keys ascending, carrying order along, in two stable eight-bit counting passes.
specialiseMaterial(MaterialProgram program, MaterialVariant variant) → MaterialProgram
program with variant's parameter values folded in, ready to emit or to evaluate.
splatBytesReader(Uint8List bytes) → SplatRangeReader
A SplatRangeReader over a file already in memory — for tests, and for a caller that has the whole file but wants the paged path anyway.
splatChannel(double coefficient) → double
A zeroth-band spherical-harmonic coefficient as a colour channel, in the space it was fitted in and unclamped — the raw sum the file's numbers make.
splatColour(double coefficient, SplatColourSpace space) → double
A zeroth-band coefficient as the linear channel the engine blends, for a cloud fitted in space.
splatOctreeIndexBytes(Uint8List header) → int
How many bytes of the file parseSplatOctreeIndex needs, given its first kSplatOctreeHeaderBytes.
splatOpacity(double logit) → double
logit through the logistic function, which is how a file stores opacity.
surfaceMaterialFromJson(Map<String, Object?> json, {String? name, List<String>? warnings, TextureBinding? baseColorTexture, TextureBinding? normalTexture, TextureBinding? metallicRoughnessTexture, TextureBinding? occlusionTexture, TextureBinding? emissiveTexture, MaterialExtensions? extensions}) → SurfaceMaterial
The inverse of surfaceMaterialToJson: a SurfaceMaterial built from json's own scalar and colour fields, with name as the fallback for a document that names itself no other way and the five texture bindings supplied by the caller — already resolved against whatever document json came from, the same division surfaceMaterialToJson draws.
surfaceMaterialToJson(SurfaceMaterial surface) → Map<String, Object?>
surface's own scalar and colour fields, keyed the way writeFmat nests them into a .fmat — everything but its texture slots, which surfaceMaterialFromJson takes as separate, already-resolved arguments rather than reading here.
symmetricEigen3(Float64List m) → (Float64List, Float64List)
The eigenvalues and unit eigenvectors of the symmetric 3×3 m (row major), by cyclic Jacobi rotations.
toDepthRange(Matrix4 projection, DepthRange range) → Matrix4
projection expressed for range.
toFramebufferOrigin(Matrix4 projection, FramebufferOrigin origin) → Matrix4
projection adjusted for where origin puts row zero.
toGltfFilters(TextureSampling sampling) → (int, int)
The (magFilter, minFilter) GL constant pair a glTF writer should emit for sampling — the exact inverse of _decodeSampler's filter half, so a document decoded from glTF and written back out names the same constant it arrived with, mipmap variant included.
transcodeUniversal(Uint8List blocks, UniversalTarget target, {required int width, required int height}) → Uint8List
blocks as target, ready to upload.
universalBlockFormat(Uint8List bytes) → ({bool hasAlpha})?
Whether bytes is a universal-block file and whether it carries alpha, or null when it is an ordinary KTX2.
uploadCoatMap(GraphicsDevice device, MaterialExtensions layers, {required Future<Rgba8Image?> image(TextureBinding binding)}) → Future<PackedMap?>
layers' coat map on device: red the clear coat, green its roughness, blue the transmission and alpha the thickness — M3. Null when no such texture is there or none of them decodes, which binds white — the factors alone.
uploadEncodedImage(GraphicsDevice device, Uint8List encoded, {required ImageDecoder decodeImage, TextureSampling sampling = const TextureSampling(), void report(String message)?}) → Future<TextureHandle?>
Decodes an encoded image (PNG, JPEG, KTX2, …) and uploads it through device.
uploadRgba8(GraphicsDevice device, Rgba8Image image, {TextureSampling sampling = const TextureSampling()}) → TextureHandle?
image uploaded through device, with a mip chain when sampling asks for one — uploadEncodedImage's own tail, for pixels that never were an encoded file: a map packed from several (packed_maps.dart).
uploadSheenMap(GraphicsDevice device, MaterialExtensions layers, {required Future<Rgba8Image?> image(TextureBinding binding)}) → Future<PackedMap?>
layers' sheen map on device — M2: the sheen colour's red, green and blue, still sRGB as authored, and its roughness in alpha. Null, and white, as uploadCoatMap.
validateGltfExport(Uint8List bytes, {AssetUriResolver? resolveUri, double tolerance = 1e-5}) → Future<List<String>>
Reads bytes as glTF/GLB and checks every accessor's declared min/max against the values it actually holds.
viewAxisOf(Matrix4 viewProjection, [Vector3? out]) → Vector3
Which way viewProjection looks, as a unit vector in world space.
withTextureTransform(MeshData mesh, TextureTransform transform) → MeshData
mesh with transform applied to its texture coordinates.
writeFmat(MaterialDocument document) → String
Writes document back out, so a tool that edits a material can save it.
writeKtx2({required int vkFormat, required int pixelWidth, required int pixelHeight, required List<Uint8List> levels, Map<String, String> keyValues = const <String, String>{}}) → Uint8List
Assembles a KTX2 file from already-encoded mip levels — the writer half of ktx2_loader.dart, and the reason ap-07 in doc/asset-pipeline-plan.md lives beside it rather than in flutter3d_build: both read and write the same container, in the same package, with no Flutter SDK behind either.
writeKtx2WithMips(Rgba8Image base, {bool srgb = false, bool isNormalMap = false, double? alphaTestThreshold}) → Uint8List
ap-08's own glue: builds the mip chain over base and writes every level through writeKtx2 in one call, so a caller that wants a ready-to-load file does not have to know that a chain and a writer are two different pieces.
zlibCompress(Uint8List data) → Uint8List
data compressed as a complete zlib (RFC 1950) stream — the two-byte header, one final DEFLATE block, and the trailing Adler-32 _adler32 computes over the uncompressed bytes, which every real decoder checks even though this package's own zlibInflate does not.
zlibInflate(Uint8List zlib) → Uint8List?
zlib decompressed — the zlib header (RFC 1950) stripped and read, and the raw DEFLATE stream behind it inflated. Returns null rather than throwing on anything short, malformed, or naming a compression method or a block type this does not decode — the same "no size to answer with" convention imageDimensions already uses for a truncated header, so a caller has one shape to check either way.

Typedefs

AssetUriResolver = Future<Uint8List> Function(AssetRequest request)
Resolves a URI referenced from inside an asset to its bytes.
BackendOpener = Future<GraphicsDevice> Function({required int height, required int width})
Opens a GraphicsDevice at width by height, or throws.
ChangedBounds = ({int bottom, int left, int right, int top})
Where a difference lives in the frame, in pixels.
FramePass = ({bool active, int drawCalls, int? gpuMicros, int micros, String name, int pipelineSwitches, int triangles})
What one node of the frame graph cost — gfx-01n's own row.
HdrImage = ({int height, Float32List rgb, int width})
A decoded Radiance image: three floats a pixel, row 0 at the top.
ImageDecoder = Future<Rgba8Image?> Function(Uint8List encoded)
Decodes an encoded image — PNG, JPEG, whatever uploadEncodedImage's caller hands it — into straight (not premultiplied) RGBA8 pixels, or null for an image that will not decode.
MeterRect = ({double height, double width, double x, double y})
A rectangle of the frame, in fractions — what a view occupies.
PackedLane = ({int channel, Rgba8Image image})?
One lane of a packed map: which image, and which of its channels (0 red to 3 alpha) goes there. Null leaves the lane white, which multiplies its factor by one.
PackedMap = ({SamplerOptions sampler, TextureHandle texture})
A packed map on device, as uploadCoatMap and uploadSheenMap share it.
ScreenBounds = ({double bottom, double left, double right, double top})
A rectangle on the glass, in logical pixels, with the origin top left.
SkippedPass = ({String name, PassSkip reason})
A registered pass that did not run, and why.
SkyColour = Vector4 Function(SkyLook look)
The colour of the sky in the direction asked about.
SplatRangeReader = Future<Uint8List> Function(int offset, int length)
Reads length bytes of the tree file starting at offset.
StageBindings = ({Set<String> blocks, Set<String> samplers})
One compiled stage of a pipeline — a vertex or a fragment program.
UniformMemberLayout = ({int byteLength, int elements, int offset, String type})
One member of a uniform block as the compiler lays it out — H1.

Exceptions / Errors

DracoException
Thrown when a stream is not one this decodes, with the reason in it.
F3dFormatException
Raised when a file is not a .f3d, is truncated, or claims a version this build does not understand.
FrameGraphError
A graph that failed to compile, with the reason a person can act on.
HdrFormatException
What a file that is not a readable .hdr is answered with.
Ktx2FormatException
Raised when bytes are not a KTX2 file, are truncated, or use a feature this stage of the loader does not read yet — see the library doc comment for exactly which those are.
MaterialSyntaxError
A material source that could not be read, with where it went wrong.
ShaderBundleRefused
Raised when a device will not load a bundle, and says which and why.
SplatOctreeException
Thrown when bytes are not a splat tree this can read.
SplatPlyException
Thrown when a file is not a PLY this can read, with the reason in it.
SplatSpzException
Thrown when a file is not an SPZ this can read, with the reason in it.