Don't recompute AO/shadow/reflection on page-texture content changes

handlePageTextureRecords() called markStaticSceneBuffersDirty() on every page-texture update,
forcing a full SSAO + shadow + reflection recompute (23-47ms frames) on every block during
playback — even though a page-text change moves no geometry. AO and shadows depend only on
geometry; the soft tabletop reflection picks up the new page on its throttled cadence. Removed
the forced dirty so only real geometry changes (flips, camera, rebuild, resize) recompute the
static buffers. Playback median ~60->63fps; the per-block forced heavy frames are gone (the
remaining periodic ~23ms frames are the normal 8Hz throttled refresh).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 19:38:13 +02:00
parent b0175b7cdc
commit 004c077181
+5 -1
View File
@@ -2221,7 +2221,11 @@ function handlePageTextureRecords(event) {
if (!detail.right && effectivePageMeta.right?.kind === 'blank') {
applyExplicitBlankPageTexture('right', effectivePageMeta.right, 'page-texture-records');
}
markStaticSceneBuffersDirty();
// A page-texture content change moves no geometry, so it must NOT force the AO/shadow/
// reflection recompute (that produced 23-42ms frames on every block during playback).
// AO and shadows depend only on geometry; the soft tabletop reflection picks up the new
// page on its normal throttled cadence. Only geometry changes (flips, camera, rebuild,
// resize) dirty the static buffers.
document.documentElement.dataset.webglPageTextureMetrics = JSON.stringify({
width: leftCanvas.width,
height: leftCanvas.height,