Ejemplo n.º 1
0
        static DebugUI.HistoryEnumField GenerateHistoryEnumField(HDRenderPipelineAsset hdrpAsset, ref FrameSettingsHistory frameSettings, FrameSettingsField field, FrameSettingsFieldAttribute attribute, Type autoEnum)
        {
            Camera camera        = frameSettings.camera;
            var    renderType    = frameSettings.defaultType;
            string displayIndent = "";

            for (int indent = 0; indent < attribute.indentLevel; ++indent)
            {
                displayIndent += "  ";
            }
            return(new DebugUI.HistoryEnumField
            {
                displayName = displayIndent + attribute.displayedName,
                getter = () => frameSettingsHistory[camera].debug.IsEnabled(field) ? 1 : 0,
                setter = value =>
                {
                    var tmp = frameSettingsHistory[camera]; //indexer with struct will create a copy
                    tmp.debug.SetEnabled(field, value == 1);
                    frameSettingsHistory[camera] = tmp;
                },
                autoEnum = autoEnum,

                // Contrarily to other enum of DebugMenu, we do not need to stock index as
                // it can be computed again with data in the dedicated debug section of history
                getIndex = () => frameSettingsHistory[camera].debug.IsEnabled(field) ? 1 : 0,
                setIndex = (int a) => { },

                historyIndexGetter = new Func <int>[]
                {
                    () => frameSettingsHistory[camera].sanitazed.IsEnabled(field) ? 1 : 0,
                    () => frameSettingsHistory[camera].overridden.IsEnabled(field) ? 1 : 0,
                    () => hdrpAsset.GetDefaultFrameSettings(renderType).IsEnabled(field) ? 1 : 0
                }
            });
        }
Ejemplo n.º 2
0
        static DebugUI.HistoryBoolField GenerateHistoryBoolField(HDRenderPipelineAsset hdrpAsset, ref FrameSettingsHistory frameSettings, FrameSettingsField field, FrameSettingsFieldAttribute attribute)
        {
            Camera camera        = frameSettings.camera;
            var    renderType    = frameSettings.defaultType;
            string displayIndent = "";

            for (int indent = 0; indent < attribute.indentLevel; ++indent)
            {
                displayIndent += "  ";
            }
            return(new DebugUI.HistoryBoolField
            {
                displayName = displayIndent + attribute.displayedName,
                getter = () => frameSettingsHistory[camera].debug.IsEnabled(field),
                setter = value =>
                {
                    var tmp = frameSettingsHistory[camera]; //indexer with struct will create a copy
                    tmp.debug.SetEnabled(field, value);
                    frameSettingsHistory[camera] = tmp;
                },
                historyGetter = new Func <bool>[]
                {
                    () => frameSettingsHistory[camera].sanitazed.IsEnabled(field),
                    () => frameSettingsHistory[camera].overridden.IsEnabled(field),
                    () => hdrpAsset.GetDefaultFrameSettings(renderType).IsEnabled(field)
                }
            });
        }
Ejemplo n.º 3
0
 /// <summary>Same than FrameSettings.AggregateFrameSettings but keep history of agregation in a collection for DebugMenu.
 /// Aggregation is default with override of the renderer then sanitazed depending on supported features of hdrpasset. Then the DebugMenu override occurs.</summary>
 /// <param name="aggregatedFrameSettings">The aggregated FrameSettings result.</param>
 /// <param name="camera">The camera rendering.</param>
 /// <param name="additionalData">Additional data of the camera rendering.</param>
 /// <param name="hdrpAsset">HDRenderPipelineAsset contening default FrameSettings.</param>
 public static void AggregateFrameSettings(ref FrameSettings aggregatedFrameSettings, Camera camera, HDAdditionalCameraData additionalData, HDRenderPipelineAsset hdrpAsset)
 => AggregateFrameSettings(
     ref aggregatedFrameSettings,
     camera,
     additionalData,
     ref hdrpAsset.GetDefaultFrameSettings(additionalData?.defaultFrameSettings ?? FrameSettingsRenderType.Camera),     //fallback on Camera for SceneCamera and PreviewCamera
     hdrpAsset.currentPlatformRenderPipelineSettings
     );