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
+3 -16
View File
@@ -108,7 +108,6 @@ impl RenderData {
pending: HashMap::new(),
};
data.create_rows("signals".into(), 1, 32, "f32".into())?;
data.write_signal(5, 1.0);
Ok(data)
}
@@ -321,25 +320,13 @@ impl RenderData {
}
}
pub fn render_pending(&self) -> bool {
self.signal(4) == 0.0 && self.signal(5) != 0.0 && self.signal(6) == 0.0
}
pub fn begin_render(&mut self) -> bool {
if !self.render_pending() {
return false;
}
self.write_signal(5, 0.0);
true
}
pub fn mark_dirty(&mut self) {
self.write_signal(5, 1.0);
pub fn render_allowed(&self) -> bool {
// Lane 5 (legacy dirty flag) no longer gates continuous rendering.
self.signal(4) == 0.0 && self.signal(6) == 0.0
}
pub fn loadout_ready(&mut self) {
self.write_signal(6, 0.0);
self.mark_dirty();
}
fn signal(&self, index: usize) -> f32 {