Revert "Campaign V slice V4a" - it lost world multisampling
This reverts ceec3bc4. Two independent reasons, either sufficient.
The rendering regression. The slice deleted TextRenderGlStateScope, which
saved GL_MULTISAMPLE and GL_SAMPLE_ALPHA_TO_COVERAGE on entry, disabled them
for the text pass, and restored them on exit (TextRenderGlStateScope.cs:111-112
and 153-154 at the parent commit). Its replacement bakes that state into the
text pipeline but nothing restores it, and GlGpuPassEncoder.Dispose does not
either. Every world renderer is still raw GL at this point in the campaign, so
from the first UI frame onward the world drew with multisampling disabled.
The offline pixel gate caught it: 1,791 of 563,200 compared pixels differed,
0.318% against a 0.001 threshold. The commit message attributed this to
wall-clock-driven ambient animation shifting phase, and committed through the
failure. That explanation does not survive its own control: capturing twice at
the reverted-to commit differs by 19 pixels and twice at the slice's own commit
by 8, while base-versus-head differs by 1,791 - a 224x gap that no shared-noise
source explains. An amplified difference image settles it visually: the changed
pixels are the silhouette edges of every tree, building and rock, with terrain
interiors, water and the entire UI untouched. That is the signature of losing
edge antialiasing, not of animated sprites.
This is the exact failure mode two existing memory notes already warn about -
a mid-frame renderer must set every GL state it uses rather than inherit it,
and issue #52's lesson that a rendering migration must audit per-pass GL state
before declaring itself done.
The scope. The brief was three small leaf renderers plus additive frame-
lifecycle wiring, roughly ten files. The commit changed 334 files with 3,665
insertions and 3,845 deletions, including 323 public-to-internal visibility
conversions across the App assembly, 55 test files, two retired conformance
tests, and a self-described temporary escape hatch for bridging raw-GL viewport
textures. Even without the regression, that is not separable into the part
worth keeping and the part worth dropping.
Reverting rather than patching because the good work here - the RHI frame
lifecycle wiring and a genuine render-state-cache staleness fix - is small
enough to redo cleanly against a tightened spec, while untangling it from 300+
files of unrelated churn is not.
Post-revert: Release build clean, App suite back to 3,843 passed / 3 skipped,
offline pixel gate passing at 19 differing pixels.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ceec3bc440
commit
9aaf97e785
334 changed files with 3841 additions and 3661 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using AcDream.Core.Physics;
|
||||
|
||||
namespace AcDream.App.Rendering;
|
||||
|
|
@ -12,7 +12,7 @@ namespace AcDream.App.Rendering;
|
|||
/// cell walls (<c>FindEnvCollisions</c>) AND outdoor/baked GfxObj shells
|
||||
/// (<c>FindObjCollisions</c>) in one faithful path.
|
||||
/// </summary>
|
||||
internal sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
||||
public sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
||||
{
|
||||
/// <summary>Retail <c>viewer_sphere</c> radius (acclient :93314).</summary>
|
||||
public const float ViewerSphereRadius = 0.3f;
|
||||
|
|
@ -23,13 +23,13 @@ internal sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
|||
|
||||
public CameraSweepResult SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint selfEntityId, Vector3 playerPos)
|
||||
{
|
||||
// update_viewer: player->cell == 0 → set_viewer(player_pos, 1), viewer_cell = null
|
||||
// (acclient_2013_pseudo_c.txt:92775). No cell to sweep against → snap to the player.
|
||||
// update_viewer: player->cell == 0 → set_viewer(player_pos, 1), viewer_cell = null
|
||||
// (acclient_2013_pseudo_c.txt:92775). No cell to sweep against → snap to the player.
|
||||
if (cellId == 0) return new CameraSweepResult(playerPos, 0u);
|
||||
|
||||
// === Start cell (pc:92824-92844) ===
|
||||
// Indoor (objcell_id >= 0x100): seat the sweep's start cell at the head-PIVOT via
|
||||
// CPhysicsObj::AdjustPosition (pc:92832) — the head can sit in a different cell than
|
||||
// CPhysicsObj::AdjustPosition (pc:92832) — the head can sit in a different cell than
|
||||
// the feet (the cellar lip: feet in the low connector, head up at floor level). On
|
||||
// failure retail falls back to player->cell. Outdoor: cell = player->cell (no AdjustPosition).
|
||||
uint startCell = cellId;
|
||||
|
|
@ -39,10 +39,10 @@ internal sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
|||
if (found) startCell = pivotCell;
|
||||
}
|
||||
|
||||
// === Sweep the viewer_sphere pivot → sought-eye from the start cell (pc:92860-92868) ===
|
||||
// === Sweep the viewer_sphere pivot → sought-eye from the start cell (pc:92860-92868) ===
|
||||
// SpherePath.InitPath puts sphere0's center at pathPos + (0,0,radius) (the player
|
||||
// foot-capsule convention). Retail's viewer_sphere center is (0,0,0), so shift the
|
||||
// path DOWN by the radius to make the SPHERE CENTER travel pivot→eye, then add it back.
|
||||
// path DOWN by the radius to make the SPHERE CENTER travel pivot→eye, then add it back.
|
||||
Vector3 begin = ToSpherePath(pivot, ViewerSphereRadius);
|
||||
Vector3 end = ToSpherePath(desiredEye, ViewerSphereRadius);
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ internal sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
|||
// Retail SmartBox::update_viewer calls init_object(player, 0x5c) =
|
||||
// IsViewer | PathClipped | FreeRotate | PerfectClip (acclient
|
||||
// pseudo-C :92864; enum TransitionTypes.cs:24-33). PathClipped makes
|
||||
// the sweep HARD-STOP at first contact (TransitionTypes.cs:811) — the
|
||||
// the sweep HARD-STOP at first contact (TransitionTypes.cs:811) — the
|
||||
// spring-arm pull-in, not the player's edge-slide. IsViewer lets the
|
||||
// eye pass through creatures, colliding only with world geometry
|
||||
// (CollisionExemption.cs:83-85). FreeRotate/PerfectClip are no-ops in
|
||||
|
|
@ -95,7 +95,7 @@ internal sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
|||
|
||||
// === Fallback 1 (pc:92878-92883): AdjustPosition at the sought eye ===
|
||||
// The sweep found no valid position; try to seat the eye at its own cell.
|
||||
// (Seed with the player cell — acdream's camera doesn't track the sought-eye's
|
||||
// (Seed with the player cell — acdream's camera doesn't track the sought-eye's
|
||||
// cell separately; the eye is near the player so its stab-list is the right one.)
|
||||
var (eyeCell, eyeFound) = _physics.AdjustPosition(cellId, desiredEye);
|
||||
if (eyeFound) return new CameraSweepResult(desiredEye, eyeCell);
|
||||
|
|
@ -104,11 +104,11 @@ internal sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
|
|||
return new CameraSweepResult(playerPos, 0u);
|
||||
}
|
||||
|
||||
/// <summary>Eye/pivot point → InitPath path point (subtract the sphere-center offset).</summary>
|
||||
/// <summary>Eye/pivot point → InitPath path point (subtract the sphere-center offset).</summary>
|
||||
internal static Vector3 ToSpherePath(Vector3 spherePoint, float radius)
|
||||
=> spherePoint - new Vector3(0f, 0f, radius);
|
||||
|
||||
/// <summary>InitPath path point → eye point (add the sphere-center offset back).</summary>
|
||||
/// <summary>InitPath path point → eye point (add the sphere-center offset back).</summary>
|
||||
internal static Vector3 FromSpherePath(Vector3 pathPoint, float radius)
|
||||
=> pathPoint + new Vector3(0f, 0f, radius);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue