Skip to content

Live edits: what is not the scene's no longer rebuilds it (lens, exposure, fog, background, preset) - #124

Merged
yujiaxu-ops merged 3 commits into
mainfrom
scene-inplace
Nov 16, 2026
Merged

yujiaxu-ops merged 3 commits into
mainfrom
scene-inplace

Conversation

@yujiaxu-ops

@yujiaxu-ops yujiaxu-ops commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

One flag, Changes::structural, sends an edit to a rebuild of the whole GPU scene (0.5 to 0.9 s on a large one). It was set for things no part of the scene is built from. These are applied in place now:

edit where it is applied
the scene camera's field of view the view takes it, as it takes a camera's move
its depth of field the post pass (the view stays where it is)
its exposure, mode included the post passes and the kernel's firefly clamp
which camera is the scene's the three above
fog appearing, turning volumetric, going the kernel's variant with it
a background appearing or going the kernel's variant with it
the preset, its overrides, the scene's name the few parameters taken from them

No change at all any more: a camera's near and far (read by nothing), a camera that is not the scene's, an offline render's size and clock.

Still a rebuild: another sky, and everything about geometry. A view still cannot be resized.

Measured

  • Bistro, the lens changed twice while it runs: main rebuilds for 884 and 724 ms; here the frames are as any other (15 to 17 ms).
  • Kabukichō's hitch bench (lights, mood, rain, viewpoint): as main's (p99 17.5 / 17.7 ms, no spike); those events were in place already.

Tests

  • New GPU test live::inplace_tests: twelve such edits and a camera switch, taken in place on one view, each held to a view built from the edited world: no rebuild, the kernel's parameters the same whole, the same kernel variant and post settings, the same picture; and a view moved away from the scene's camera stays there through a depth of field or an exposure.
  • New unit tests on the world's change record.
  • 161 unit and 239 render tests pass. render-identity against main: 219 byte-identical, 19 within spread, 1 by 1.7e-6 (a test with two states a float's last place apart). The kernel is untouched. THREERT_FEATURES (a profiling mask) now masks the aerial perspective as it masks fog.

Found by the new test:

  • The emitter cull's view cone is made from the lens, and was made again only when the camera moved 15 m or turned 15 degrees: a lens changed in place kept the old cone. It follows the lens now (and the view's shape).
  • After an edit to the light (fog gone) the radiance cache and the frames' histories keep the old light for hundreds of frames, here as after a rebuild. The test compares with the histories cleared. Not changed here.

Cleaned up on the way

  • The kernel's features from the environment (fog, a background, aerial perspective) are one function (gpu::environment_features, through Tables::features); they were computed at three call sites, the background's among the structural ones.
  • A description had changed when its Debug text had: Exposure, Dof, Sky derive PartialEq.

First step of the scene / edit model. The sky and the output's size are separate PRs: they replace GPU resources (the environment map, the screen-sized buffers), where this one only writes parameters.

🤖 Generated with Claude Code

yujiaxu-ops and others added 2 commits November 16, 2026 18:16
… and the preset in place

Each rebuilt the whole scene. None is the scene's: a lens is the view's, an
exposure the post passes' and the firefly clamp's, fog's shape and a
background are kernel features (another variant), the preset a few
parameters. An offline render's size and clock are no change to a live view.

A GPU test holds each edit, taken in place, to a view built from the edited
world: no rebuild, the same state, the same picture.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…compared by equality, the cull's cone follows the lens

- The background's feature bit was patched into the scene's structural
  features from the commit; fog's and the aerial perspective's were computed
  at three call sites. One function now (gpu::environment_features), reached
  through Tables::features.
- A description had changed when its Debug text had. Exposure, Dof and Sky
  derive PartialEq.
- The scene's camera is looked up in one place (World::scene_camera); the
  exposure is applied once a commit.
- The in-place test compares the kernel's parameters whole with a build's.
  It found the emitter cull's view cone stale after a lens change (made
  again only when the camera moved or turned): it follows the lens now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@yujiaxu-ops
yujiaxu-ops merged commit 7b36fe6 into main Nov 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant