scene library
3D rendering for Flutter, built on Flutter GPU and Impeller.
The entry points most applications need are:
- Scene — the scene graph root and renderer. Construct one, attach
Nodes, and call Scene.render from a
CustomPainter(or anydart:uiCanvas). - Node — a transform in the scene graph that may carry a Mesh and
child nodes. Load 3D content with loadScene (preprocessed
.fscenebpackages, by source path) or Node.fromGlbBytes / Node.fromGlbAsset (runtime glTF binary). - Camera / PerspectiveCamera — view configuration passed to Scene.render.
- Material, PhysicallyBasedMaterial, UnlitMaterial,
Environment— shading. - Animation, AnimationClip, AnimationPlayer — playback and blending of imported animations.
Flutter Scene currently requires the Flutter master channel because it depends on the Flutter GPU API.
Classes
- AccelerationModule Particles
- Adds a constant acceleration (world units per second squared) to every particle's velocity each step. Use it for wind or as an extra gravity on top of the system's own gravity.
- AmbientOcclusionSettings Rendering
- Screen-space ambient occlusion settings for a Scene.
- Animation Animation
- A reusable description of an animation, parsed from a model.
- AnimationClip Animation
- An instance of an Animation that has been bound to a specific Node.
- AnimationPlayer Animation
- Drives playback and blending for the AnimationClips on a single node subtree.
- AssetModelSource
-
Loads a
.glbmodel from the asset bundle. - AutoExposureSettings Rendering
- Automatic exposure (eye adaptation) settings for a Scene.
- BezierPath Geometry
- A path of joined cubic Bezier segments.
- BillboardGeometry Geometry
- A batch of camera-facing quads ("billboards"), expanded from per-instance data in the vertex shader and drawn in a single instanced call.
- BloomSettings Rendering
- Makes bright areas bleed light into their surroundings. Computed in a chain of HDR passes and added back to the scene before tone mapping.
- BoxEmitterShape Particles
- Emits particles uniformly inside an axis-aligned box, each headed along a shared direction.
- BoxVolumeBounds Lighting and environment
- An axis-aligned box region.
- Camera Scene graph
- A view onto a scene: a world-space eye position and orientation paired with a lens projection, used by Scene.render to map the scene into clip space.
- CameraComponent Scene graph
- An engine Component that places a Camera in the scene.
- CameraProjection Scene graph
- A lens projection that maps view-space coordinates into clip space.
- CapsuleGeometry Geometry
- A capsule (a cylinder capped by two hemispheres) aligned with the Y axis, centered on the origin.
- CatmullRomPath Geometry
- A smooth curve passing through every one of a list of points.
- ChromaticAberrationSettings Rendering
- Splits the red and blue channels toward the edges, like a simple lens. Sampled from the scene color before grading and tone mapping.
- ColorDistribution Particles
- A color value generator sampled per particle, the color analog of FloatDistribution.
- ColorGradient Particles
-
A color curve over normalized time
[0, 1], baked into a lookup table. - ColorGradingSettings Rendering
- Color grading applied to the linear HDR scene color, before exposure and tone mapping.
- ColorOverLifeModule Particles
- Sets each particle's color from a ColorDistribution sampled over its normalized age (color over life).
- ColorStop Particles
- One color stop of a ColorGradient: a linear RGBA color at normalized time t.
- Component Scene graph
- A unit of data or behavior attached to a Node.
- ConeEmitterShape Particles
- Emits particles from a disc of radius in the local XZ plane, each headed within a cone of half-angle angle about +Y.
- ConstantColor Particles
- A ColorDistribution that is color for every particle.
- ConstantFloat Particles
- A FloatDistribution that is value for every particle.
- CuboidGeometry Geometry
-
An axis-aligned box geometry spanning
-extents/2to+extents/2on each axis, with flat per-face normals. - CurveFloat Particles
- A FloatDistribution that samples curve over the particle's normalized age and scales it by scale.
- CustomRenderPass Rendering
-
A user-supplied render pass inserted into the built-in pipeline at a
named stage. Add one with
Scene.addRenderPass. - CylinderGeometry Geometry
- A cylinder aligned with the Y axis, centered on the origin.
- DashPattern Geometry
- A repeating dash-and-gap pattern for a PolylineGeometry, measured in scene units along the line's arc length.
- DecodedHdr Assets and loading
- A decoded HDR image: linear RGBA float pixels (alpha 1), row-major, row 0 at the top.
- DepthOfField Rendering
-
Depth-of-field settings for a
Scene(scene.depthOfField), disabled by default. - DirectionalLight Lighting and environment
- An infinitely-distant light source (e.g. the sun) that illuminates the whole scene from a single direction.
- DirectionalLightComponent Scene graph
- An engine Component that places a DirectionalLight in the scene.
- DiscGeometry Geometry
-
A flat filled disc in the XZ plane, centered on the origin, facing
+Y. - EmitterShape Particles
- Decides where a freshly spawned particle starts and which way it initially heads.
- EnvironmentMap Lighting and environment
- A source of image-based lighting: diffuse irradiance plus prefiltered specular radiance, both derived from an equirectangular environment.
- EnvironmentSettings Lighting and environment
- A copyable, interpolatable snapshot of a Scene's scene-wide look.
- EnvironmentSkySource Lighting and environment
- Shows the scene's image-based-lighting environment as the background, optionally blurred.
- EnvironmentVolume Lighting and environment
- A region that overrides the scene look with its settings, contributing by camera position.
- EnvironmentVolumeBounds Lighting and environment
- The shape of an EnvironmentVolume's region.
- EnvironmentVolumeComponent Lighting and environment
- A Component that contributes a spatial environment volume: a region whose look (settings) overrides the scene environment, blended by camera position so the environment transitions as the camera moves between areas.
- ExtrudeGeometry Geometry
- An arbitrary closed 2D profile swept along a ScenePath.
- FilmGrainSettings Rendering
- Adds animated noise over the final image, after tone mapping.
- FlipbookModule Particles
- Animates each particle's flipbook ParticleStorage.frame through a frameCount-cell atlas.
- FloatDistribution Particles
- A scalar value generator sampled per particle, the single value type behind every scalar particle parameter.
- FmatMaterialRegistry Materials
-
Resolves and loads
.fmatmaterials registered through DataAssets. - Fog Lighting and environment
- Distance fog for a Scene: geometry blends toward color the farther it is from the camera, evaluated per-fragment in linear HDR before tone mapping so fog is exposed and tone-mapped along with the scene.
- GaussianSplats Gaussian splatting
- A loaded Gaussian splat set, the decoded arrays plus the GPU textures the splat shaders fetch from.
- Geometry Geometry
- Vertex (and optional index) data along with the vertex shader used to transform it.
- GeometryBuilder Geometry
- Assembles a MeshGeometry one vertex and triangle at a time.
- GodRaysSettings Lighting and environment
- Directional volumetric god rays (crepuscular rays / light shafts).
- GpuTextureSource Assets and loading
- Wraps a raw gpu.Texture as a TextureSource, for advanced or interop cases that already own a GPU texture (widget/particle textures, custom pipelines) and do not need Texture2D's image decode and mip generation.
- GradientColor Particles
- A ColorDistribution that samples gradient over the particle's normalized age (color over life).
- GradientSkySource Lighting and environment
- A stylized gradient sky: zenith, horizon, and ground colors with an HDR sun disk.
- HighlightStyle Rendering
-
How the selection outline (around nodes with a
Node.highlightColor) is drawn. Reachable throughScene.highlightStyle. - IcosphereGeometry Geometry
- A geodesic sphere built by subdividing an icosahedron, centered on the origin.
- InstancedMesh Scene graph
- Many copies of one Geometry / Material pair, each placed by its own model transform.
- InstancedMeshComponent Scene graph
- An engine Component that draws an InstancedMesh.
- Lighting Lighting and environment
- The lighting state handed to a Material when it binds for a draw.
- LinearDragModule Particles
-
Damps velocity toward zero with a linear drag coefficient (per second):
each step scales velocity by
max(0, 1 - coefficient * dt). - LineSegmentData Geometry
- Disconnected line segments (point pairs) derived from a mesh, the output of MeshData.extractEdges.
- LineSegmentsGeometry Geometry
- A batch of thick, disconnected line segments, each expanded into a camera-facing quad of a fixed world-space width in the vertex shader and drawn in a single instanced call.
- LodComponent Scene graph
- A MeshComponent that draws one of several level-of-detail variants of an object, chosen each frame from how large the object appears on screen.
- LodLevel Scene graph
-
One level of detail for an LodComponent: a drawable variant shown while
the object's projected on-screen size (see
lodScreenSize) is at least screenSize, a fraction of the viewport height. - Material Materials
- Base class for shading a MeshPrimitive.
- MaterialParameters Materials
- Type-checked, name-addressed parameters for a custom material.
- MaterialsVariantsComponent Materials
-
Switches an imported model between its named material variants
(
KHR_materials_variants). - MemoryModelSource
-
Wraps already-loaded
.glbbytes, for models fetched by the app (a network download, a local cache, generated content). - Mesh Geometry
- Defines the shape and appearance of a 3D model in the scene.
- MeshAttributeData Geometry
-
One named per-vertex attribute stream carried by a MeshData, matching a
custom material's
attributesentry (seeGeometry.setCustomAttribute). - MeshComponent Scene graph
- An engine Component that draws a Mesh.
- MeshData Geometry
- An isolate-transferable snapshot of a mesh's vertex and index data.
- MeshGeometry Geometry
- A triangle mesh built at runtime from vertex attribute arrays.
- MeshParticleEmitterComponent Particles
- An engine component that simulates a ParticleSystem on the CPU and draws each live particle as an instance of a 3D mesh, one instanced draw per geometry.
- MeshPrimitive Geometry
- Represents a single part of a Mesh, containing both Geometry and Material properties.
- MeshTriangle Geometry
- One triangle of a MeshData, yielded by MeshData.triangles.
- Node Scene graph
-
A
Noderepresents a single element in a 3D scene graph. - NodeCamera Scene graph
-
A Camera whose view comes from a node's world transform: the
+Zaxis is the look direction,+Yis up, and the translation is the eye. This is the inverse of the eye/target/up convention PerspectiveCamera builds, so a node placed atinverse(camera.getViewMatrix())yields the same view. - NodeFilter Rendering
- Selects which scene nodes an object-filtered draw includes.
- ParticleBurst Particles
- A one-off (or repeating) burst of particles scheduled at a point in the emitter's run.
- ParticleCurve Particles
-
A scalar curve over normalized time
[0, 1], authored as keyframes and baked once into a lookup table so per-particle, per-frame sample calls are a cheap clamped table lerp rather than a keyframe search. - ParticleEmitterComponent Particles
- An engine component that simulates a ParticleSystem on the CPU and draws its live particles as one instanced batch of camera-facing billboards.
- ParticleKeyframe Particles
-
One control point of a ParticleCurve: a value at normalized time t
(in
[0, 1]). - ParticleModule Particles
- A unit of per-particle behaviour layered onto a system's simulation.
- ParticleStorage Particles
- Structure-of-arrays storage for one emitter's live particles, with an O(1) free pool.
- ParticleSystem Particles
- A self-contained, CPU-driven particle simulation: storage plus the config, shape, spawner, and module stack that fill and advance it.
- PerspectiveCamera Scene graph
- A standard pinhole-style perspective camera.
- PerspectiveProjection Scene graph
- A standard pinhole perspective projection.
- PhysicallyBasedMaterial Materials
- A glTF-style metallic-roughness physically based material with image-based lighting.
- PhysicalSkySource Lighting and environment
- A physically based daylight sky: an analytic single-scattering atmosphere (Rayleigh and Mie terms) with an HDR sun disk, producing plausible day, sunset, and twilight skies from a sun direction.
- PlaneGeometry Geometry
-
A flat rectangular grid in the XZ plane, centered on the origin, with
its surface facing
+Y. - PointEmitterShape Particles
- Emits every particle from the local origin along a single direction.
- PointLight Lighting and environment
- A light that radiates from a single world-space point equally in every direction, its influence falling off with distance.
- PointLightComponent Scene graph
- An engine Component that places a PointLight in the scene.
- PolylineGeometry Geometry
- A thick, camera-facing line through a list of points.
- PolylinePath Geometry
- A path of straight segments connecting a list of points.
- PostEffect Rendering
- A custom, user-authored post-processing effect: a fragment shader that reads the current color and writes a new one.
- PostProcessSettings Rendering
- Built-in post-processing settings for a Scene.
- PreprocessedMaterial Materials
-
A material driven by a
.fmatcustom-material shader and its sidecar metadata (produced at build time bybuildMaterials). - PreprocessedSky Lighting and environment
-
A sky driven by a
.fmatsky shader (sky { vec3 Sky(vec3 direction) }) and its sidecar metadata (produced at build time bybuildMaterials). - RenderPassContext Rendering
- The frame context handed to CustomRenderPass.execute.
- RenderTexture Rendering
-
An offscreen render target a
RenderViewcan render into. - RenderTextureSampling Rendering
- Sampling options used when a material samples a RenderTexture.
- RenderTextureUpdate Rendering
- When a RenderTexture re-renders.
- RenderTextureView
- Displays a live RenderTexture in the widget tree.
- RenderView Rendering
-
One view of a
Scene: a camera plus where and how its image is drawn. - ResourceGroup Assets and loading
- Tracks a set of in-flight resource loads so a scene can wait for all of them before it is shown, and report aggregate progress while they run.
- RibbonGeometry Geometry
- A flat strip of constant width swept along a ScenePath.
- RingGeometry Geometry
-
A flat annulus (a disc with a concentric hole) in the XZ plane,
centered on the origin, facing
+Y. - RotationModule Particles
-
Integrates each particle's in-plane rotation from its angular velocity
(
rotation += angularVelocity * dt). - Scene Scene graph
- Represents a 3D scene, which is a collection of nodes that can be rendered onto the screen.
- SceneAnimationSpec
- Declares the playback state of one of a SceneModel's imported animations.
- SceneMesh
- A declarative mesh node: SceneNode plus a Geometry and Material.
- SceneModel
-
A declarative imported model: loads a
.glband mounts it as a node. - SceneModelSource
- Describes where a SceneModel loads its model bytes from.
- SceneNode
-
A declarative Node: a transform in the scene graph, described in
build(). - SceneNodeController
- The declarative scene layer, widgets that own and reconcile Nodes in a retained Scene. Widgets are immutable descriptions; each widget's state holds the engine object and applies property diffs on rebuild, so an unchanged rebuild writes nothing and structural changes are proportional to what changed.
- SceneNodeHost
- Mounts an app-owned Node subtree inside a declarative tree.
- ScenePath Geometry
- A curve through 3D space, independent of any geometry or rendering.
- ScenePathFrame Geometry
- An oriented coordinate frame at a point along a ScenePath.
- ScenePointer Picking and input
- A programmatic pointer into a scene: a crosshair, a gamepad-driven cursor, a VR laser, or the built-in pointer behind automatic widget input.
- SceneRaycastHit Picking and input
-
A render-geometry intersection from raycastNode (or
Scene.raycast). - SceneRegistry Assets and loading
-
Resolves DataAssets-backed
.fscenebfiles by source path, the.fscenecounterpart ofModelRegistry. - SceneScope
- Exposes the active Scene (and the per-frame elapsed time) to descendants of a SceneView.
- SceneSubtree
- Mounts declarative scene widgets under an app-owned Node.
- SceneView
- A widget that renders a Scene and drives its per-frame repaint.
- ScreenSpaceReflectionsSettings Rendering
- Screen-space reflection settings for a Scene.
- SemanticsComponent Accessibility
-
Exposes the owning
Nodeto assistive technology (screen readers, switch access) as one element of the enclosingSceneView's semantics. - ShaderMaterial Materials
- A Material backed by a caller-supplied fragment shader.
- ShaderSkySource Lighting and environment
- Draws a custom sky from a fragment shader.
- ShadowCascade Lighting and environment
- One cascade of a cascaded shadow map, produced by DirectionalLight.computeCascades.
- SizeOverLifeModule Particles
-
Scales each particle's rendered size by a FloatDistribution sampled over
its normalized age, relative to the size set at spawn (
size = baseSize * scale(age / lifetime)). - Skin Geometry
- A skeletal binding used by skinned meshes for animation.
- SkinnedGeometry Geometry
- Geometry whose vertices use the skinned 80-byte layout: the unskinned attributes followed by 4 joint indices and 4 joint weights.
- Skybox Lighting and environment
- The visible background drawn behind a Scene.
- SkyEnvironment Lighting and environment
-
Drives
Scene.environmentfrom a sky on a refresh policy. - SkySource Lighting and environment
- A source of skybox color as a function of world-space view direction.
- Spawner Particles
- Decides how many particles to emit on each simulation step from a steady rate plus any bursts.
- SphereEmitterShape Particles
- Emits particles from a sphere (or its surface, or a hemisphere), each headed radially outward.
- SphereGeometry Geometry
- A UV sphere centered on the origin.
- SphereVolumeBounds Lighting and environment
- A sphere region.
- SplatComponent Gaussian splatting
- An engine component that draws a GaussianSplats set.
- SplatData Gaussian splatting
- The CPU-side contents of a Gaussian splat set as flat, index-parallel arrays (one entry per splat).
- SpotLight Lighting and environment
- A light that radiates from a world-space point within a cone, combining a PointLight's distance falloff with an angular falloff between an inner and outer cone.
- SpotLightComponent Scene graph
- An engine Component that places a SpotLight in the scene.
- Sprite Geometry
- A single camera-facing textured quad, ready to attach to a Node.
- SpriteMaterial Materials
- A material for camera-facing quads drawn by BillboardGeometry.
- SunLight Lighting and environment
- Aims a scene's directional light at a SunSky's sun, so cast shadows track the sky.
- SunSky Lighting and environment
- A sky that exposes a directional sun, so the engine can drive a matching shadow-casting directional light from it.
- Surface Rendering
- Manages the swapchain color textures a Scene composites onto the Flutter canvas, plus the pools of transient render-graph attachments.
- Texture2D Assets and loading
- A 2D image texture ready to bind to a material's texture slot.
- TextureAtlas Assets and loading
-
A uniform grid texture atlas: one or more equally sized PBR maps packed as
columnsxrowssquare tiles, with an optional gutter of padding texels around each tile so mip sampling does not bleed across tile edges. - TextureSampling Assets and loading
- How a texture is sampled. The defaults are trilinear, anisotropic, and mipmapped, the tasteful default for material textures viewed in 3D.
- TextureSource Assets and loading
-
Something a material can sample: it yields the GPU texture to sample for the
current frame and the sampler to bind it with. Implemented by Texture2D
(a static image) and
RenderTexture(a live, rendered-into texture). - TorusGeometry Geometry
- A torus (ring) lying in the XZ plane, centered on the origin.
- TrailComponent Particles
- An engine component that trails a camera-facing ribbon behind its owning node as the node moves, for missiles, sword slashes, tracers, and debris.
- TransientWriter Rendering
- Destination for per-frame transient GPU data (uniform blocks, instance vertex data). Emplaced data is valid for the current frame only.
- TubeGeometry Geometry
- A round cross-section of constant radius swept along a ScenePath.
- TurbulenceModule Particles
- Advects particles through a curl-noise field, the divergence-free swirl that gives fire, smoke, and drifting embers their turbulent motion.
- UniformColor Particles
- A ColorDistribution that picks a color between a and b per particle from its stored random (constant over the particle's life).
- UniformCurveFloat Particles
- A FloatDistribution whose value follows, per particle, a blend between a min and max curve chosen by the particle's stored random. Each particle keeps its own curve inside the envelope for the whole life.
- UniformFloat Particles
-
A FloatDistribution that picks a value in
[min, max]per particle from its stored random (constant over the particle's life). - UnlitMaterial Materials
- A material that draws geometry with a flat color or texture, ignoring scene lighting.
- UnskinnedGeometry Geometry
-
Geometry whose vertices use the unskinned 48-byte layout: position
(
vec3), normal (vec3), tex coords (vec2), color (vec4). - VignetteSettings Rendering
- Darkens the image toward the edges, after tone mapping.
- WedgeGeometry Geometry
-
A triangular-prism wedge (a ramp), centered on the origin in X and Z
with its base on the
y = 0plane. - WidgetComponent
- A live widget subtree on a scene surface.
- WidgetTexture
- Hosts a live widget subtree and streams its visual output into a WidgetTextureController's texture for sampling inside a scene.
- WidgetTextureController
- Owns the gpu.Texture a WidgetTexture streams its child into.
- WidgetUpdatePolicy
-
When a WidgetTexture (or a
WidgetComponent) re-captures its child.
Enums
- AlphaMode Materials
-
How a PhysicallyBasedMaterial's alpha channel is interpreted,
matching glTF's
alphaMode. - AntiAliasingMode Scene graph
- Anti-aliasing strategy used when rendering a Scene.
- BillboardFacing Geometry
- How a billboard quad orients itself toward the camera.
- DepthOfFieldQuality Rendering
- Depth-of-field quality tiers, trading gather taps and cleanup passes for frame time. See DepthOfField.quality.
- EnvironmentVolumeShape Lighting and environment
- The region shape of an EnvironmentVolumeComponent.
- EquirectImageFormat Assets and loading
- The container of an equirectangular image, detected from its bytes.
- FogMode Lighting and environment
- How fog density grows with distance from the camera.
- GeometryStorage Geometry
- How a MeshGeometry manages its GPU buffers over its lifetime.
- MeshParticleFacing Particles
- How a mesh particle orients itself.
- PolylineCap Geometry
- How a PolylineGeometry finishes its two end points.
- PolylineWidthMode Geometry
- How a PolylineGeometry's width is measured.
- PostInsertion Rendering
- Where in the post-processing chain a PostEffect runs.
- RenderInput Rendering
- An engine geometry buffer a CustomRenderPass can request through CustomRenderPass.inputs. Declaring one makes the engine produce it this frame and exposes it on the RenderPassContext, so a pass can read the scene's geometry (depth, normals, shadows), not just its color. Together they turn the custom-pass API into a general depth/shadow-aware post-process system (contact shadows, custom occlusion, volumetrics, and so on).
- RenderStage Rendering
- A named anchor point in the built-in render pipeline where a CustomRenderPass runs. Ordering within one stage follows the order the passes were added.
- RibbonAlignment Geometry
- How a RibbonGeometry orients its strip across the path.
- ShadowCasterFaces Lighting and environment
- Which faces of a shadow caster are rendered into the shadow map (the others are culled). Trades the two shadow-map failure modes (self-shadow acne vs peter-panning) against each other.
- SkyEnvironmentRefresh Lighting and environment
- When a SkyEnvironment re-bakes the sky into the scene's lighting.
- SpecularAmbientOcclusionMode Rendering
- How AmbientOcclusionSettings occludes indirect specular reflections.
- SplatColorSpace Gaussian splatting
- How a splat file's colors relate to the renderer's linear HDR pipeline.
- SplatCropMode Gaussian splatting
-
How a crop box filters the splats of a
SplatComponent. - SplatFormat Gaussian splatting
- The splat file formats the runtime loader understands.
- SpriteBlendMode Materials
- Selects how a sprite's color is blended into the scene.
- SsrDebugView Rendering
- A diagnostic visualization for ScreenSpaceReflectionsSettings.debugView.
- TextureContent Assets and loading
- What a texture's pixels represent, which controls how mip levels are downsampled so the result is correct (color must average in linear light, normals must be averaged as vectors and renormalized).
- ToneMappingMode Rendering
- Tone mapping operator applied when resolving the linear HDR scene color to the display-referred image (see Scene.toneMapping).
- UnweldAttribute Geometry
- The canned per-triangle attributes MeshData.unweld can attach to its output, under the names custom materials read them by.
- WidgetInput
- How a WidgetComponent receives pointer input.
Mixins
- SceneGraph Scene graph
-
Defines a common interface for managing a scene graph, allowing the addition and removal of
Nodes.
Extensions
- QuaternionSlerp on Quaternion Scene graph
-
Spherical interpolation helpers on
Quaternion. - Vector3Lerp on Vector3 Scene graph
-
Per-component arithmetic helpers on
Vector3.
Constants
- kDiffuseShCoefficientCount → const int Lighting and environment
- Number of L2 spherical-harmonic coefficients used for diffuse irradiance (bands 0..2).
- kRenderLayerAll → const int Rendering
- A layer mask that selects every layer (the default render-view mask).
- kRenderLayerDefault → const int Rendering
- The default layer a Node occupies (bit 0).
Properties
- baseShaderLibrary → ShaderLibrary Assets and loading
-
The shader bundle shipped with
flutter_scene.no setter
Functions
-
blendEnvironmentVolumes(
EnvironmentSettings base, List< Lighting and environmentEnvironmentVolume> volumes, Vector3 cameraPosition) → EnvironmentSettings -
Blends
volumesoverbasefor a camera atcameraPosition. A thin wrapper overblendEnvironmentContributionsfor the manual volume API. -
decodeEquirectHdrImage(
Uint8List bytes, {int? maxWidth}) → DecodedHdr? Assets and loading -
Decodes a high-dynamic-range equirectangular image (EquirectImageFormat.radianceHdr
or EquirectImageFormat.openExr) from
bytesto linear float pixels, or returns null for a low-dynamic-range image (the caller decodes those with the platform image codec as sRGB). -
decodeOpenExr(
Uint8List bytes, {int? maxWidth}) → DecodedHdr Assets and loading -
Decodes an OpenEXR image from
bytesto linear RGBA float pixels (alpha 1), row-major, row 0 at the top (the equirect up pole). -
decodeRadianceHdr(
Uint8List bytes, {int? maxWidth}) → DecodedHdr Assets and loading -
Decodes a Radiance
.hdr/.picRGBE image frombytes. -
detectEquirectImageFormat(
Uint8List bytes) → EquirectImageFormat Assets and loading -
Detects the EquirectImageFormat of
bytesfrom its magic number. -
environmentAssetPathOf(
EnvironmentMap environment) → String? Lighting and environment -
The radiance asset path
environmentwas loaded from through EnvironmentMap.fromEquirectImageAsset (or the deprecatedfromAssets), or null for environments built another way. -
generateSolidColorAtlasPixels(
{required List< Assets and loadingVector4> tileColors, required int columns, required int tileSize, int padding = 0}) → Uint8List -
Builds RGBA8888 pixels (row-major, top-left origin) for a placeholder grid
atlas laid out to match a TextureAtlas with the same
columns,tileSize, andpadding. Each tile's whole cell (content plus padding gutter) is filled with its solid color fromtileColors((r, g, b, a)in[0, 1]), so a tile never bleeds into its neighbor. Cells pasttileColors.lengthare left transparent. -
gpuTextureFromAsset(
String assetPath) → Future< Assets and loadingTexture> -
Loads an image from the asset bundle at
assetPathand uploads it as a Flutter GPU texture. -
gpuTextureFromImage(
Image image) → Future< Assets and loadingTexture> -
Uploads a decoded
dart:uiui.Image to a Flutter GPU texture. -
imageFromAsset(
String assetPath, {AssetBundle? bundle}) → Future< Assets and loadingImage> -
Loads and decodes an image from the asset bundle at
assetPath. -
imageFromBytes(
Uint8List bytes, {int? maxWidth}) → Future< Assets and loadingImage> -
Decodes an encoded image (PNG, JPEG, etc.) from raw
bytes. -
loadBaseShaderLibrary(
) → Future< Assets and loadingvoid> - Asynchronously loads and caches the base shader bundle. Idempotent. Called by Scene.initializeStaticResources so the synchronous baseShaderLibrary getter has a cached library to return (shader assets can't be read synchronously on any backend).
-
loadFmatMaterial(
String sourcePath, {String? package, String? bundleName, AssetBundle? bundle}) → Future< MaterialsPreprocessedMaterial> -
loadFmatSky(
String sourcePath, {String? package, String? bundleName, AssetBundle? bundle}) → Future< MaterialsPreprocessedSky> -
Loads a DataAssets-backed
.fmatsky by its source path relative to the owning package's root (for exampleassets/gradient_sky.fmat). -
loadScene(
String sourcePath, {String? package, AssetBundle? bundle, FsceneComponentRegistry? registry, SceneReloadCallback? onReload, Scene? applyStageTo}) → Future< Node> -
Loads a DataAssets-backed
.fscenebscene by its source path relative to the owning package's root (for exampleassets/levels/forest.glb). -
loadSceneSubtree(
Node node, {String? package, AssetBundle? bundle, FsceneComponentRegistry? registry}) → Future< Assets and loadingvoid> -
Streams a lazy placeholder
node's prefab content under it, resolving the referenced prefab by its source path (the registry-aware counterpart ofloadSubtreefor scenes loaded with loadScene). -
loadTexture(
String sourcePath, {String? package, AssetBundle? bundle, TextureSampling? sampling}) → Future< Assets and loadingTextureSource> -
Loads a cooked compressed texture by its source path relative to the owning
package's root (for example
assets/shadow_plane.png), ready to assign to a material texture slot. -
prefilterEquirectRadiance(
Texture sourceEquirect, {bool sourceIsLinear = false, bool mipLayout = false}) → Texture Lighting and environment - Prefilters an equirectangular radiance texture for image-based specular lighting.
-
raycastNode(
Node root, Ray ray, {double maxDistance = double.infinity, int layerMask = 0xFFFFFFFF, bool where(Node node)?, bool includeInvisible = false}) → SceneRaycastHit? Picking and input -
Casts
ray(direction need not be normalized) throughroot's subtree and returns the nearest hit, or null. -
raycastNodeAll(
Node root, Ray ray, {double maxDistance = double.infinity, int layerMask = 0xFFFFFFFF, bool where(Node node)?, bool includeInvisible = false}) → List< Picking and inputSceneRaycastHit> -
Casts
raythroughroot's subtree and returns every hit, sorted nearest-first. Parameters as in raycastNode.
Typedefs
-
GltfResourceResolver
= Future<
Uint8List> Function(String uri) Assets and loading -
Resolves an external resource referenced by a multi-file glTF
document (a
.binbuffer or an image file). - SceneCameraBuilder = Camera Function(Duration elapsed)
-
Builds a Camera for the current frame from the
elapsedtime since the view started ticking. Use this for time-based cameras (for example an orbiting view); pass a fixed SceneView.camera instead when the camera does not change over time. - SceneLoadingBuilder = Widget Function(BuildContext context, double progress)
-
Builds the widget shown while a SceneView waits for its resources to load,
given the current load
progress(0 to 1). See SceneView.loadingBuilder. - SceneReloadCallback = void Function(Node root) Assets and loading
-
Called after a hot-reloaded scene has been patched in place (see
loadScene), so the app can re-apply per-instance customizations the
patch may have discarded: re-apply a custom material, or re-grab inner
nodes by name.
rootis the same root instance the app holds. - SceneTickCallback = void Function(Duration elapsed, double deltaSeconds)
-
Called once per frame with the total
elapsedtime and thedeltaSecondssince the previous tick. Drive per-frame app logic here, or advance the scene with a supplied timestep via Scene.update (after which Scene.render skips its implicit wall-clock tick for that frame).
Exceptions / Errors
- ExrFormatException Assets and loading
- Thrown when decodeOpenExr cannot parse the bytes as an OpenEXR image.
- HdrFormatException Assets and loading
-
Thrown when decodeRadianceHdr cannot parse
bytesas a supported Radiance HDR image.