Skip to content

feat(camera): camera-handoff blend prototype (cam_blend)#350

Draft
noctonca wants to merge 2 commits into
mainfrom
feat/camera-blend
Draft

feat(camera): camera-handoff blend prototype (cam_blend)#350
noctonca wants to merge 2 commits into
mainfrom
feat/camera-blend

Conversation

@noctonca

@noctonca noctonca commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Prototype for smoothing the camera jump cuts, with the full design in
docs/CAMERA_BLEND_DESIGN.md.

The problem

LBA2's exterior camera is driven by several controllers (dynamic follow,
scripted zone cameras that pull back for a scenic view, cutscenes, manual
recenter) that each grab the camera by hard-writing its globals. Every handoff
is an instant jump cut: entering a scenic zone cuts, leaving it cuts back, and
Center camera snaps.

Phase A (this PR)

A blend layer at the single camera commit point (before AffScene) watches the
committed camera params. When they jump beyond a threshold (a handoff), it
presents an interpolation from the previous frame's camera toward the new target
over cam_blend_dur frames: RegleTrois for position and distance, shortest-arc
for the angles, weight-blended toward the live target so a moving dynamic follow
converges cleanly rather than aiming at a stale point.

  • Catches the in-scene zone-in, zone-out, and manual-recenter handoffs with one
    integration point and no changes to the controllers.
  • Scene transitions (NumCube change, plus an 8-frame settle) and cutscenes
    (CinemaMode) are cut, not blended. Classic camera and interiors untouched.
  • cam_blend (default on) / cam_blend_dur cvars, persisted to cfg.
  • Verified inert with no handoff (byte-stable against a no-blend capture within
    the scene's animation-noise floor); the blend feel needs interactive testing
    (walk into a scenic camera zone).

Known rough edges (see the design doc)

This is a prototype. Divergence detection is a heuristic (a very fast legitimate
move could trip it; a tiny zone offset could miss it), the blend presents the
parametric camera without the per-frame occlusion lift (pops in at blend end),
and interpolation is linear (ease-in-out is a feel refinement). Instrumenting the
handoff sites directly and per-zone opt-out are the natural next steps.

Not in this PR

Phase B (a fully free dynamic camera: hold angle, re-center only on interior to
exterior + manual) and interior-to-exterior blending are separate, described in
the design doc.

How to test

Enable the Auto camera, walk into an area with a scripted scenic camera, and
watch the transition in and out. cam_blend 0 for the old jump cut; cam_blend_dur
to tune the length (frames).

noctonca added 2 commits July 2, 2026 21:40
Deep-think on smoothing the hard cuts between camera controllers (dynamic
follow, scripted zone cameras, cutscenes, manual recenter, scene transitions)
and on a free dynamic camera. Covers the controller taxonomy, a blend layer that
interpolates the presented camera params on a handoff, the weight-blend needed
for a moving (dynamic) target, selective blending, and the open decisions.
Phase A of docs/CAMERA_BLEND_DESIGN.md: smooth the jump cuts when the exterior
camera hands off between controllers (dynamic follow <-> scripted zone camera,
and manual recenter). A single step at the camera commit point (before AffScene)
watches the committed camera params; when they jump beyond a threshold it
presents an interpolation from the previous frame's camera toward the new target
over cam_blend_dur frames (RegleTrois for position/distance, shortest-arc for
the angles), weight-blending toward the live target so a moving dynamic follow
converges cleanly. Scene transitions (NumCube change, plus an 8-frame settle) and
cutscenes (CinemaMode) are cut, not blended; classic camera and interiors are
untouched.

Divergence-triggered so it needs no changes to the controllers, at the cost of
the heuristic rough edges noted in the design doc. cvars cam_blend (default on)
and cam_blend_dur, persisted to cfg. Verified inert with no handoff (byte-stable
against a no-blend capture within the scene noise floor).
@noctonca noctonca marked this pull request as draft July 4, 2026 13:19
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