acdream/tests/AcDream.App.Tests/Rendering
Erik 0cc561c4d0 fix(render): doorway void — portal near-clip was near-dependent (eye-clip instead)
The cottage doorway 'void' (dark cell + floating entities while the chase camera looks
through the opening): PortalProjection.ProjectToNdc clipped portals on w+z>=0 — the GL
[-1,1] near-plane test — but acdream's camera builds its projection with D3D-convention
Matrix4x4.CreatePerspectiveFieldOfView and a 1.0 m near plane (RetailChaseCamera). Against
that matrix w+z>=0 discards everything within ~0.5 m of the eye, so when the camera orbits
to ~0.1 m from a doorway portal the near edge is clipped, the far edge projects off-screen
([flap] showed p->0171 D=0.10 proj=4 clip=0 ndc Y=-3.5..-6.6), the room behind is culled
(vis=1) and only the tiny vestibule shell draws -> dark void. Rotating away moved the eye
off the portal -> vis=5 -> room rendered.

Fix: clip against the EYE (w > MinW, MinW=0.05 m), near-INDEPENDENT — a portal you're
standing in still projects (covers the screen) so the cell behind stays visible. We only
use the projected x/y for the visibility clip region, so keeping vertices in front of the
near plane is correct. Matches retail PView::GetClip near-clipping the portal before project.
RED->GREEN regression test (doorway 0.1 m from a near=1.0 eye); 177 App tests green; the
existing straddling ±50 bound still holds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 13:42:46 +02:00
..
Wb test(render): Phase U.4 — cover ResolveEntitySlot clip-slot resolution 2026-05-30 18:16:21 +02:00
CameraCollisionIndoorTests.cs refactor(render): SweepEye returns (Eye, ViewerCellId) — surface the swept viewer cell 2026-06-03 12:32:45 +02:00
CameraControllerTests.cs feat(camera): InputAction + DebugVM surface for retail chase camera 2026-05-18 20:04:34 +02:00
CellVisibilityFromRootTests.cs refactor(render): Stage 3 T3.1 — delete FindCameraCell AABB grace-frame fallback 2026-06-02 15:36:47 +02:00
CellVisibilityPortalPolygonsTests.cs fix(render): Phase U.2b — resolve reciprocal portal by other_portal_id (retail 433557) 2026-05-30 16:56:00 +02:00
ClipFrameAssemblerTests.cs test(render): Phase W Stage 4/5 — assembler OutsideView AABB + PView BFS + entity-clip tests 2026-06-02 16:21:08 +02:00
ClipFrameLayoutTests.cs feat(render): Phase U.3 — GPU clip-plane gate (gl_ClipDistance), no-clip default 2026-05-30 17:27:30 +02:00
ClipPlaneSetTests.cs feat(render): Phase U.2c — ClipPlaneSet (NDC convex region → gl_ClipDistance planes) 2026-05-30 17:03:32 +02:00
EntityClipTests.cs fix(render): R1 — repurpose the ParentCellId==null cell-gate bypass (#78) 2026-06-02 20:10:26 +02:00
InteriorEntityPartitionTests.cs feat(render): R1 — InteriorEntityPartition (3-bucket per-cell entity split) 2026-06-02 19:53:42 +02:00
PhysicsCameraCollisionProbeTests.cs refactor(render): SweepEye returns (Eye, ViewerCellId) — surface the swept viewer cell 2026-06-03 12:32:45 +02:00
PortalProjectionTests.cs fix(render): doorway void — portal near-clip was near-dependent (eye-clip instead) 2026-06-03 13:42:46 +02:00
PortalViewTests.cs feat(render): Phase A8.F — ViewPolygon + CellView clip-region data model 2026-05-29 11:30:28 +02:00
PortalVisibilityBuilderTests.cs test(render): Phase W Stage 4/5 — assembler OutsideView AABB + PView BFS + entity-clip tests 2026-06-02 16:21:08 +02:00
RetailChaseCameraTests.cs feat(render): RetailChaseCamera.ViewerCellId — the swept viewer cell (retail viewer_cell) 2026-06-03 12:34:07 +02:00
ScreenPolygonClipTests.cs feat(render): Phase A8.F — ScreenPolygonClip 2D convex-polygon intersection 2026-05-29 11:37:30 +02:00