Skip to content

feat(zoom): drive the 3D tilt from cursor motion - #685

Closed
EtienneLescot wants to merge 3 commits into
mainfrom
feat/3d-tilt-parallax
Closed

EtienneLescot wants to merge 3 commits into
mainfrom
feat/3d-tilt-parallax

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Dynamic rotation: the tilted screen follows cursor motion, on all presets (parallax).

Chantier 3D, PR 1. Spec complète et branche d intégration : #682.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added cursor-responsive parallax for 3D zoom presets, creating a more natural screen-tilt effect as the cursor moves.
    • Improved transitions between 3D zoom presets to keep tilt behavior stable and predictable.
  • Improvements
    • Screen privacy masks and cursor positioning now remain aligned with tilted content.
    • Unified screen-tilt projection behavior across supported platforms.
  • Tests
    • Added coverage for cursor-driven tilt, transitions, projection alignment, and rendering behavior.

The field was removed from openscreen-compositor, so poc-d3d no longer compiled on main and bench --scene could not run.
The iso/left/right presets no longer hold a frozen angle: the plane leans
into the cursor gesture and settles back to the preset at rest. This
deliberately changes the rendering of existing projects that use a preset
and have a cursor track with the cursor shown.

- regions::dynamic_tilt(t, track, cut, strength): velocity from a centred
  difference on the smoothed follow track (no per-frame state), in visible
  crops per second, soft-saturated into DYNAMIC_TILT_BUDGET (X 1.9, Y 3,
  Z 0 degrees) through clamp_dynamic_tilt, gated by
  smoothstep(0.85, 1, strength). Called once from plan_frame.
- rotated_quad_corners_px(w, h, base, dyn): the contain scale comes from
  the base rotation only; the dynamic part only reprojects the corners.
- FrameGeometry::screen_tilt is the single path for the screen, its
  shadow (three backends), the cursor and the privacy mask.
- Parallax is off while the cursor is hidden, because export only loads
  the track when the cursor is shown.
- crates/fixture/scene-tilt.json: a rotation scene for poc-d3d --scene.
- tests/tilt_parallax_render.rs: env-gated D3D11 render of the lean.

No shader, LayerCB, schema or UI change.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2e262bac-e010-45c9-924c-ae543cd35d63

📥 Commits

Reviewing files that changed from the base of the PR and between 0834a66 and 2889fbb.

📒 Files selected for processing (8)
  • crates/compositor/src/compositor_linux.rs
  • crates/compositor/src/compositor_macos.rs
  • crates/compositor/src/compositor_windows.rs
  • crates/compositor/src/frame_geometry.rs
  • crates/compositor/src/regions.rs
  • crates/compositor/tests/tilt_parallax_render.rs
  • crates/fixture/scene-tilt.json
  • crates/poc-d3d/src/bench.rs
💤 Files with no reviewable changes (1)
  • crates/poc-d3d/src/bench.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Dynamic tilt and parallax

Layer / File(s) Summary
Tilt state and projection
crates/compositor/src/regions.rs
ZoomState and quad projection now support dynamic rotation, transition gating, bounded cursor parallax, and expanded geometry tests.
Frame geometry propagation
crates/compositor/src/frame_geometry.rs
plan_frame derives dynamic tilt from visible cursor motion. Screen, cursor, and privacy-mask projections use the shared screen_tilt method.
Backend rendering integration
crates/compositor/src/compositor_linux.rs, crates/compositor/src/compositor_macos.rs, crates/compositor/src/compositor_windows.rs
All three compositor backends use shared tilt geometry. Windows passes dynamic rotation to fallback projection.
Rendered tilt validation
crates/compositor/tests/tilt_parallax_render.rs, crates/fixture/scene-tilt.json
A Windows integration test measures plane movement during cursor gestures. A fixture defines 3D zoom regions and rendering settings.

Benchmark initializer cleanup

Layer / File(s) Summary
Benchmark clip-source updates
crates/poc-d3d/src/bench.rs
Two benchmark initializers no longer set hold_sec.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CursorTrack
  participant FrameGeometry
  participant Compositor
  participant Renderer
  CursorTrack->>FrameGeometry: provide cursor motion
  FrameGeometry->>FrameGeometry: compute dynamic tilt
  Compositor->>FrameGeometry: request screen_tilt(s_px)
  FrameGeometry-->>Compositor: return projected quad
  Compositor->>Renderer: draw tilted screen and aligned overlays
Loading

Suggested reviewers: beetix

Merge Risk: ⚪ Minimal · up to 2889f

No concrete behavior or production risk remains that should block merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description states the main feature and references the related work, but it omits most required template sections, including issue status, change type, release impact, desktop impact, screenshots … Complete the template. Add the related issue status, select the change type, release impact, and desktop impact, provide screenshots or video for the visual change, and document the testing performed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: cursor-driven 3D tilt for zoom presets.
Docstring Coverage ✅ Passed Docstring coverage is 90.57% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 6 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description states the main feature and references the related work, but it omits most required template sections, including issue status, change type, release impact, desktop impact, screenshots or video, and testing details.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.0)

Clippy execution failed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

Intégrée dans integration/chantier-3d (#682) avec ses corrections de revue CodeRabbit ; le chantier avance désormais dans cette seule PR.

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