feat(render): implement Campaign AR and terrain fidelity
This commit is contained in:
parent
99cf26e00c
commit
7a5f96ede5
368 changed files with 50611 additions and 950 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using AcDream.Plugin.Abstractions;
|
||||
using AcDream.Plugin.Abstractions.Rendering;
|
||||
using System.Runtime.Loader;
|
||||
|
||||
namespace AcDream.Plugin.Tests.Fixtures.HostPlugin;
|
||||
|
|
@ -9,7 +10,7 @@ namespace AcDream.Plugin.Tests.Fixtures.HostPlugin;
|
|||
/// gameplay events. A headless registry must make the UI call harmless without
|
||||
/// retaining this instance in the default load context.
|
||||
/// </summary>
|
||||
public sealed class HostPlugin : IAcDreamPlugin
|
||||
public sealed class HostPlugin : IAcDreamPlugin, IRenderPackPlugin, IRenderPackAssets
|
||||
{
|
||||
private IPluginHost? _host;
|
||||
private string? _assemblyDirectory;
|
||||
|
|
@ -67,6 +68,63 @@ public sealed class HostPlugin : IAcDreamPlugin
|
|||
_host = null;
|
||||
}
|
||||
|
||||
public void Register(IRenderPackRegistry registry)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(registry);
|
||||
string directory = Path.GetDirectoryName(
|
||||
typeof(HostPlugin).Assembly.Location)!;
|
||||
if (File.Exists(Path.Combine(directory, "register-no-render-packs")))
|
||||
return;
|
||||
string versionPath = Path.Combine(directory, "render-pack-version.txt");
|
||||
Version version = File.Exists(versionPath)
|
||||
? Version.Parse(File.ReadAllText(versionPath).Trim())
|
||||
: new Version(1, 0, 0);
|
||||
_ = registry.Register(
|
||||
new RenderPackDescriptor(
|
||||
Id: "acdream.test.external-render-pack",
|
||||
DisplayName: "External graphical render-pack fixture",
|
||||
PackVersion: version,
|
||||
PackApiVersion: RenderPackApi.Current,
|
||||
HighestTier: RenderPackTier.Tier1,
|
||||
RequiredCapabilities: [],
|
||||
OptionalCapabilities: [],
|
||||
Resources: [],
|
||||
Passes: [],
|
||||
SceneReplays: [],
|
||||
PipelineVariants: [],
|
||||
QualityPresets:
|
||||
[
|
||||
Preset("low", "Low"),
|
||||
Preset("high", "High"),
|
||||
],
|
||||
Settings: [],
|
||||
AtmospherePolicy: null)
|
||||
{
|
||||
FeatureSummary = "Collectible external no-op render-pack fixture.",
|
||||
},
|
||||
this);
|
||||
if (File.Exists(Path.Combine(directory, "throw-after-render-pack-register")))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"fixture render-pack registration failed after publishing its descriptor");
|
||||
}
|
||||
}
|
||||
|
||||
public Stream OpenRead(string assetKey) =>
|
||||
new MemoryStream([], writable: false);
|
||||
|
||||
private static RenderQualityPreset Preset(string id, string displayName) => new(
|
||||
id,
|
||||
displayName,
|
||||
RequiredCapabilities: [],
|
||||
ResourceOverrides: [],
|
||||
SettingOverrides: [],
|
||||
MaxResidentGpuBytes: 0,
|
||||
MaxIncrementalGpuMillisecondsP50: 0,
|
||||
MaxIncrementalGpuMillisecondsP99: 0,
|
||||
MaxIncrementalCpuMillisecondsP50: 0,
|
||||
MaxIncrementalCpuMillisecondsP99: 0);
|
||||
|
||||
private void RegisterHostCallbacks(IPluginHost host)
|
||||
{
|
||||
host.Ui.AddMarkupPanel(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue