Render continuously and optimize the glTF viewer

Remove vsync and dirty-flag frame gating, optimize PBR sampling and lighting, add a direct-to-canvas loadout, and preserve camera state on viewer resize.

Add regression coverage and update rendering documentation.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0b382-1e79-712b-abd1-d29201c9bb5e
Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
Amp
2026-09-18 08:58:27 +00:00
co-authored by heaust
parent bc957cf40d
commit 4784ad7e87
16 changed files with 573 additions and 178 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ const scene = new Scene(canvas, { hdr: true, fps: 60 });
await scene.ready;
```
Omit `fps` to render as soon as shared data changes. `Scene` initializes conventional SOA rows and loads one clustered-forward HDR render graph. The core itself still starts with only its eight-float `signals` row.
Omit `fps` for continuous, uncapped rendering. `Scene` initializes conventional SOA rows and loads one clustered-forward HDR render graph. The core itself still starts with only its eight-float `signals` row.
For a standalone viewer, `new Scene(canvas, { hdr: true, directToCanvas: true })` can fuse tone mapping into opaque or alpha-masked PBR draws, avoiding the HDR texture and separate presentation pass. It automatically retains the HDR path for blended/transmissive materials, post-processing, custom shaders or compute, and basic geometry without normals/UVs. Leave this option off when consuming the default HDR graph in a graph editor.
PBR shaders reuse packed occlusion/roughness/metallic samples when texture and UV transforms match. Point, spot, and directional light handles select shader variants when the first light of a type is created or the last is disposed; intensity, transform, and radius changes remain shared-memory writes. Custom compute passes retain all light types because they can author light rows themselves.
## 3. Add a triangle