Beispiel #1
0
        static OverridableFrameSettingsArea GetFrameSettingSectionContent(int group, SerializedFrameSettings serialized, Editor owner)
        {
            FrameSettings?defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var           area = OverridableFrameSettingsArea.GetGroupContent(group, defaultFrameSettings, serialized);

            return(area);
        }
        static OverridableFrameSettingsArea GetFrameSettingSectionContent(int group, SerializedFrameSettings serialized, Editor owner)
        {
            RenderPipelineSettings hdrpSettings         = GetHDRPAssetFor(owner).currentPlatformRenderPipelineSettings;
            FrameSettings          defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var area = OverridableFrameSettingsArea.GetGroupContent(group, defaultFrameSettings, serialized);

            return(area);
        }
Beispiel #3
0
        static void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            RenderPipelineSettings hdrpSettings         = GetHDRPAssetFor(owner).currentPlatformRenderPipelineSettings;
            FrameSettings          defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var area = OverridableFrameSettingsArea.GetGroupContent(1, defaultFrameSettings, serialized);

            area.AmmendInfo(FrameSettingsField.Shadowmask, overrideable: () => hdrpSettings.supportShadowMask);
            area.AmmendInfo(FrameSettingsField.SSR, overrideable: () => hdrpSettings.supportSSR);
            area.AmmendInfo(FrameSettingsField.TransparentSSR, overrideable: () => (hdrpSettings.supportSSR && hdrpSettings.supportSSRTransparent));
            area.AmmendInfo(FrameSettingsField.SSAO, overrideable: () => hdrpSettings.supportSSAO);
            area.AmmendInfo(FrameSettingsField.SSGI, overrideable: () => hdrpSettings.supportSSGI);
            area.AmmendInfo(FrameSettingsField.VolumetricClouds, overrideable: () => hdrpSettings.supportVolumetricClouds);

            // SSS
            area.AmmendInfo(
                FrameSettingsField.SubsurfaceScattering,
                overridedDefaultValue: hdrpSettings.supportSubsurfaceScattering,
                overrideable: () => hdrpSettings.supportSubsurfaceScattering
                );
            area.AmmendInfo(
                FrameSettingsField.SssQualityMode,
                overridedDefaultValue: SssQualityMode.FromQualitySettings,
                customGetter: () => serialized.sssQualityMode.GetEnumValue <SssQualityMode>(),
                customSetter: v => serialized.sssQualityMode.SetEnumValue((SssQualityMode)v),
                overrideable: () => hdrpSettings.supportSubsurfaceScattering &&
                (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false),
                ignoreDependencies: true,
                hasMixedValues: serialized.sssQualityMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.SssQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter:       () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.sssQualityLevel.intValue, // 3 levels
                            customSetter:       v => serialized.sssQualityLevel.intValue = Math.Max(0, Math.Min((int)v, 2)),     // Levels 0-2
                            overrideable: () => hdrpSettings.supportSubsurfaceScattering &&
                            (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) &&
                            (serialized.sssQualityMode.GetEnumValue <SssQualityMode>() == SssQualityMode.FromQualitySettings),
                            ignoreDependencies: true,
                            hasMixedValues: serialized.sssQualityLevel.hasMultipleDifferentValues
                            );
            area.AmmendInfo(FrameSettingsField.SssCustomSampleBudget,
                            overridedDefaultValue: (int)DefaultSssSampleBudgetForQualityLevel.Low,
                            customGetter:       () => serialized.sssCustomSampleBudget.intValue,
                            customSetter:       v => serialized.sssCustomSampleBudget.intValue = Math.Max(1, Math.Min((int)v, (int)DefaultSssSampleBudgetForQualityLevel.Max)),
                            overrideable: () => hdrpSettings.supportSubsurfaceScattering &&
                            (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) &&
                            (serialized.sssQualityMode.GetEnumValue <SssQualityMode>() != SssQualityMode.FromQualitySettings),
                            ignoreDependencies: true,
                            hasMixedValues: serialized.sssCustomSampleBudget.hasMultipleDifferentValues
                            );

            area.AmmendInfo(FrameSettingsField.Volumetrics, overrideable: () => hdrpSettings.supportVolumetrics);
            area.AmmendInfo(FrameSettingsField.ReprojectionForVolumetrics, overrideable: () => hdrpSettings.supportVolumetrics);
            area.AmmendInfo(FrameSettingsField.LightLayers, overrideable: () => hdrpSettings.supportLightLayers);
            area.AmmendInfo(FrameSettingsField.ProbeVolume, overrideable: () => hdrpSettings.supportProbeVolume);
            area.AmmendInfo(FrameSettingsField.ScreenSpaceShadows, overrideable: () => hdrpSettings.hdShadowInitParams.supportScreenSpaceShadows);
            area.Draw(withOverride);
        }
Beispiel #4
0
        static internal void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            bool isGUIenabled = GUI.enabled;

            FrameSettings?         defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var                    hdrpAsset            = GetHDRPAssetFor(owner);
            RenderPipelineSettings qualityLevelSettings = hdrpAsset?.currentPlatformRenderPipelineSettings ?? default;

            var area = OverridableFrameSettingsArea.GetGroupContent(1, defaultFrameSettings, serialized);

            area.AmmendInfo(FrameSettingsField.Volumetrics, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.ReprojectionForVolumetrics, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.TransparentSSR, ignoreDependencies: true);

            //TODO: Remove hideUI when out of experimental. I don't like hideUI it make things more difficult to add a FrameSettings at a given position.
            //      This should not be used except for experimental stuff (it is not compliant with the remaining of UX flows anyway)
            area.AmmendInfo(FrameSettingsField.ProbeVolume, hideInUI: !HDRenderPipelineGlobalSettings.Ensure().supportProbeVolumes);
            area.AmmendInfo(FrameSettingsField.NormalizeReflectionProbeWithProbeVolume, hideInUI: !HDRenderPipelineGlobalSettings.Ensure().supportProbeVolumes);

            area.AmmendInfo(
                FrameSettingsField.SssQualityMode,
                overridedDefaultValue: SssQualityMode.FromQualitySettings,
                customGetter: () => serialized.sssQualityMode.GetEnumValue <SssQualityMode>(),
                customSetter: v => serialized.sssQualityMode.SetEnumValue((SssQualityMode)v),
                overrideable: () => serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false,
                ignoreDependencies: true,
                hasMixedValues: serialized.sssQualityMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.SssQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.sssQualityLevel.intValue, // 3 levels
                            customSetter: v => serialized.sssQualityLevel.intValue = Math.Max(0, Math.Min((int)v, 2)),     // Levels 0-2
                            overrideable: () => (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) &&
                            (serialized.sssQualityMode.GetEnumValue <SssQualityMode>() == SssQualityMode.FromQualitySettings),
                            ignoreDependencies: true,
                            hasMixedValues: serialized.sssQualityLevel.hasMultipleDifferentValues
                            );
            area.AmmendInfo(FrameSettingsField.SssCustomSampleBudget,
                            overridedDefaultValue: (int)DefaultSssSampleBudgetForQualityLevel.Low,
                            customGetter: () => serialized.sssCustomSampleBudget.intValue,
                            customSetter: v => serialized.sssCustomSampleBudget.intValue = Math.Max(1, Math.Min((int)v, (int)DefaultSssSampleBudgetForQualityLevel.Max)),
                            overrideable: () => (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) &&
                            (serialized.sssQualityMode.GetEnumValue <SssQualityMode>() != SssQualityMode.FromQualitySettings),
                            ignoreDependencies: true,
                            hasMixedValues: serialized.sssCustomSampleBudget.hasMultipleDifferentValues
                            );
            area.Draw(withOverride);

            GUI.enabled = isGUIenabled;
        }
        static void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            RenderPipelineSettings hdrpSettings         = GetHDRPAssetFor(owner).currentPlatformRenderPipelineSettings;
            FrameSettings          defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var area = OverridableFrameSettingsArea.GetGroupContent(1, defaultFrameSettings, serialized);

            area.AmmendInfo(FrameSettingsField.Shadowmask, overrideable: () => hdrpSettings.supportShadowMask);
            area.AmmendInfo(FrameSettingsField.SSR, overrideable: () => hdrpSettings.supportSSR);
            area.AmmendInfo(FrameSettingsField.SSAO, overrideable: () => hdrpSettings.supportSSAO);
            area.AmmendInfo(FrameSettingsField.SubsurfaceScattering, overrideable: () => hdrpSettings.supportSubsurfaceScattering);
            area.AmmendInfo(FrameSettingsField.Volumetrics, overrideable: () => hdrpSettings.supportVolumetrics);
            area.AmmendInfo(FrameSettingsField.ReprojectionForVolumetrics, overrideable: () => hdrpSettings.supportVolumetrics);
            area.AmmendInfo(FrameSettingsField.LightLayers, overrideable: () => hdrpSettings.supportLightLayers);
            area.AmmendInfo(FrameSettingsField.ScreenSpaceShadows, overrideable: () => hdrpSettings.hdShadowInitParams.supportScreenSpaceShadows);
            area.Draw(withOverride);
        }
Beispiel #6
0
        static internal void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            bool isGUIenabled = GUI.enabled;

            FrameSettings?         defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var                    hdrpAsset            = GetHDRPAssetFor(owner);
            RenderPipelineSettings qualityLevelSettings = hdrpAsset?.currentPlatformRenderPipelineSettings ?? default;

            var area = OverridableFrameSettingsArea.GetGroupContent(1, defaultFrameSettings, serialized);

            area.AmmendInfo(FrameSettingsField.Volumetrics, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.ReprojectionForVolumetrics, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.TransparentSSR, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.ProbeVolume, hideInUI: !HDRenderPipelineGlobalSettings.Ensure().supportProbeVolumes);

            area.AmmendInfo(
                FrameSettingsField.SssQualityMode,
                overridedDefaultValue: SssQualityMode.FromQualitySettings,
                customGetter: () => serialized.sssQualityMode.GetEnumValue <SssQualityMode>(),
                customSetter: v => serialized.sssQualityMode.SetEnumValue((SssQualityMode)v),
                overrideable: () => serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false,
                ignoreDependencies: true,
                hasMixedValues: serialized.sssQualityMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.SssQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter:       () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.sssQualityLevel.intValue, // 3 levels
                            customSetter:       v => serialized.sssQualityLevel.intValue = Math.Max(0, Math.Min((int)v, 2)),     // Levels 0-2
                            overrideable: () => (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) &&
                            (serialized.sssQualityMode.GetEnumValue <SssQualityMode>() == SssQualityMode.FromQualitySettings),
                            ignoreDependencies: true,
                            hasMixedValues: serialized.sssQualityLevel.hasMultipleDifferentValues
                            );
            area.AmmendInfo(FrameSettingsField.SssCustomSampleBudget,
                            overridedDefaultValue: (int)DefaultSssSampleBudgetForQualityLevel.Low,
                            customGetter:       () => serialized.sssCustomSampleBudget.intValue,
                            customSetter:       v => serialized.sssCustomSampleBudget.intValue = Math.Max(1, Math.Min((int)v, (int)DefaultSssSampleBudgetForQualityLevel.Max)),
                            overrideable: () => (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) &&
                            (serialized.sssQualityMode.GetEnumValue <SssQualityMode>() != SssQualityMode.FromQualitySettings),
                            ignoreDependencies: true,
                            hasMixedValues: serialized.sssCustomSampleBudget.hasMultipleDifferentValues
                            );
            area.Draw(withOverride);

            GUI.enabled = isGUIenabled;
        }
        public static OverridableFrameSettingsArea GetGroupContent(int groupIndex, FrameSettings defaultFrameSettings, SerializedFrameSettings serializedFrameSettings)
        {
            if (!attributesGroup.ContainsKey(groupIndex) || attributesGroup[groupIndex] == null)
            {
                attributesGroup[groupIndex] = attributes?.Where(pair => pair.Value?.group == groupIndex)?.OrderBy(pair => pair.Value.orderInGroup);
            }
            if (!attributesGroup.ContainsKey(groupIndex))
            {
                throw new ArgumentException("Unknown groupIndex");
            }

            var area = new OverridableFrameSettingsArea(attributesGroup[groupIndex].Count(), defaultFrameSettings, serializedFrameSettings);

            foreach (var field in attributesGroup[groupIndex])
            {
                area.Add(field.Key);
            }
            return(area);
        }
        static void Drawer_SectionRenderingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            RenderPipelineSettings hdrpSettings         = GetHDRPAssetFor(owner).currentPlatformRenderPipelineSettings;
            FrameSettings          defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var area = OverridableFrameSettingsArea.GetGroupContent(0, defaultFrameSettings, serialized);

            LitShaderMode defaultShaderLitMode;

            switch (hdrpSettings.supportedLitShaderMode)
            {
            case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                defaultShaderLitMode = LitShaderMode.Forward;
                break;

            case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                defaultShaderLitMode = LitShaderMode.Deferred;
                break;

            case RenderPipelineSettings.SupportedLitShaderMode.Both:
                defaultShaderLitMode = defaultFrameSettings.litShaderMode;
                break;

            default:
                throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
            }

            area.AmmendInfo(FrameSettingsField.LitShaderMode,
                            overrideable: () => hdrpSettings.supportedLitShaderMode == RenderPipelineSettings.SupportedLitShaderMode.Both,
                            overridedDefaultValue: defaultShaderLitMode);

            bool hdrpAssetSupportForward         = hdrpSettings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly;
            bool hdrpAssetSupportDeferred        = hdrpSettings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly;
            bool frameSettingsOverrideToForward  = serialized.GetOverrides(FrameSettingsField.LitShaderMode) && serialized.litShaderMode == LitShaderMode.Forward;
            bool frameSettingsOverrideToDeferred = serialized.GetOverrides(FrameSettingsField.LitShaderMode) && serialized.litShaderMode == LitShaderMode.Deferred;
            bool defaultForwardUsed    = !serialized.GetOverrides(FrameSettingsField.LitShaderMode) && defaultShaderLitMode == LitShaderMode.Forward;
            bool defaultDefferedUsed   = !serialized.GetOverrides(FrameSettingsField.LitShaderMode) && defaultShaderLitMode == LitShaderMode.Deferred;
            bool msaaEnablable         = hdrpAssetSupportForward && hdrpSettings.supportMSAA && (frameSettingsOverrideToForward || defaultForwardUsed);
            bool depthPrepassEnablable = hdrpAssetSupportDeferred && (defaultDefferedUsed || frameSettingsOverrideToDeferred);

            area.AmmendInfo(FrameSettingsField.MSAA,
                            overrideable: () => msaaEnablable,
                            overridedDefaultValue: msaaEnablable && defaultFrameSettings.IsEnabled(FrameSettingsField.MSAA),
                            customOverrideable: () =>
            {
                switch (hdrpSettings.supportedLitShaderMode)
                {
                case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                    return(false);        //negative dependency

                case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                    return(true);        //negative dependency

                case RenderPipelineSettings.SupportedLitShaderMode.Both:
                    return(!(frameSettingsOverrideToForward || defaultForwardUsed));        //negative dependency

                default:
                    throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
                }
            });
            area.AmmendInfo(FrameSettingsField.DepthPrepassWithDeferredRendering,
                            overrideable: () => depthPrepassEnablable,
                            overridedDefaultValue: depthPrepassEnablable && defaultFrameSettings.IsEnabled(FrameSettingsField.DepthPrepassWithDeferredRendering),
                            customOverrideable: () =>
            {
                switch (hdrpSettings.supportedLitShaderMode)
                {
                case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                    return(false);

                case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                    return(true);

                case RenderPipelineSettings.SupportedLitShaderMode.Both:
                    return(frameSettingsOverrideToDeferred || defaultDefferedUsed);

                default:
                    throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
                }
            });

            area.AmmendInfo(FrameSettingsField.RayTracing, overrideable: () => hdrpSettings.supportRayTracing);
            area.AmmendInfo(FrameSettingsField.MotionVectors, overrideable: () => hdrpSettings.supportMotionVectors);
            area.AmmendInfo(FrameSettingsField.ObjectMotionVectors, overrideable: () => hdrpSettings.supportMotionVectors);
            area.AmmendInfo(FrameSettingsField.Decals, overrideable: () => hdrpSettings.supportDecals);
            area.AmmendInfo(FrameSettingsField.Distortion, overrideable: () => hdrpSettings.supportDistortion);

            area.AmmendInfo(
                FrameSettingsField.LODBiasMode,
                overridedDefaultValue: LODBiasMode.FromQualitySettings,
                customGetter: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>(),
                customSetter: v => serialized.lodBiasMode.SetEnumValue((LODBiasMode)v)
                );
            area.AmmendInfo(FrameSettingsField.LODBiasQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.lodBiasQualityLevel.intValue,
                            customSetter: v => serialized.lodBiasQualityLevel.intValue = (int)v,
                            customOverrideable: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>() != LODBiasMode.OverrideQualitySettings);

            area.AmmendInfo(FrameSettingsField.LODBias,
                            overridedDefaultValue: QualitySettings.lodBias,
                            customGetter: () => serialized.lodBias.floatValue,
                            customSetter: v => serialized.lodBias.floatValue = (float)v,
                            customOverrideable: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>() != LODBiasMode.FromQualitySettings,
                            labelOverride: serialized.lodBiasMode.GetEnumValue <LODBiasMode>() == LODBiasMode.ScaleQualitySettings ? "Scale Factor" : "LOD Bias");

            area.AmmendInfo(
                FrameSettingsField.MaximumLODLevelMode,
                overridedDefaultValue: MaximumLODLevelMode.FromQualitySettings,
                customGetter: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>(),
                customSetter: v => serialized.maximumLODLevelMode.SetEnumValue((MaximumLODLevelMode)v)
                );
            area.AmmendInfo(FrameSettingsField.MaximumLODLevelQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.maximumLODLevelQualityLevel.intValue,
                            customSetter: v => serialized.maximumLODLevelQualityLevel.intValue = (int)v,
                            customOverrideable: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() != MaximumLODLevelMode.OverrideQualitySettings);

            area.AmmendInfo(FrameSettingsField.MaximumLODLevel,
                            overridedDefaultValue: QualitySettings.maximumLODLevel,
                            customGetter: () => serialized.maximumLODLevel.intValue,
                            customSetter: v => serialized.maximumLODLevel.intValue = (int)v,
                            customOverrideable: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() != MaximumLODLevelMode.FromQualitySettings,
                            labelOverride: serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() == MaximumLODLevelMode.OffsetQualitySettings ? "Offset Factor" : "Maximum LOD Level");

            area.AmmendInfo(FrameSettingsField.MaterialQualityLevel,
                            overridedDefaultValue: defaultFrameSettings.materialQuality.Into(),
                            customGetter: () => ((MaterialQuality)serialized.materialQuality.intValue).Into(),
                            customSetter: v => serialized.materialQuality.intValue = (int)((MaterialQualityMode)v).Into()
                            );

            area.Draw(withOverride);
        }
Beispiel #9
0
        static internal void Drawer_SectionRenderingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            bool isGUIenabled = GUI.enabled;

            FrameSettings?defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var           area = OverridableFrameSettingsArea.GetGroupContent(0, defaultFrameSettings, serialized);

            area.AmmendInfo(FrameSettingsField.DepthPrepassWithDeferredRendering, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.ClearGBuffers, ignoreDependencies: true);

            area.AmmendInfo(FrameSettingsField.MSAAMode, ignoreDependencies: true);
            area.AmmendInfo(
                FrameSettingsField.MSAAMode,
                overridedDefaultValue: defaultFrameSettings?.msaaMode ?? MSAAMode.FromHDRPAsset,
                customGetter: () => serialized.msaaMode.GetEnumValue <MSAAMode>(),
                customSetter: v => serialized.msaaMode.SetEnumValue((MSAAMode)v),
                hasMixedValues: serialized.msaaMode.hasMultipleDifferentValues
                );

            area.AmmendInfo(FrameSettingsField.DecalLayers, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.ObjectMotionVectors, ignoreDependencies: true);
            area.AmmendInfo(FrameSettingsField.TransparentsWriteMotionVector, ignoreDependencies: true);

            var hdrpAsset = GetHDRPAssetFor(owner);
            RenderPipelineSettings qualityLevelSettings = hdrpAsset?.currentPlatformRenderPipelineSettings ?? default;

            area.AmmendInfo(
                FrameSettingsField.LODBiasMode,
                overridedDefaultValue: LODBiasMode.FromQualitySettings,
                customGetter: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>(),
                customSetter: v => serialized.lodBiasMode.SetEnumValue((LODBiasMode)v),
                hasMixedValues: serialized.lodBiasMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.LODBiasQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.lodBiasQualityLevel.intValue,
                            customSetter: v => serialized.lodBiasQualityLevel.intValue = (int)v,
                            overrideable: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>() != LODBiasMode.OverrideQualitySettings,
                            ignoreDependencies: true,
                            hasMixedValues: serialized.lodBiasQualityLevel.hasMultipleDifferentValues);

            area.AmmendInfo(FrameSettingsField.LODBias,
                            overridedDefaultValue: hdrpAsset ? qualityLevelSettings.lodBias[serialized.lodBiasQualityLevel.intValue] : 0,
                            customGetter: () => serialized.lodBias.floatValue,
                            customSetter: v => serialized.lodBias.floatValue = (float)v,
                            overrideable: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>() != LODBiasMode.FromQualitySettings,
                            ignoreDependencies: true,
                            labelOverride: serialized.lodBiasMode.GetEnumValue <LODBiasMode>() == LODBiasMode.ScaleQualitySettings ? "Scale Factor" : "LOD Bias",
                            hasMixedValues: serialized.lodBias.hasMultipleDifferentValues);

            area.AmmendInfo(
                FrameSettingsField.MaximumLODLevelMode,
                overridedDefaultValue: MaximumLODLevelMode.FromQualitySettings,
                customGetter: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>(),
                customSetter: v => serialized.maximumLODLevelMode.SetEnumValue((MaximumLODLevelMode)v),
                hasMixedValues: serialized.maximumLODLevelMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.MaximumLODLevelQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.maximumLODLevelQualityLevel.intValue,
                            customSetter: v => serialized.maximumLODLevelQualityLevel.intValue = (int)v,
                            overrideable: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() != MaximumLODLevelMode.OverrideQualitySettings,
                            ignoreDependencies: true,
                            hasMixedValues: serialized.maximumLODLevelQualityLevel.hasMultipleDifferentValues);

            area.AmmendInfo(FrameSettingsField.MaximumLODLevel,
                            overridedDefaultValue: hdrpAsset ? qualityLevelSettings.maximumLODLevel[serialized.maximumLODLevelQualityLevel.intValue] : 0,
                            customGetter: () => serialized.maximumLODLevel.intValue,
                            customSetter: v => serialized.maximumLODLevel.intValue = (int)v,
                            overrideable: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() != MaximumLODLevelMode.FromQualitySettings,
                            ignoreDependencies: true,
                            labelOverride: serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() == MaximumLODLevelMode.OffsetQualitySettings ? "Offset Factor" : "Maximum LOD Level",
                            hasMixedValues: serialized.maximumLODLevel.hasMultipleDifferentValues);

            area.AmmendInfo(FrameSettingsField.MaterialQualityLevel,
                            overridedDefaultValue: defaultFrameSettings?.materialQuality.Into() ?? MaterialQualityMode.Medium,
                            customGetter: () => ((MaterialQuality)serialized.materialQuality.intValue).Into(),
                            customSetter: v => serialized.materialQuality.intValue = (int)((MaterialQualityMode)v).Into(),
                            hasMixedValues: serialized.materialQuality.hasMultipleDifferentValues
                            );

            area.Draw(withOverride);
            GUI.enabled = isGUIenabled;
        }
        static void Drawer_SectionRenderingSettings(SerializedFrameSettings serialized, Editor owner, bool withOverride)
        {
            RenderPipelineSettings hdrpSettings         = GetHDRPAssetFor(owner).currentPlatformRenderPipelineSettings;
            FrameSettings          defaultFrameSettings = GetDefaultFrameSettingsFor(owner);
            var area = OverridableFrameSettingsArea.GetGroupContent(0, defaultFrameSettings, serialized);

            var frameSettingType = owner is IDefaultFrameSettingsType getType?getType.GetFrameSettingsType() : FrameSettingsRenderType.Camera;

            LitShaderMode defaultShaderLitMode;

            switch (hdrpSettings.supportedLitShaderMode)
            {
            case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                defaultShaderLitMode = LitShaderMode.Forward;
                break;

            case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                defaultShaderLitMode = LitShaderMode.Deferred;
                break;

            case RenderPipelineSettings.SupportedLitShaderMode.Both:
                defaultShaderLitMode = defaultFrameSettings.litShaderMode;
                break;

            default:
                throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
            }

            area.AmmendInfo(FrameSettingsField.LitShaderMode,
                            overrideable: () => hdrpSettings.supportedLitShaderMode == RenderPipelineSettings.SupportedLitShaderMode.Both,
                            overridedDefaultValue: defaultShaderLitMode);

            bool hdrpAssetSupportForward  = hdrpSettings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly;
            bool hdrpAssetSupportDeferred = hdrpSettings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly;
            bool hdrpAssetIsForward       = hdrpSettings.supportedLitShaderMode == RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly;
            bool hdrpAssetIsDeferred      = hdrpSettings.supportedLitShaderMode == RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly;

            bool frameSettingsOverrideToForward  = serialized.GetOverrides(FrameSettingsField.LitShaderMode) && serialized.litShaderMode == LitShaderMode.Forward;
            bool frameSettingsOverrideToDeferred = serialized.GetOverrides(FrameSettingsField.LitShaderMode) && serialized.litShaderMode == LitShaderMode.Deferred;
            bool defaultForwardUsed = !serialized.GetOverrides(FrameSettingsField.LitShaderMode) && defaultShaderLitMode == LitShaderMode.Forward;
            // Due to various reasons, MSAA and ray tracing are not compatible, if ray tracing is enabled on the asset. MSAA can not be enabled on the frame settings.
            bool msaaEnablable = hdrpSettings.supportMSAA && ((hdrpAssetSupportForward && (frameSettingsOverrideToForward || defaultForwardUsed)) || hdrpAssetIsForward) && !hdrpSettings.supportRayTracing;

            area.AmmendInfo(FrameSettingsField.MSAA,
                            overrideable: () => msaaEnablable,
                            overridedDefaultValue: msaaEnablable && defaultFrameSettings.IsEnabled(FrameSettingsField.MSAA),
                            customOverrideable: () =>
            {
                switch (hdrpSettings.supportedLitShaderMode)
                {
                case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                    return(false);        //negative dependency

                case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                    return(true);        //negative dependency

                case RenderPipelineSettings.SupportedLitShaderMode.Both:
                    return(!(frameSettingsOverrideToForward || defaultForwardUsed));        //negative dependency

                default:
                    throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
                }
            });

            bool defaultDeferredUsed   = !serialized.GetOverrides(FrameSettingsField.LitShaderMode) && defaultShaderLitMode == LitShaderMode.Deferred;
            bool depthPrepassEnablable = (hdrpAssetSupportDeferred && (defaultDeferredUsed || frameSettingsOverrideToDeferred)) || (hdrpAssetIsDeferred);

            area.AmmendInfo(FrameSettingsField.DepthPrepassWithDeferredRendering,
                            overrideable: () => depthPrepassEnablable,
                            overridedDefaultValue: depthPrepassEnablable && defaultFrameSettings.IsEnabled(FrameSettingsField.DepthPrepassWithDeferredRendering),
                            customOverrideable: () =>
            {
                switch (hdrpSettings.supportedLitShaderMode)
                {
                case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                    return(false);

                case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                    return(true);

                case RenderPipelineSettings.SupportedLitShaderMode.Both:
                    return(frameSettingsOverrideToDeferred || defaultDeferredUsed);

                default:
                    throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
                }
            });

            bool clearGBufferEnablable = (hdrpAssetSupportDeferred && (defaultDeferredUsed || frameSettingsOverrideToDeferred)) || (hdrpAssetIsDeferred);

            area.AmmendInfo(FrameSettingsField.ClearGBuffers,
                            overrideable: () => clearGBufferEnablable,
                            overridedDefaultValue: clearGBufferEnablable && defaultFrameSettings.IsEnabled(FrameSettingsField.ClearGBuffers),
                            customOverrideable: () =>
            {
                switch (hdrpSettings.supportedLitShaderMode)
                {
                case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                    return(false);

                case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                    return(true);

                case RenderPipelineSettings.SupportedLitShaderMode.Both:
                    return(frameSettingsOverrideToDeferred || defaultDeferredUsed);

                default:
                    throw new System.ArgumentOutOfRangeException("Unknown ShaderLitMode");
                }
            });

            area.AmmendInfo(FrameSettingsField.RayTracing, overrideable: () => hdrpSettings.supportRayTracing);
#if !ENABLE_VIRTUALTEXTURES
            area.AmmendInfo(FrameSettingsField.VirtualTexturing, overrideable: () => false);
#endif
            area.AmmendInfo(FrameSettingsField.MotionVectors, overrideable: () => hdrpSettings.supportMotionVectors);
            area.AmmendInfo(FrameSettingsField.ObjectMotionVectors, overrideable: () => hdrpSettings.supportMotionVectors);
            area.AmmendInfo(FrameSettingsField.TransparentsWriteMotionVector, overrideable: () => hdrpSettings.supportMotionVectors);
            area.AmmendInfo(FrameSettingsField.Decals, overrideable: () => hdrpSettings.supportDecals);
            area.AmmendInfo(FrameSettingsField.DecalLayers, overrideable: () => hdrpSettings.supportDecalLayers);
            area.AmmendInfo(FrameSettingsField.Distortion, overrideable: () => hdrpSettings.supportDistortion);

            area.AmmendInfo(FrameSettingsField.Postprocess, overrideable: () => (frameSettingType != FrameSettingsRenderType.CustomOrBakedReflection &&
                                                                                 frameSettingType != FrameSettingsRenderType.RealtimeReflection));

            area.AmmendInfo(
                FrameSettingsField.LODBiasMode,
                overridedDefaultValue: LODBiasMode.FromQualitySettings,
                customGetter: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>(),
                customSetter: v => serialized.lodBiasMode.SetEnumValue((LODBiasMode)v),
                hasMixedValues: serialized.lodBiasMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.LODBiasQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.lodBiasQualityLevel.intValue,
                            customSetter: v => serialized.lodBiasQualityLevel.intValue = (int)v,
                            customOverrideable: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>() != LODBiasMode.OverrideQualitySettings,
                            hasMixedValues: serialized.lodBiasQualityLevel.hasMultipleDifferentValues);

            area.AmmendInfo(FrameSettingsField.LODBias,
                            overridedDefaultValue: QualitySettings.lodBias,
                            customGetter: () => serialized.lodBias.floatValue,
                            customSetter: v => serialized.lodBias.floatValue = (float)v,
                            customOverrideable: () => serialized.lodBiasMode.GetEnumValue <LODBiasMode>() != LODBiasMode.FromQualitySettings,
                            labelOverride: serialized.lodBiasMode.GetEnumValue <LODBiasMode>() == LODBiasMode.ScaleQualitySettings ? "Scale Factor" : "LOD Bias",
                            hasMixedValues: serialized.lodBias.hasMultipleDifferentValues);

            area.AmmendInfo(
                FrameSettingsField.MaximumLODLevelMode,
                overridedDefaultValue: MaximumLODLevelMode.FromQualitySettings,
                customGetter: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>(),
                customSetter: v => serialized.maximumLODLevelMode.SetEnumValue((MaximumLODLevelMode)v),
                hasMixedValues: serialized.maximumLODLevelMode.hasMultipleDifferentValues
                );
            area.AmmendInfo(FrameSettingsField.MaximumLODLevelQualityLevel,
                            overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low,
                            customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.maximumLODLevelQualityLevel.intValue,
                            customSetter: v => serialized.maximumLODLevelQualityLevel.intValue = (int)v,
                            customOverrideable: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() != MaximumLODLevelMode.OverrideQualitySettings,
                            hasMixedValues: serialized.maximumLODLevelQualityLevel.hasMultipleDifferentValues);

            area.AmmendInfo(FrameSettingsField.MaximumLODLevel,
                            overridedDefaultValue: QualitySettings.maximumLODLevel,
                            customGetter: () => serialized.maximumLODLevel.intValue,
                            customSetter: v => serialized.maximumLODLevel.intValue = (int)v,
                            customOverrideable: () => serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() != MaximumLODLevelMode.FromQualitySettings,
                            labelOverride: serialized.maximumLODLevelMode.GetEnumValue <MaximumLODLevelMode>() == MaximumLODLevelMode.OffsetQualitySettings ? "Offset Factor" : "Maximum LOD Level",
                            hasMixedValues: serialized.maximumLODLevel.hasMultipleDifferentValues);

            area.AmmendInfo(FrameSettingsField.MaterialQualityLevel,
                            overridedDefaultValue: defaultFrameSettings.materialQuality.Into(),
                            customGetter: () => ((MaterialQuality)serialized.materialQuality.intValue).Into(),
                            customSetter: v => serialized.materialQuality.intValue = (int)((MaterialQualityMode)v).Into(),
                            hasMixedValues: serialized.materialQuality.hasMultipleDifferentValues
                            );

            area.Draw(withOverride);
        }