perf(vfx): port retail particle visibility degradation
Resolve DAT-authored particle ranges from the hardware GfxObj, apply retail distance and completed-cell visibility gates, and preserve the exact finite/infinite off-view update semantics. This removes dense-world simulation work without shortening terrain, entity, fog, or streaming distance. Publish doorway-clipped outdoor cells through a focused frame controller, retain effect cell identity for outdoor statics, reject hidden emitters before particle-slot scans, and offer an explicit opt-in Extended particle range. Release build succeeds and all 5,857 tests pass with five intentional skips. Retail-conformance, architecture, and adversarial review cycles are clean; connected Aerlinthe visual/performance gate pending. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
82789eea88
commit
f1ba147ac5
29 changed files with 1810 additions and 125 deletions
|
|
@ -3,6 +3,17 @@ using AcDream.UI.Abstractions.Settings;
|
|||
|
||||
namespace AcDream.UI.Abstractions.Panels.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Particle visibility distance policy. Retail uses the GfxObj-authored
|
||||
/// distance exactly; Extended is an explicit acdream adaptation for players
|
||||
/// who prefer longer-lived distant effects with the corresponding CPU cost.
|
||||
/// </summary>
|
||||
public enum ParticleRange
|
||||
{
|
||||
Retail = 0,
|
||||
Extended = 1,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Display-related preferences persisted to <c>settings.json</c>.
|
||||
/// Modern addition (no retail equivalent for FOV / vsync etc) — replaces
|
||||
|
|
@ -22,7 +33,8 @@ public sealed record DisplaySettings(
|
|||
float FieldOfView,
|
||||
float Gamma,
|
||||
bool ShowFps,
|
||||
QualityPreset Quality)
|
||||
QualityPreset Quality,
|
||||
ParticleRange ParticleRange)
|
||||
{
|
||||
/// <summary>Values used on first launch / when settings.json is absent.
|
||||
/// Geometry/render defaults preserve the pre-L.0 runtime state — Resolution
|
||||
|
|
@ -36,7 +48,8 @@ public sealed record DisplaySettings(
|
|||
FieldOfView: 60f,
|
||||
Gamma: 1.0f,
|
||||
ShowFps: false,
|
||||
Quality: QualityPreset.High);
|
||||
Quality: QualityPreset.High,
|
||||
ParticleRange: ParticleRange.Retail);
|
||||
|
||||
/// <summary>16:9 resolution presets offered in the dropdown.</summary>
|
||||
public static IReadOnlyList<string> AvailableResolutions { get; } = new[]
|
||||
|
|
|
|||
|
|
@ -236,12 +236,20 @@ public sealed class SettingsPanel : IPanel
|
|||
if (renderer.Combo("Quality", ref qIdx, presets))
|
||||
_vm.SetDisplay(d with { Quality = (QualityPreset)qIdx });
|
||||
|
||||
int particleRangeIndex = (int)d.ParticleRange;
|
||||
if (particleRangeIndex < 0 || particleRangeIndex >= s_particleRangeNames.Length)
|
||||
particleRangeIndex = (int)ParticleRange.Retail;
|
||||
if (renderer.Combo("Particle Range", ref particleRangeIndex, s_particleRangeNames))
|
||||
_vm.SetDisplay(d with { ParticleRange = (ParticleRange)particleRangeIndex });
|
||||
|
||||
renderer.Spacing();
|
||||
renderer.TextWrapped(
|
||||
"Resolution / Fullscreen / V-Sync apply on Save. FOV + Gamma "
|
||||
+ "preview live as you drag; Cancel reverts to the saved value. "
|
||||
+ "Quality preset applies streaming radius, anisotropic, and A2C "
|
||||
+ "immediately on Save; MSAA sample count requires a restart.");
|
||||
+ "immediately on Save; MSAA sample count requires a restart. "
|
||||
+ "Particle Range defaults to retail-authored distances; Extended "
|
||||
+ "doubles effect range and costs additional CPU time.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -474,6 +482,9 @@ public sealed class SettingsPanel : IPanel
|
|||
private static readonly string[] s_qualityPresetNames =
|
||||
{ "Low", "Medium", "High", "Ultra" };
|
||||
|
||||
private static readonly string[] s_particleRangeNames =
|
||||
{ "Retail", "Extended" };
|
||||
|
||||
private void RenderSection(IPanelRenderer renderer, string label, InputAction[] actions)
|
||||
{
|
||||
// Movement defaults open; other sections collapsed for first-run UX.
|
||||
|
|
|
|||
|
|
@ -73,7 +73,9 @@ public sealed class SettingsStore
|
|||
FieldOfView: ReadFloat (disp, "fieldOfView", d.FieldOfView),
|
||||
Gamma: ReadFloat (disp, "gamma", d.Gamma),
|
||||
ShowFps: ReadBool (disp, "showFps", d.ShowFps),
|
||||
Quality: ReadQuality (disp, "quality", d.Quality));
|
||||
Quality: ReadQuality (disp, "quality", d.Quality),
|
||||
ParticleRange: ReadParticleRange(
|
||||
disp, "particleRange", d.ParticleRange));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -569,6 +571,7 @@ public sealed class SettingsStore
|
|||
["fieldOfView"] = d.FieldOfView,
|
||||
["fullscreen"] = d.Fullscreen,
|
||||
["gamma"] = d.Gamma,
|
||||
["particleRange"] = d.ParticleRange.ToString(),
|
||||
["quality"] = d.Quality.ToString(),
|
||||
["resolution"] = d.Resolution,
|
||||
["showFps"] = d.ShowFps,
|
||||
|
|
@ -656,4 +659,18 @@ public sealed class SettingsStore
|
|||
var s = el.GetString();
|
||||
return Enum.TryParse<QualityPreset>(s, ignoreCase: true, out var v) ? v : fallback;
|
||||
}
|
||||
|
||||
private static ParticleRange ReadParticleRange(
|
||||
JsonElement obj,
|
||||
string name,
|
||||
ParticleRange fallback)
|
||||
{
|
||||
if (!obj.TryGetProperty(name, out var el) || el.ValueKind != JsonValueKind.String)
|
||||
return fallback;
|
||||
var value = el.GetString();
|
||||
return Enum.TryParse(value, ignoreCase: true, out ParticleRange parsed)
|
||||
&& Enum.IsDefined(parsed)
|
||||
? parsed
|
||||
: fallback;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue