refactor(render): extract world scene frame owner

Move fallback and PView world drawing, shared alpha, particles, visibility, selection, and diagnostics behind focused frame owners. Make exceptional frames failure-atomic by restoring the shared GL baseline and preserving primary alpha failures through cleanup.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-22 07:22:09 +02:00
parent 85239fb373
commit 28e1cf8029
25 changed files with 2679 additions and 844 deletions

View file

@ -9,7 +9,19 @@ namespace AcDream.App.Rendering.Selection;
/// The renderer builds one frame while input queries the previously completed
/// frame, avoiding partial visibility state during multi-slice portal drawing.
/// </summary>
internal sealed class RetailSelectionScene : IRetailSelectionRenderSink, IRetailSelectionLightingSource
internal interface IWorldSceneSelectionFrame
{
void BeginFrame();
void CompleteFrame();
void AbortFrame();
}
internal sealed class RetailSelectionScene :
IRetailSelectionRenderSink,
IRetailSelectionLightingSource,
IWorldSceneSelectionFrame
{
private readonly IRetailSelectionGeometrySource _geometry;
private readonly RetailSelectionLightingPulse _lightingPulse;
@ -100,6 +112,15 @@ internal sealed class RetailSelectionScene : IRetailSelectionRenderSink, IRetail
(_published, _building) = (_building, _published);
}
/// <summary>Discards the incomplete building frame and preserves the last
/// completely published selection product.</summary>
public void AbortFrame()
{
_building.Clear();
_buildingKeys.Clear();
_viewFrustum = null;
}
public RetailSelectionHit? Pick(
float mouseX,
float mouseY,