Scene class base

Represents a 3D scene, which is a collection of nodes that can be rendered onto the screen.

Scene manages the scene graph and handles rendering operations. It contains a root Node that serves as the entry point for all nodes in this Scene, and it provides methods for adding and removing nodes from the scene graph.

Implemented types

Constructors

Scene()

Properties

antiAliasingMode AntiAliasingMode
The anti-aliasing strategy used when rendering this Scene.
getter/setter pair
directionalLight DirectionalLight?
Optional analytic directional light (e.g. a sun) layered on top of the image-based lighting. Null (the default) means IBL only.
getter/setter pair
environment EnvironmentMap?
The image-based-lighting environment, or null to use the engine's default (the built-in procedural EnvironmentMap.studio, built lazily on first render).
getter/setter pair
environmentIntensity double
Scalar multiplier applied to environment's contribution. 1.0 (the default) is neutral.
getter/setter pair
environmentTransform ↔ Matrix3
Rotation applied to the image-based-lighting environment when it is sampled. Identity (the default) leaves the environment unrotated.
getter/setter pair
exposure double
Linear exposure multiplier applied to the HDR scene color before tone mapping. 1.0 (the default) is neutral; see physicalCameraExposure to derive a value from camera settings.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
renderScene → RenderScene
The flat list of drawable items the render passes iterate.
final
root Node
The root Node of the scene graph.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
surface Surface
Handles the creation and management of render targets for this Scene.
final
toneMapping ToneMappingMode
Tone mapping operator used when resolving the HDR scene color to the display image. Defaults to ToneMappingMode.pbrNeutral.
getter/setter pair

Methods

add(Node child) → void
Add a child node.
override
addAll(Iterable<Node> children) → void
Add a list of child nodes.
override
addMesh(Mesh mesh) → void
Add a mesh as a child node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(Node child) → void
Remove a child node.
override
removeAll() → void
Remove all children nodes.
override
render(Camera camera, Canvas canvas, {Rect? viewport, double? pixelRatio}) → void
Renders the current state of this Scene onto the given ui.Canvas using the specified Camera.
toString() String
A string representation of this object.
inherited
update(double deltaSeconds) → void
Advances the scene by deltaSeconds: ticks every node's components and animation players, and refreshes the flat render layer.

Operators

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

Static Methods

initializeStaticResources() Future<void>
Prepares the rendering resources, such as textures and shaders, that are used to display models in this Scene.
physicalCameraExposure({required double aperture, required double shutterSpeed, required double iso}) double
Computes the linear exposure multiplier for a physical pinhole camera, the way photographers reason about it: aperture (f-stops), shutterSpeed (seconds), and sensor iso.