checkpoint(render): preserve pre-overhaul investigation state

This commit is contained in:
Erik 2026-09-01 18:04:24 +02:00
parent e880860291
commit b3b7d922f1
45 changed files with 3168 additions and 619 deletions

View file

@ -619,7 +619,22 @@ public sealed class MeshExtractor {
BoundingBox = boundingBox,
SortCenter = gfxObj?.SortCenter ?? Vector3.Zero,
DIDDegrade = gfxObj != null && gfxObj.Flags.HasFlag(GfxObjFlags.HasDIDDegrade) ? gfxObj.DIDDegrade : 0,
SelectionSphere = new Sphere { Origin = boundingBox.Center, Radius = Vector3.Distance(boundingBox.Max, boundingBox.Min) / 2.0f }
// Retail CGfxObj::Serialize @ 0x00534970 stores drawing_sphere as
// BSPTREE::GetSphere(drawing_bsp), and RenderDeviceD3D::DrawMesh
// @ 0x005A0860 passes that exact sphere to viewconeCheck. The
// vertex-AABB sphere used here previously is a different shape
// (notably on long Facility Hub stair sections) and can change a
// portal-edge admission decision. Preserve the authored root
// sphere in prepared content; retain the AABB only for malformed
// or drawing-BSP-less assets which have no retail sphere to carry.
SelectionSphere = gfxObj?.DrawingBSP?.Root?.BoundingSphere
?? new Sphere
{
Origin = boundingBox.Center,
Radius = Vector3.Distance(
boundingBox.Max,
boundingBox.Min) / 2.0f,
}
};
}

View file

@ -31,9 +31,13 @@ public static class PakFormat {
/// binary format remains version 1. Version 6 introduces pak format 2:
/// globally shared texture payloads plus independently Brotli-compressed
/// blobs with raw fallback. Mesh geometry and source texture bytes remain
/// exact; unedited DXT surfaces now retain their native BC blocks.
/// exact; unedited DXT surfaces now retain their native BC blocks. Version
/// 7 replaces the synthetic vertex-AABB GfxObj view sphere with retail's
/// authored DrawingBSP root sphere. The binary format remains version 2,
/// but every prepared GfxObj render record must be regenerated because
/// the sphere participates in portal-view admission.
/// </summary>
public const uint CurrentBakeToolVersion = 6;
public const uint CurrentBakeToolVersion = 7;
}
/// <summary>