Renderer3D class final

Forward renderer for Render3DScenes: physically based lighting from a sun (with two cascades of shadow maps), up to 8 point/spot lights and a hemisphere ambient; skinned meshes; a gradient sky; HDR with 4x MSAA and ACES tonemapping where the device can.

The passes live in parts of this library: the draw lists (draw_lists.dart), the shadow pass (shadow_pass.dart), joint palettes (joint_palettes.dart), uniform blocks (frame_uniforms.dart), bloom, tonemapping and FXAA (post_process_3d.dart) and an editor's lines (editor_lines.dart).

Properties

bloom → BloomSettings
Glow around bright things.
final
clipPlane ↔ (double, double, double, double)?
A slice through the scene: nothing on the far side of the plane — (normal x, y, z, distance along it) — is drawn. Null for none.
getter/setter pair
defaults → DefaultTextures
Stand-ins for missing material maps.
final
device → GpuDevice
The device it draws with.
final
framesInFlight → int
Frames render submitted that the GPU has not finished.
no setter
fxaa ↔ bool
Smooths edges after tonemapping (HDR only): for devices that draw without MSAA (msaa off, or not supported).
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isBusy → bool
Whether maxFramesInFlight frames are on the GPU: draw again once one finishes (show the last image meanwhile). render itself never refuses.
no setter
maxFramesInFlight ↔ int
How many frames may be submitted and not yet finished by the GPU before isBusy: a caller drawing every vsync skips a frame while it is, so a GPU that falls behind doesn't queue frames (each holding a surface texture and its frame data) without end.
getter/setter pair
msaa ↔ bool
Whether to multisample (when the device can).
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shadows → ShadowSettings
The sun's shadows.
final
skinning ↔ SkinningMode
How joint palettes reach the GPU: a texture where the device can read float textures in the vertex stage, else uniform blocks.
getter/setter pair
stats → Render3DStats
What the last render did.
final
targets → RenderTargetPool
Intermediate targets, reused frame to frame.
final
uploader → ModelUploader
Uploads models for this renderer.
final
viewMode ↔ Render3DViewMode
How the scene is drawn: lit, as the game draws it; unlit, to read shapes by; or as edges only (an editor's views).
getter/setter pair
wireColor ↔ (double, double, double, double)
The colour Render3DViewMode.wireframe draws edges in.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(Render3DScene scene, Render3DView view, GpuSurface surface, {int? frame}) → Future<bool>
Draws scene seen from view into a new frame of surface and presents it. Completes when the GPU has finished.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

create(GpuDevice device) → Future<Renderer3D>
Creates a renderer on device, loading and creating every pipeline up front.
tryCreate({GpuDevice? device, void onUnsupported(String reason)?}) → Future<Renderer3D?>
A renderer on device, or on this platform's GPU when that is null — or null, after telling onUnsupported why, where there is no Flutter GPU (see createGpuDevice) or the renderer fails to start.

Constants

jointsPerRow → const int
Joints per row of the joint texture (three texels each).