using System; using UnityEngine.Serialization; using UnityEngine.Experimental.Rendering; namespace UnityEngine.Rendering.HighDefinition { // RenderRenderPipelineSettings represent settings that are immutable at runtime. // There is a dedicated RenderRenderPipelineSettings for each platform /// /// Possible values for the cubemap texture size used for reflection probes. /// [Serializable] public enum CubeReflectionResolution { /// Size 128 CubeReflectionResolution128 = 128, /// Size 256 CubeReflectionResolution256 = 256, /// Size 512 CubeReflectionResolution512 = 512, /// Size 1024 CubeReflectionResolution1024 = 1024, /// Size 2048 CubeReflectionResolution2048 = 2048, /// Size 4096 CubeReflectionResolution4096 = 4096 } /// /// Available graphic formats for the cube and planar reflection probes. /// [System.Serializable] public enum ReflectionAndPlanarProbeFormat { /// Faster sampling and rendering but at the cost of precision. R11G11B10 = GraphicsFormat.B10G11R11_UFloatPack32, /// Better precision, but uses twice as much memory compared to R11G11B10. R16G16B16A16 = GraphicsFormat.R16G16B16A16_SFloat, } /// /// Possible values for the texture 2D size used for planar reflection probes. /// [Serializable] public enum PlanarReflectionAtlasResolution { /// Size 64 Resolution64 = 64, /// Size 128 Resolution128 = 128, /// Size 256 Resolution256 = 256, /// Size 512 Resolution512 = 512, /// Size 1024 Resolution1024 = 1024, /// Size 2048 Resolution2048 = 2048, /// Size 4096 Resolution4096 = 4096, /// Size 8192 Resolution8192 = 8192, /// Size 16384 Resolution16384 = 16384 } /// /// Possible values for the texture 2D size used for cookies. /// [Serializable] public enum CookieAtlasResolution { /// Size 64 CookieResolution64 = 64, /// Size 128 CookieResolution128 = 128, /// Size 256 CookieResolution256 = 256, /// Size 512 CookieResolution512 = 512, /// Size 1024 CookieResolution1024 = 1024, /// Size 2048 CookieResolution2048 = 2048, /// Size 4096 CookieResolution4096 = 4096, /// Size 8192 CookieResolution8192 = 8192, /// Size 16384 CookieResolution16384 = 16384 } /// /// Possible values for the cubemap texture size used for cookies. /// [Serializable] public enum CubeCookieResolution { /// Size 64 CubeCookieResolution64 = 64, /// Size 128 CubeCookieResolution128 = 128, /// Size 256 CubeCookieResolution256 = 256, /// Size 512 CubeCookieResolution512 = 512, /// Size 1024 CubeCookieResolution1024 = 1024, /// Size 2048 CubeCookieResolution2048 = 2048, /// Size 4096 CubeCookieResolution4096 = 4096 } /// /// Global Light Loop Settings. /// [Serializable] public struct GlobalLightLoopSettings { internal static readonly GlobalLightLoopSettings @default = default; /// Default GlobalDecalSettings internal static GlobalLightLoopSettings NewDefault() => new GlobalLightLoopSettings() { cookieAtlasSize = CookieAtlasResolution.CookieResolution2048, cookieFormat = CookieAtlasGraphicsFormat.R11G11B10, cookieAtlasLastValidMip = 0, // We must keep this value for migration purpose (when we create a new HDRP asset it is migrated to the last version) #pragma warning disable 618 // Type or member is obsolete cookieTexArraySize = 1, #pragma warning restore 618 planarReflectionAtlasSize = PlanarReflectionAtlasResolution.Resolution1024, reflectionProbeCacheSize = 64, reflectionCubemapSize = CubeReflectionResolution.CubeReflectionResolution256, reflectionProbeFormat = ReflectionAndPlanarProbeFormat.R11G11B10, skyReflectionSize = SkyResolution.SkyResolution256, skyLightingOverrideLayerMask = 0, maxDirectionalLightsOnScreen = 16, maxPunctualLightsOnScreen = 512, maxAreaLightsOnScreen = 64, maxEnvLightsOnScreen = 64, maxDecalsOnScreen = 512, maxPlanarReflectionOnScreen = 16, maxLightsPerClusterCell = 8, }; /// Cookie atlas resolution. [FormerlySerializedAs("cookieSize")] public CookieAtlasResolution cookieAtlasSize; /// Cookie atlas graphics format. public CookieAtlasGraphicsFormat cookieFormat; #if UNITY_2020_1_OR_NEWER #else /// Cookie atlas resolution for point lights. public CubeCookieResolution pointCookieSize; #endif /// Last valid mip for cookie atlas. public int cookieAtlasLastValidMip; // We keep this property for the migration code (we need to know how many cookies we could have before). [SerializeField, Obsolete("There is no more texture array for cookies, use cookie atlases properties instead.")] internal int cookieTexArraySize; /// Planar reflections atlas resolution. [FormerlySerializedAs("planarReflectionTextureSize")] public PlanarReflectionAtlasResolution planarReflectionAtlasSize; /// Maximum number of cached reflection probes. public int reflectionProbeCacheSize; /// Reflection probes resolution. public CubeReflectionResolution reflectionCubemapSize; /// Enable reflection probe cache compression. public bool reflectionCacheCompressed; /// Reflection probes resolution. public ReflectionAndPlanarProbeFormat reflectionProbeFormat; /// Resolution of the sky reflection cubemap. public SkyResolution skyReflectionSize; /// LayerMask used for sky lighting override. public LayerMask skyLightingOverrideLayerMask; /// Enable fabric specific convolution for probes and sky lighting. public bool supportFabricConvolution; /// Maximum number of directional lights at the same time on screen. public int maxDirectionalLightsOnScreen; /// Maximum number of punctual lights at the same time on screen. public int maxPunctualLightsOnScreen; /// Maximum number of area lights at the same time on screen. public int maxAreaLightsOnScreen; /// Maximum number of environment lights at the same time on screen. public int maxEnvLightsOnScreen; /// Maximum number of decals at the same time on screen. public int maxDecalsOnScreen; /// Maximum number of planar reflections at the same time on screen. public int maxPlanarReflectionOnScreen; /// Maximum number of lights per ray tracing light cluster cell. public int maxLightsPerClusterCell; } }