ResourceRealizer class

Turns a document's resources into live, GPU-backed Geometry and Material objects, memoizing each so a resource shared by many nodes is realized once.

Procedural and payload-backed geometry, parameter materials, and embedded rgba8 textures realize synchronously. External image assets, encoded (PNG/JPEG) image payloads, and fmat materials need decoding or asset loading, so they are resolved by preload (await it before realizing); the synchronous path falls back to a placeholder for them.

Constructors

ResourceRealizer(SceneDocument document, {AssetBundle? bundle})
Creates a realizer over document. bundle (default rootBundle) resolves external image assets and fmat materials during preload.

Properties

bundle AssetBundle
The asset bundle external assets and fmat materials load from.
final
document SceneDocument
The document whose resources are realized.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

geometry(LocalId id) Geometry
The live geometry for resource id, realized and memoized on first use. The result is stamped with its origin so the serializer can recover it.
material(LocalId id) Material
The live material for resource id, realized and memoized on first use.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preload() Future<void>
Resolves the resources that need asynchronous work (external image assets, encoded image payloads, and fmat materials), caching them so the synchronous realize path finds them ready.
texture(LocalId id) Texture
The live texture for resource id, realized and memoized on first use.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited