feat(binaural): grow the reflection room to contain the scene (S2-16) - #350
Merged
Conversation
S2-16. The image-source room was whatever the user configured, and a scene larger than it — any `unit_scale_m` past 1 with the default 4 × 5 × 2.7 m room — had every boundary object pulled back to the wall before mirroring: valid geometry, but the reflections of the wall rather than of the object, and from the nearest wall a copy of the direct sound 0.1 m behind it. BINAURAL.md asked the user to size the room by hand. The room now grows on its own, axis by axis, to contain the ADM cube: each half-extent is floored at `unit_scale_m + 0.35 m` (capped at the 20 m the bank models). The walls are world-fixed and the scene does not rotate with the head, so per-axis containment of the cube is the exact condition; the 0.35 m margin puts a boundary object's nearest image 0.7 m (≈2 ms) behind the direct sound, and makes the default 2.7 m ceiling exactly the floor at unit scale 1 — the default room is unchanged there. The configured dimensions are therefore a minimum; a room smaller than the scene it holds had no physical reading anyway. Computed once per frame: three max/min per axis, nothing per channel or per sample. The outside-source clamp test moves to unit scale 12, where the cap still leaves the source outside; a new test checks that at unit scale 3 the boundary source's nearest reflection lands 0.7 m behind the direct sound with nothing before it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mgth
force-pushed
the
feat/binaural-room-auto-floor
branch
from
September 2, 2026 17:31
27d5aeb to
9e49e18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Series 2, lot 3, S2-16 — automatic room floor.
The image-source room was whatever the user configured; a scene larger than it (any
unit_scale_mpast 1 with the default 4 × 5 × 2.7 m room) had every boundary object pulled back to the wall before mirroring — the reflections of the wall rather than of the object, and a copy of the direct sound 0.1 m behind it from the nearest wall. The doc asked the user to size the room by hand.reflections::room_containing_scene(room, unit_scale_m): each half-extent floored atunit_scale_m + ROOM_FLOOR_MARGIN_M(0.35 m), capped at 20 m. Applied once per frame inrender_frame; per channel and per sample nothing changes.√3·unit_scale_m + margin(the scene's circumscribed sphere). The walls are world-fixed and the scene does not rotate with the head, so per-axis containment of the ADM cube is the exact condition;√3would have oversized every axis by 73 %.Tests
room_floor_contains_the_scene(reflections.rs): default unchanged at scale 1, 6.7 m at scale 3, generous room kept, 20 m cap, cube corners never clamped.room_grows_to_contain_the_scene(mod.rs): at scale 3 in the default room, the boundary source's nearest reflection lands ≈98 samples (0.7 m) after the direct sound, nothing before.reflections_of_an_outside_source_do_not_coincide_with_the_directmoved to unit scale 12 (past the cap) so the clamp path stays covered.cargo test -p renderer --lib: 383 passed, 2 ignored. Golden unchanged (reflections off).🤖 Generated with Claude Code