[PR #3089] [MERGED] render: draw from a ViewSet of per-eye views (VR groundwork) #4797

Closed
opened 2026-11-03 05:08:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3089
Author: @Expected333
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: vr/view-set


📝 Commits (3)

  • c9a8361 render: draw from a ViewSet of per-eye views (VR groundwork)
  • cd1d9ba Merge origin/main into vr/view-set
  • c487bbc Merge origin/main into vr/view-set

📊 Changes

2 files changed (+152 additions, -14 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+19 -14)
➕ crates/horizon-client-render/src/gfx/view.rs (+133 -0)

📄 Description

🤖 Opened by Expected333's AI agent (Claude), not by Expected333 themself.

Groundwork for VR: the renderer draws from a ViewSet instead of reading yaw, pitch and fov_degrees straight off Frame. No visible change (label wanted: skip-release; I can't set labels from a fork).

What changes

  • New gfx/view.rs:
    • View is one eye's view of the camera-relative world: view (rotation), projection (reversed-Z), aspect and tan_half_fov.
    • View::screen(yaw, pitch, fov, aspect, far) builds the flat-screen view.
    • ViewSet holds the views of a frame (one today, two on a headset) and the view used for culling.
  • Renderer::views(frame) replaces view_projection and the private projection. camera_frustum goes through the same View.
  • draw_frame reads the following from the primary view: view_proj, inverse_view, and misc.z / misc.w.
  • The frustum and the back-face eye (projection_center) come from ViewSet::cull().

Why it is bit-exact

The products keep their order: projection * (bob * spin) * rotation, evaluated left to right as before. aspect and tan(fov/2) are computed with the same expressions.

the_screen_view_matches_the_legacy_projection_bit_for_bit compares to_bits() of the old and new matrices over several FOVs, orientations, aspects, far planes and poses.

native_post and pack_uniforms keep their own projections for now. Their association, (P * bob) * spin, and the GL projection differ, so they move when a second view needs them.

Self-check

pr_ready (tools/pr_ready.py --quick on 3e81d266317b, against origin/main at 56f968e11, 5 min 18 s)

Check Result
Scope ✅ 2 files, +152 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 398 passed (29 s)
rustfmt ✅ (6 s)
clippy ✅ (2 min 4 s)
tests: horizon-client ✅ 1263 passed (2 min 36 s)
doc tests ✅ 0 passed (2 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

Not run here: the harnesses and an in-game render. There is no vanilla data in .local/ on this machine.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3089 **Author:** [@Expected333](https://github.com/Expected333) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `vr/view-set` --- ### 📝 Commits (3) - [`c9a8361`](https://github.com/horizon-rust/horizon/commit/c9a836149339a3c7d3b11692d61fa4ffbafb8c16) render: draw from a ViewSet of per-eye views (VR groundwork) - [`cd1d9ba`](https://github.com/horizon-rust/horizon/commit/cd1d9ba23b1cdf3e8b31b7a67010172d054ad2fd) Merge origin/main into vr/view-set - [`c487bbc`](https://github.com/horizon-rust/horizon/commit/c487bbce9ec560dbc8a98e1c2b75b3a0c422bf81) Merge origin/main into vr/view-set ### 📊 Changes **2 files changed** (+152 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+19 -14) ➕ `crates/horizon-client-render/src/gfx/view.rs` (+133 -0) </details> ### 📄 Description > 🤖 Opened by Expected333's AI agent (Claude), not by Expected333 themself. Groundwork for VR: the renderer draws from a `ViewSet` instead of reading `yaw`, `pitch` and `fov_degrees` straight off `Frame`. **No visible change** (label wanted: `skip-release`; I can't set labels from a fork). ## What changes - New `gfx/view.rs`: - `View` is one eye's view of the camera-relative world: `view` (rotation), `projection` (reversed-Z), `aspect` and `tan_half_fov`. - `View::screen(yaw, pitch, fov, aspect, far)` builds the flat-screen view. - `ViewSet` holds the views of a frame (one today, two on a headset) and the view used for culling. - `Renderer::views(frame)` replaces `view_projection` and the private `projection`. `camera_frustum` goes through the same `View`. - `draw_frame` reads the following from the primary view: `view_proj`, `inverse_view`, and `misc.z` / `misc.w`. - The frustum and the back-face eye (`projection_center`) come from `ViewSet::cull()`. ## Why it is bit-exact The products keep their order: `projection * (bob * spin) * rotation`, evaluated left to right as before. `aspect` and `tan(fov/2)` are computed with the same expressions. `the_screen_view_matches_the_legacy_projection_bit_for_bit` compares `to_bits()` of the old and new matrices over several FOVs, orientations, aspects, far planes and poses. `native_post` and `pack_uniforms` keep their own projections for now. Their association, `(P * bob) * spin`, and the GL projection differ, so they move when a second view needs them. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 3e81d266317b, against origin/main at 56f968e11, 5 min 18 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +152 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 398 passed (29 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (2 min 4 s) | | tests: horizon-client | ✅ 1263 passed (2 min 36 s) | | doc tests | ✅ 0 passed (2 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | Not run here: the harnesses and an in-game render. There is no vanilla data in `.local/` on this machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4797
No description provided.