TextureGaussianRenderer class
Renders Gaussian splats into an in‑memory FlutterAngleTexture
.
This class encapsulates the full WebGL / ANGLE pipeline required by Gaussian Splatting. Life‑cycle:
final renderer = TextureGaussianRenderer();
await renderer.initialize();
await renderer.setupTexture(width: 800, height: 600, vertexShaderCode: vs,
fragmentShaderCode: fs);
renderer.createAndSetDefaultCamera();
renderer.setSplatData(myBinarySplatBuffer);
renderer.startRenderLoop();
// drive [frame] from a SchedulerBinding / Ticker.
All public APIs are @mustCallSuper
lifecycle‑aware.
Constructors
Properties
- camera ↔ GaussianCamera?
-
The currently active GaussianCamera, or
null
if not set.getter/setter pair - currentSize → Size?
-
Current viewport size that the renderer is configured for.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- renderStats → RenderStats
-
Latest frame statistics with detailed performance profiling.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- targetTexture → FlutterAngleTexture
-
The texture that can be composed into UI using
FlutterAngleTexture
widget helpers.no setter
Methods
-
disableBackground(
) → void - Disables the background.
-
dispose(
) → void - Disposes all resources. The instance must not be used afterwards.
-
enableBackgroundFromAsset(
String assetPath) → Future< void> - Enables the background using an asset image.
-
frame(
) → Future< void> -
Drives a single frame. Call from a
Ticker
/SchedulerBinding
. -
initialize(
{bool debug = true}) → Future< void> - Initializes ANGLE and the depth‑sorter. Must be called before any other method.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resize(
GaussianCamera camera) → Future< bool> - Resizes the render target. If a camera is set, its intrinsics are updated to preserve the current field‑of‑view.
-
setBackgroundRotation(
double yawDegrees, double pitchDegrees) → void - Sets the background rotation in degrees.
-
setSplatData(
Uint8List data) → void - Supplies raw splat data (32 bytes per splat) and rebuilds the GPU texture. Throws ArgumentError if the buffer length is not a multiple of 32.
-
setupTexture(
{required double width, required double height, required String vertexShaderCode, required String fragmentShaderCode, bool enableProfiling = false}) → Future< void> - Creates a texture and compiles the shaders. Safe to call multiple times – resources are recreated if needed.
-
startRenderLoop(
) → void - Starts the internal render loop. Idempotent.
-
stopRenderLoop(
) → void - Stops the internal render loop. Idempotent.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited