viewport3d

command
v0.1.48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Example: gogpu/ui — Viewport3D Demo

Demonstrates the Viewport3D widget which provides a GPU-rendered viewport for 3D content, video, or custom shader output. The widget follows the Flutter Texture pattern: it owns an offscreen GPU texture that an external renderer draws into, and the Layer Tree compositor blits it to the surface.

This example shows Viewport3D integration into a standard widget layout. The OnRender callback receives a gpucontext.TextureView for GPU rendering. In production, a 3D engine (e.g., gogpu/g3d) would render into this texture.

Architecture:

Viewport3D widget → offscreen GPU texture → Layer Tree → surface blit

Rendering: event-driven (default since gogpu v0.43.0). 0% CPU when idle. The viewport re-renders only when explicitly invalidated or when Continuous(true) is set for real-time content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL