namespace AcDream.Plugin.Abstractions.Rendering; /// Prerequisite tier reached by a pack. public enum RenderPackTier { Tier1 = 1, Tier2 = 2, Tier2Plus = 3, } /// /// Renderer-owned facilities a pack may require or use opportunistically. /// These are semantic capabilities, not Vulkan extension or feature names. /// public enum RenderCapability { MainWorldColorIntermediate, FullscreenPasses, SceneDepthSampling, SceneNormalSampling, AuthoredSunDirection, AuthoredSunScreenPosition, AuthoredWeather, DirectionalShadowMaps, OutdoorDirectionalShadowCasterReplay, AnimatedCasterTransforms, AlphaCutoutShadowCasters, GpuTimestampQueries, /// One layered directional-depth pass may address multiple cascade views. MultiviewDirectionalShadowCascades, /// One renderer-selected authored sun-or-moon shadow direction. AuthoredCelestialDirectionalLight, } /// Fixed renderer-owned positions at which a declared pass may run. public enum RenderPassHook { ShadowDepthBeforeWorld, AtmosphereBeforeToneMap, ToneMap, AfterToneMapBeforePrivateViewports, } /// Immutable frame facts the renderer may bind for a pack. public enum RenderSemanticInput { WorldColor, SceneDepth, SceneNormals, SunDirection, SunScreenPosition, ActiveDayGroup, Weather, CameraMatrices, ShadowCasterTransforms, DirectionalShadowMaps, FrameTime, /// Selected surface-to-sun-or-moon direction for shadow work. SelectedCelestialDirectionalLight, } /// Renderer-owned replay operations available to a declaration. public enum RenderSceneReplaySemantic { OutdoorDirectionalShadowCasters, } /// Existing retained-scene classes eligible for a scene replay. [Flags] public enum RenderCasterClass { None = 0, Terrain = 1 << 0, OpaqueWorld = 1 << 1, AlphaCutoutWorld = 1 << 2, AnimatedOpaque = 1 << 3, AnimatedAlphaCutout = 1 << 4, } /// Base renderer pipeline a pack may specialize. public enum RenderPipelineBaseSemantic { Terrain, WorldMesh, EnvCell, } /// Material classifications accepted by a pipeline variant. [Flags] public enum RenderMaterialClass { None = 0, Opaque = 1 << 0, AlphaCutout = 1 << 1, AnimatedOpaque = 1 << 2, AnimatedAlphaCutout = 1 << 3, } /// Kind of renderer-owned intermediate resource. public enum RenderResourceKind { Image2D, Image2DArray, Buffer, } /// Portable format families resolved by the renderer. public enum RenderFormatClass { LdrColor, HdrColor, SingleChannel, DirectionalDepth, StructuredData, } /// How declared image dimensions are interpreted. public enum RenderExtentMode { AbsolutePixels, RelativeToMainWorld, RelativeToOutput, } /// Permitted uses of a declared resource. [Flags] public enum RenderResourceUsage { None = 0, Sampled = 1 << 0, ColorAttachment = 1 << 1, DepthAttachment = 1 << 2, Storage = 1 << 3, TransferSource = 1 << 4, TransferDestination = 1 << 5, } /// Lifetime class used by the renderer's frame-flight allocator. public enum RenderResourceLifetime { TransientPass, FrameFlight, ActivePack, } /// /// Renderer-owned meaning of a declared resource. is /// available to ordinary declarative fullscreen graphs; the remaining values /// let a pack request host executors without relying on magic resource IDs. /// public enum RenderResourceSemantic { Custom, MainWorldHdr, BloomPing, BloomPong, SunOcclusionMask, SunRays, DirectionalShadowDepth, VolumetricShafts, } /// Shape of one image declaration. /// Absolute pixels or a scale relative to a renderer surface. /// Pixel width for absolute mode; horizontal scale otherwise. /// Pixel height for absolute mode; vertical scale otherwise. /// Array layers; one for an ordinary 2-D image. public sealed record RenderExtentDeclaration( RenderExtentMode Mode, double Width, double Height, int Layers = 1); /// One renderer-owned intermediate image or buffer. public sealed record RenderResourceDeclaration( string Id, RenderResourceKind Kind, RenderFormatClass Format, RenderExtentDeclaration? Extent, long SizeBytes, RenderResourceUsage Usage, RenderResourceLifetime Lifetime, long EstimatedResidentBytes) { public RenderResourceSemantic Semantic { get; init; } = RenderResourceSemantic.Custom; } /// /// Renderer-owned execution meaning of a pass. IDs remain pack-owned stable /// identifiers; semantic execution never depends on a particular ID string. /// public enum RenderPassSemantic { CustomFullscreen, DirectionalShadowDepth, BloomDownsample, BloomBlurHorizontal, BloomBlurVertical, SunOcclusion, SunRays, VolumetricShafts, FilmicComposite, } /// One declarative full-screen, atmosphere, or tone-map pass. public sealed record RenderPassDeclaration( string Id, RenderPassHook Hook, string VertexShaderAsset, string FragmentShaderAsset, IReadOnlyList SemanticInputs, IReadOnlyList ResourceReads, IReadOnlyList ResourceWrites) { public RenderPassSemantic Semantic { get; init; } = RenderPassSemantic.CustomFullscreen; } /// A renderer-owned replay of retained scene geometry. public sealed record SceneReplayDeclaration( string Id, RenderSceneReplaySemantic Semantic, RenderCasterClass CasterClasses, int ViewCount); /// A shader specialization of an existing renderer pipeline. public sealed record PipelineVariantDeclaration( string Id, RenderPipelineBaseSemantic BaseSemantic, string VertexShaderAsset, string FragmentShaderAsset, RenderMaterialClass CompatibleMaterials, IReadOnlyList SemanticInputs) { public RenderPipelineVariantSemantic Semantic { get; init; } = RenderPipelineVariantSemantic.Custom; } /// Renderer-owned role of a fixed retained-scene pipeline variant. public enum RenderPipelineVariantSemantic { Custom, TerrainDirectionalShadowCaster, WorldOpaqueDirectionalShadowCaster, WorldAlphaCutoutDirectionalShadowCaster, TerrainDirectionalShadowReceiver, WorldDirectionalShadowReceiver, TerrainMultiviewDirectionalShadowCaster, WorldOpaqueMultiviewDirectionalShadowCaster, WorldAlphaCutoutMultiviewDirectionalShadowCaster, } /// Per-preset replacement for one resource's size. public sealed record RenderQualityResourceOverride( string ResourceId, RenderExtentDeclaration? Extent, long SizeBytes, long EstimatedResidentBytes); /// Per-preset value for a declared user setting. public sealed record RenderQualitySettingOverride( string SettingId, string Value); /// One user-selectable, independently capability-gated preset. public sealed record RenderQualityPreset( string Id, string DisplayName, IReadOnlyList RequiredCapabilities, IReadOnlyList ResourceOverrides, IReadOnlyList SettingOverrides, long MaxResidentGpuBytes, double MaxIncrementalGpuMillisecondsP50, double MaxIncrementalGpuMillisecondsP99, double MaxIncrementalCpuMillisecondsP50, double MaxIncrementalCpuMillisecondsP99, bool AutoEligible = true) { public RenderQualitySemantic Semantic { get; init; } = RenderQualitySemantic.Custom; /// /// Optional renderer-owned execution optimizations whose shader ABI the /// pack explicitly implements. The host never infers these from a pack ID. /// public RenderQualityExecutionHints ExecutionHints { get; init; } = RenderQualityExecutionHints.None; } /// /// Opt-in execution forms for renderer-owned atmospheric work. These hints /// may fuse passes or compatible submissions; they do not remove declared /// effects or caster classes from the final image. /// [Flags] public enum RenderQualityExecutionHints { None = 0, /// /// The sun-rays shader accepts scene depth directly and filmic composite /// evaluates the declared bloom extraction/filter while composing the /// image. See the standard PackPass ABI flags. /// FusedAtmosphericPostProcess = 1 << 0, /// /// The three multiview caster variants select the exact cascade matrix with /// the renderer-owned view index and render every declared Low cascade in /// one layered depth pass. /// MultiviewDirectionalShadowCascades = 1 << 1, } /// /// Optional host quality role. Pack-owned IDs remain persisted; this semantic /// is used only when a pack opts into the host's automatic-quality controller. /// public enum RenderQualitySemantic { Custom, Low, Medium, High, Automatic, } /// Storage and presentation kind for a pack-defined setting. public enum RenderSettingKind { Boolean, Integer, Float, Choice, } /// A bounded, user-visible pack setting. public sealed record RenderSettingDeclaration( string Id, string DisplayName, RenderSettingKind Kind, string DefaultValue, double? Minimum, double? Maximum, double? Step, IReadOnlyList Choices) { public RenderSettingSemantic Semantic { get; init; } = RenderSettingSemantic.Custom; } /// /// Optional host meaning for settings consumed by a renderer-owned atmospheric /// executor. Ordinary pack settings use . /// public enum RenderSettingSemantic { Custom, BloomStrength, FilmicStrength, Exposure, GradeSaturation, GradeContrast, VignetteStrength, SunRayStrength, DirectionalShadowStrength, DirectionalShadowReachMetres, DirectionalShadowPcfTaps, VolumetricStrength, VolumetricRayMarchSteps, AutomaticQuality, // Campaign VM VM6: foliage wind. WindEnabled, WindStrength, WindDirectionDegrees, WindLeanMetres, WindBranchMetres, WindFlutterMetres, WindCanopyHeightMetres, } /// One point on a declared sun-elevation response curve. public sealed record SunElevationResponsePoint( double ElevationDegrees, double Multiplier); /// Explicit mapping from an authored AC day group to an effect multiplier. public sealed record ActiveDayGroupMultiplier( int ActiveDayGroup, double Multiplier); /// /// Explicit mapping from a DAT-classified weather kind to the foliage-wind /// mean and gust strength for that weather (both in the declared [0,1] range /// before the pack's global wind-strength setting scales them). Campaign VM /// VM6, corrected in the fix round: the day-group's raw activeDayGroup /// INDEX carries no weather meaning by itself — WeatherState.cs's /// existing name classification is what turns a day group's DAT name into /// one of the five real weather kinds, and that is what the host already /// threads through AtmosphericFrameInputs.Weather / uAtmosphereWeather.x. /// This is the same fact, keyed correctly instead of by index. /// /// /// The exact member name of AcDream.Core.World.WeatherKind — one of /// "Clear", "Overcast", "Rain", "Snow", /// "Storm". A plain string because this project (Plugin.Abstractions) /// is BCL-only and cannot reference the Core enum; the host converts with /// WeatherKind.ToString() (ordinal) when resolving. /// public sealed record FoliageWindWeatherPoint( string WeatherKind, double Mean, double Gust); /// Visible authored-atmosphere interpretation owned by the pack. public sealed record AtmospherePolicyDeclaration( IReadOnlyList SunElevationResponse, IReadOnlyList ActiveDayGroupMultipliers) { /// /// Optional selected-light elevation curve for directional shadows. The host /// linearly interpolates adjacent points in sine-of-elevation space and /// clamps beyond the endpoints. /// The resolved multiplier must be zero at and below the authored /// 0-degree horizon: every non-positive control point must be zero and, /// when no exact 0-degree point is declared, the first positive control /// point must also be zero. /// A pack using the directional-shadow semantic must declare this curve. /// public IReadOnlyList DirectionalShadowLightElevationResponse { get; init; } = []; /// /// Optional moving-sun strength curve for volumetric shafts. The host /// smoothstep-interpolates adjacent points in elevation-degree space and /// clamps beyond the endpoints. /// A pack using the volumetric-shaft semantic must declare this curve. /// public IReadOnlyList VolumetricShaftSunElevationResponse { get; init; } = []; /// /// Campaign VM VM6: exact per-weather-kind foliage-wind mean/gust /// targets, looked up by the DAT-classified /// AcDream.Core.World.WeatherKind (an exact match, not an /// interpolation — the five kinds are not ordered by "how windy"). The /// host smooths the resolved (mean, gust) target toward whatever this /// table returns over time using the existing weather delta-seconds /// clock, so a weather change never snaps. A kind absent from this table /// falls back to the declared Clear row, then to (0, 0) if Clear itself /// is undeclared. Each declared /// must be one of the five real kind names and must appear at most once. /// public IReadOnlyList FoliageWindByWeather { get; init; } = []; /// /// Campaign VM VM6: object/GfxObj ids excluded from foliage-wind sway /// even though their entity id falls in the procedural-scenery /// namespace and their subset classification would otherwise qualify — /// the rare scenery object that is cutout-material but not actually /// foliage (e.g. a cutout rock or fence prop drawn from the scenery /// table). There is no include list: outside this exclusion set, the /// classification rule in WbDrawDispatcher is the rule. /// public IReadOnlyList FoliageExclusions { get; init; } = []; } /// /// Complete immutable declaration for one render pack. Packs describe what /// they need; the renderer validates and owns every concrete resource, pass, /// pipeline, barrier, and scene replay. /// public sealed record RenderPackDescriptor( string Id, string DisplayName, Version PackVersion, int PackApiVersion, RenderPackTier HighestTier, IReadOnlyList RequiredCapabilities, IReadOnlyList OptionalCapabilities, IReadOnlyList Resources, IReadOnlyList Passes, IReadOnlyList SceneReplays, IReadOnlyList PipelineVariants, IReadOnlyList QualityPresets, IReadOnlyList Settings, AtmospherePolicyDeclaration? AtmospherePolicy) { /// Short user-facing description shown beside compatibility and cost. public string FeatureSummary { get; init; } = string.Empty; }