示例#1
0
        public override void DrawSectionMisc() // General Tab
        {
            var subCat = new GUIStyle(UnityEditor.EditorStyles.helpBox);

            subCat.padding = new RectOffset(0, 0, 10, 5);
            subCat.margin  = new RectOffset(0, 0, 0, 10);
            EditorGUI.indentLevel++;
            EditorGUILayout.BeginVertical(subCat);
            // Handle render texture precision mode
            EditorGUILayout.PropertyField(inspectorShowHelp);
            EditorGUILayout.Separator();
            EditorGUI.indentLevel--;

            if (GUILayout.Button("Open online documentation"))
            {
                Application.OpenURL("https://docs.google.com/document/d/1lhcYJwkueuVuHZnYdQVg2EqUb980VlH80_J9mvOwuPw/");
            }

            EditorGUILayout.EndVertical();

            // Draw Social Media
            EditorMacros.DrawSocial(styleHeader, styleContentBox);
        }
        public virtual void DrawSSAA()
        {
            // Draw Hint Box
            if (inspectorShowHelp.boolValue)
            {
                EditorGUI.indentLevel--;
                EditorGUILayout.HelpBox("Conventional SSAA settings. Higher settings produces better quality at the cost of performance. x0.5 boost the performance, but reduces the resolution.", MessageType.Info);
                EditorGUI.indentLevel++;
            }

            // Draw SSAA Settings
            ssaaMode = Getmode();
            ssaaMode = EditorGUILayout.Popup("SSAA Mode", ssaaMode, ssaaModeStrings);
            targetAsSSAA.SetAsSSAA((SSAAMode)ssaaMode);
            if (ssaaMode > 1)
            {
                DrawFSSAA();
            }

            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();

            // Draw SSAA Presets Title
            EditorMacros.DrawHeader("Edit SSAA Presets", styleHeader);
            var unsupportedFilter = false;

#if SSAA_HDRP || SSAA_URP
            if (targetAsSSAA.GetType() == typeof(MadGoatSSAA_VR))
            {
                EditorGUI.indentLevel--;
                EditorGUILayout.HelpBox("Downsampling Filtering on VR under Scriptable Render Pipelines is currently not supported", MessageType.Warning);
                EditorGUI.indentLevel++;
                unsupportedFilter = true;
            }
#endif
            EditorGUILayout.Separator();



            // Draw Profiles
            GUI.color = new Color(.8f, .8f, .8f);
            EditorGUILayout.BeginHorizontal(styleHeader);
            {
                GUI.color = Color.white;

                var str = "Multiplier: <b>" + targetAsSSAA.SsaaProfileHalf.multiplier + "x</b>  -  Filter: <b>"
                          + (targetAsSSAA.SsaaProfileHalf.useFilter ? targetAsSSAA.SsaaProfileHalf.filterType.ToString().ToLower() : "off") + "</b>";
                if (unsupportedFilter)
                {
                    str = "";
                }
                ssaaHalfUnfold           = EditorGUILayout.Foldout(ssaaHalfUnfold, "SSAA x0.5", true, styleFoldout);
                styleRichLabel.alignment = TextAnchor.MiddleCenter;
                EditorGUILayout.LabelField(str, styleRichLabel, GUILayout.MaxWidth(2560));
                styleRichLabel.alignment = TextAnchor.MiddleLeft;
                GUI.color = colorAccentPro;
                if (GUILayout.Button("Reset", GUILayout.MaxWidth(100), GUILayout.MinWidth(100)))
                {
                    targetAsSSAA.SsaaProfileHalf = new SsaaProfile(.5f, true, Filter.POINT, 0.8f, .95f);
                }
                GUI.color = Color.white;
            }

            EditorGUILayout.EndHorizontal();

            if (ssaaHalfUnfold)
            {
                EditorGUILayout.BeginVertical(styleContentBox);
                EditorGUILayout.PropertyField(ssaaProfileHalf.FindPropertyRelative("multiplier"));
                if (!unsupportedFilter)
                {
                    EditorGUILayout.PropertyField(ssaaProfileHalf.FindPropertyRelative("useFilter"));
                    EditorGUI.indentLevel += 1;
                    if (ssaaProfileHalf.FindPropertyRelative("useFilter").boolValue)
                    {
                        EditorGUILayout.PropertyField(ssaaProfileHalf.FindPropertyRelative("filterType"));
                        if (ssaaProfileHalf.FindPropertyRelative("filterType").enumValueIndex == 2)
                        {
                            EditorGUILayout.PropertyField(ssaaProfileHalf.FindPropertyRelative("sharpness"));
                        }
                        else if (ssaaProfileHalf.FindPropertyRelative("filterType").enumValueIndex == 1)
                        {
                            EditorGUILayout.PropertyField(ssaaProfileHalf.FindPropertyRelative("sharpness"));
                            EditorGUILayout.PropertyField(ssaaProfileHalf.FindPropertyRelative("sampleDistance"));
                        }
                    }
                    EditorGUI.indentLevel -= 1;
                }
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
            }

            GUI.color = new Color(.8f, .8f, .8f);
            EditorGUILayout.BeginHorizontal(styleHeader);
            {
                GUI.color = Color.white;

                var str = "Multiplier: <b>" + targetAsSSAA.SsaaProfileX2.multiplier + "x</b>  -  Filter: <b>"
                          + (targetAsSSAA.SsaaProfileX2.useFilter ? targetAsSSAA.SsaaProfileX2.filterType.ToString().ToLower() : "off") + "</b>";
                if (unsupportedFilter)
                {
                    str = "";
                }
                ssaaX2Unfold             = EditorGUILayout.Foldout(ssaaX2Unfold, "SSAA x2", true, styleFoldout);
                styleRichLabel.alignment = TextAnchor.MiddleCenter;
                EditorGUILayout.LabelField(str, styleRichLabel, GUILayout.MaxWidth(2560));
                styleRichLabel.alignment = TextAnchor.MiddleLeft;
                GUI.color = colorAccentPro;
                if (GUILayout.Button("Reset", GUILayout.MaxWidth(100), GUILayout.MinWidth(100)))
                {
                    targetAsSSAA.SsaaProfileX2 = new SsaaProfile(1.4f, true, Filter.BICUBIC, 0.8f, .95f);
                }
                GUI.color = Color.white;
            }
            EditorGUILayout.EndHorizontal();
            if (ssaaX2Unfold)
            {
                EditorGUILayout.BeginVertical(styleContentBox);
                EditorGUILayout.PropertyField(ssaaProfileX2.FindPropertyRelative("multiplier"));
                if (!unsupportedFilter)
                {
                    EditorGUILayout.PropertyField(ssaaProfileX2.FindPropertyRelative("useFilter"));
                    EditorGUI.indentLevel += 1;
                    if (ssaaProfileX2.FindPropertyRelative("useFilter").boolValue)
                    {
                        EditorGUILayout.PropertyField(ssaaProfileX2.FindPropertyRelative("filterType"));
                        if (ssaaProfileX2.FindPropertyRelative("filterType").enumValueIndex == 2)
                        {
                            EditorGUILayout.PropertyField(ssaaProfileX2.FindPropertyRelative("sharpness"));
                        }
                        else if (ssaaProfileX2.FindPropertyRelative("filterType").enumValueIndex == 1)
                        {
                            EditorGUILayout.PropertyField(ssaaProfileX2.FindPropertyRelative("sharpness"));
                            EditorGUILayout.PropertyField(ssaaProfileX2.FindPropertyRelative("sampleDistance"));
                        }
                    }
                    EditorGUI.indentLevel -= 1;
                }
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
            }

            GUI.color = new Color(.8f, .8f, .8f);
            EditorGUILayout.BeginHorizontal(styleHeader);
            {
                GUI.color = Color.white;
                var str = "Multiplier: <b>" + targetAsSSAA.SsaaProfileX4.multiplier + "x</b>  -  Filter: <b>"
                          + (targetAsSSAA.SsaaProfileX4.useFilter ? targetAsSSAA.SsaaProfileX4.filterType.ToString().ToLower() : "off") + "</b>";
                if (unsupportedFilter)
                {
                    str = "";
                }
                ssaaX4Unfold             = EditorGUILayout.Foldout(ssaaX4Unfold, "SSAA x4", true, styleFoldout);
                styleRichLabel.alignment = TextAnchor.MiddleCenter;
                EditorGUILayout.LabelField(str, styleRichLabel, GUILayout.MaxWidth(2560));
                styleRichLabel.alignment = TextAnchor.MiddleLeft;
                GUI.color = colorAccentPro;
                if (GUILayout.Button("Reset", GUILayout.MaxWidth(100), GUILayout.MinWidth(100)))
                {
                    targetAsSSAA.SsaaProfileX4 = new SsaaProfile(2.0f, true, Filter.BICUBIC, 0.8f, .95f);
                }
                GUI.color = Color.white;
            }
            EditorGUILayout.EndHorizontal();
            if (ssaaX4Unfold)
            {
                EditorGUILayout.BeginVertical(styleContentBox);
                EditorGUILayout.PropertyField(ssaaProfileX4.FindPropertyRelative("multiplier"));
                if (!unsupportedFilter)
                {
                    EditorGUILayout.PropertyField(ssaaProfileX4.FindPropertyRelative("useFilter"));
                    EditorGUI.indentLevel += 1;
                    if (ssaaProfileX4.FindPropertyRelative("useFilter").boolValue)
                    {
                        EditorGUILayout.PropertyField(ssaaProfileX4.FindPropertyRelative("filterType"));
                        if (ssaaProfileX4.FindPropertyRelative("filterType").enumValueIndex == 2)
                        {
                            EditorGUILayout.PropertyField(ssaaProfileX4.FindPropertyRelative("sharpness"));
                        }
                        else if (ssaaProfileX4.FindPropertyRelative("filterType").enumValueIndex == 1)
                        {
                            EditorGUILayout.PropertyField(ssaaProfileX4.FindPropertyRelative("sharpness"));
                            EditorGUILayout.PropertyField(ssaaProfileX4.FindPropertyRelative("sampleDistance"));
                        }
                    }
                    EditorGUI.indentLevel -= 1;
                }
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
            }

            EditorGUILayout.Separator();
        }
        public virtual void DrawSectionMisc() // General Tab
        {
            #region Extension IPointer Events
            bool extensionIPointerEventsSupport = targetAsSSAA.ExtensionIPointerEvents.IsSupported();
            if (extensionIPointerEventsSupport)
            {
                GUI.color = extensionIPointerEvents.FindPropertyRelative("enabled").boolValue ? new Color(.5f, 1f, .5f) : new Color(.8f, .8f, .8f);
            }
            else
            {
                GUI.color = new Color(1f, .3f, .3f);
            }
            EditorGUILayout.BeginHorizontal(styleHeader);
            {
                GUI.color = Color.white;
                EditorGUI.indentLevel++;
                extensionIPointerEvents.FindPropertyRelative("inspectorFoldout").boolValue = EditorGUILayout.Foldout(
                    extensionIPointerEvents.FindPropertyRelative("inspectorFoldout").boolValue,
                    "Unity IPointerEvents Integration",
                    true,
                    styleFoldout);
                EditorGUI.indentLevel--;
                GUI.color = colorAccentPro;
                if (GUILayout.Button(extensionIPointerEvents.FindPropertyRelative("enabled").boolValue ? "Disable" : "Enable", GUILayout.MaxWidth(100), GUILayout.MinWidth(100)))
                {
                    targetAsSSAA.enabled = false;
                    targetAsSSAA.ExtensionIPointerEvents.enabled = !targetAsSSAA.ExtensionIPointerEvents.enabled;
                    targetAsSSAA.enabled = true;
                }
                GUI.color = Color.white;
            }
            EditorGUILayout.EndHorizontal();
            if (extensionIPointerEvents.FindPropertyRelative("inspectorFoldout").boolValue)
            {
                EditorGUILayout.BeginVertical(styleContentBox);
                EditorGUILayout.HelpBox(SSAAExtensionPointerEventsSupport.description, MessageType.Info);
                EditorGUILayout.PropertyField(extensionIPointerEvents.FindPropertyRelative("eventsLayerMask"));
                EditorGUILayout.EndVertical();
            }
            #endregion

            #region Extension Post Processing Stack 2
            bool extensionPostProcessingStackSupport = targetAsSSAA.ExtensionPostProcessingStack.IsSupported();
            if (extensionPostProcessingStackSupport)
            {
                GUI.color = extensionPostProcessingStack.FindPropertyRelative("enabled").boolValue ? new Color(.5f, 1f, .5f) : new Color(.8f, .8f, .8f);
            }
            else
            {
                GUI.color = new Color(1f, .3f, .3f);
            }
            EditorGUILayout.BeginHorizontal(styleHeader);
            {
                GUI.color = Color.white;
                EditorGUI.indentLevel++;
                extensionPostProcessingStack.FindPropertyRelative("inspectorFoldout").boolValue = EditorGUILayout.Foldout(
                    extensionPostProcessingStack.FindPropertyRelative("inspectorFoldout").boolValue,
                    "Unity PostProcessing Stack V2 Integration",
                    true,
                    styleFoldout);

                EditorGUI.indentLevel--;
                GUI.color = colorAccentPro;
                if (extensionPostProcessingStackSupport)
                {
                    if (GUILayout.Button(extensionPostProcessingStack.FindPropertyRelative("enabled").boolValue ? "Disable" : "Enable", GUILayout.MaxWidth(100), GUILayout.MinWidth(100)))
                    {
                        targetAsSSAA.enabled = false;
                        targetAsSSAA.ExtensionPostProcessingStack.enabled = !targetAsSSAA.ExtensionPostProcessingStack.enabled;
                        targetAsSSAA.enabled = true;
                    }
                }
                GUI.color = Color.white;
            }
            EditorGUILayout.EndHorizontal();
            if (extensionPostProcessingStack.FindPropertyRelative("inspectorFoldout").boolValue)
            {
                EditorGUILayout.BeginVertical(styleContentBox);
                if (extensionPostProcessingStackSupport)
                {
                    EditorGUILayout.HelpBox(SSAAExtensionPostProcessingStack2.description, MessageType.Info);
                    EditorGUILayout.PropertyField(extensionPostProcessingStack.FindPropertyRelative("updateFromOriginal"));
                    EditorGUILayout.PropertyField(extensionPostProcessingStack.FindPropertyRelative("lwrpLegacySupport"));
                }
                else
                {
                    EditorGUILayout.HelpBox(SSAAExtensionPostProcessingStack2.requirement, MessageType.Error);
                }
                EditorGUILayout.EndVertical();
            }
            #endregion

            #region Extension Cinemachine
            bool extensionCinemachineSupport = targetAsSSAA.ExtensionCinemachine.IsSupported();
            if (extensionCinemachineSupport)
            {
                GUI.color = extensionCinemachine.FindPropertyRelative("enabled").boolValue ? new Color(.5f, 1f, .5f) : new Color(.8f, .8f, .8f);
            }
            else
            {
                GUI.color = new Color(1f, .3f, .3f);
            }
            EditorGUILayout.BeginHorizontal(styleHeader);
            {
                GUI.color = Color.white;
                EditorGUI.indentLevel++;
                extensionCinemachine.FindPropertyRelative("inspectorFoldout").boolValue = EditorGUILayout.Foldout(
                    extensionCinemachine.FindPropertyRelative("inspectorFoldout").boolValue,
                    "Unity Cinemachine Integration",
                    true,
                    styleFoldout);

                EditorGUI.indentLevel--;
                GUI.color = colorAccentPro;
                if (extensionCinemachineSupport)
                {
                    if (GUILayout.Button(extensionCinemachine.FindPropertyRelative("enabled").boolValue ? "Disable" : "Enable", GUILayout.MaxWidth(100), GUILayout.MinWidth(100)))
                    {
                        targetAsSSAA.enabled = false;
                        targetAsSSAA.ExtensionCinemachine.enabled = !targetAsSSAA.ExtensionCinemachine.enabled;
                        if (targetAsSSAA.ExtensionCinemachine.enabled)
                        {
                            SymbolDefineUtils.AddDefine("SSAA_CINEMACHINE");
                        }
                        else
                        {
                            SymbolDefineUtils.RemoveDefine("SSAA_CINEMACHINE");
                        }
                        targetAsSSAA.enabled = true;
                    }
                }
                GUI.color = Color.white;
            }
            EditorGUILayout.EndHorizontal();
            if (extensionCinemachine.FindPropertyRelative("inspectorFoldout").boolValue)
            {
                EditorGUILayout.BeginVertical(styleContentBox);
                if (extensionCinemachineSupport)
                {
                    EditorGUILayout.HelpBox(SSAAExtensionCinemachine.description, MessageType.Info);
                    EditorGUILayout.PropertyField(extensionCinemachine.FindPropertyRelative("updateFromOriginal"));
                }
                else
                {
                    EditorGUILayout.HelpBox(SSAAExtensionCinemachine.requirement, MessageType.Error);
                }
                EditorGUILayout.EndVertical();
            }
            #endregion

            // Draw Extensions
            EditorMacros.DrawHeader("Misc", styleHeader);
            EditorGUI.indentLevel++;
            EditorGUILayout.BeginVertical(styleContentBox);
            // Handle render texture precision mode
            if (!Application.isPlaying)
            {
                currentMode = internalTextureFormat.enumValueIndex == (int)RenderTextureFormat.ARGBFloat ? TextureMode.Float : TextureMode.Half;
                var oldMode = currentMode;
                currentMode = (TextureMode)EditorGUILayout.EnumPopup(new GUIContent("Render Texture Precision"), currentMode);
                internalTextureFormat.enumValueIndex = currentMode == TextureMode.Half ? (int)RenderTextureFormat.ARGBHalf : (int)RenderTextureFormat.ARGBFloat;
                if (oldMode != currentMode)
                {
                    targetAsSSAA.Refresh();
                }
            }
            EditorGUILayout.PropertyField(inspectorShowHelp);
            EditorGUILayout.Separator();
            EditorGUI.indentLevel--;
            if (GUILayout.Button("Open online documentation"))
            {
                Application.OpenURL("https://github.com/MadGoat-Studio/MadGoat-SSAA-Resolution-Scale/wiki");
            }

            EditorGUILayout.EndVertical();

            // Draw Social Media
            EditorMacros.DrawSocial(styleHeader, styleContentBox);
        }
        public virtual void DrawSectionScreenshot() // Screenshot Tab
        {
            EditorGUI.indentLevel++;
            EditorGUILayout.BeginVertical(styleContentBox);
            EditorGUILayout.PropertyField(screenshotPath, new GUIContent("Save path"));
            EditorGUILayout.PropertyField(screenshotPrefixIsProduct);
            if (!screenshotPrefixIsProduct.boolValue)
            {
                EditorGUILayout.PropertyField(screenshotPrefix, new GUIContent("File Name Prefix"));
            }


            EditorGUILayout.Space();
            EditorGUILayout.Separator();
            EditorGUILayout.PropertyField(screenshotCaptureSettings.FindPropertyRelative("outputResolution"), new GUIContent("Screenshot Resolution"));

            // the screenshot module
            EditorGUILayout.PropertyField(screenshotFormat, new GUIContent("Output Image Format"));

            EditorGUI.indentLevel++;
            if (screenshotFormat.enumValueIndex == 0)
            {
                EditorGUILayout.PropertyField(screenshotQuality, new GUIContent("JPG Quality"));
            }
            if (screenshotFormat.enumValueIndex == 2)
            {
                EditorGUILayout.PropertyField(screenshotExr32, new GUIContent("32-bit EXR"));
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();

            var res    = targetAsSSAA.ScreenshotCaptureSettings.outputResolution * targetAsSSAA.ScreenshotCaptureSettings.screenshotMultiplier;
            var width  = (int)res.x;
            var height = (int)res.y;

            EditorMacros.DrawHeader("Render Resolution - " + width + " x " + height, styleHeader);
            //GUILayout.Label(, accent_style);

            EditorGUILayout.BeginVertical(styleContentBox);
            EditorGUILayout.PropertyField(screenshotCaptureSettings.FindPropertyRelative("screenshotMultiplier"), new GUIContent("Render Resolution Multiplier"));
            EditorGUILayout.PropertyField(screenshotCaptureSettings.FindPropertyRelative("postAntiAliasing"));
            EditorGUILayout.Separator();
            EditorGUILayout.PropertyField(screenshotCaptureSettings.FindPropertyRelative("downsamplerEnabled"), new GUIContent("Use Filter"));
            if (screenshotCaptureSettings.FindPropertyRelative("downsamplerEnabled").boolValue)
            {
                EditorGUILayout.PropertyField(screenshotCaptureSettings.FindPropertyRelative("downsamplerFilter"));
                EditorGUI.indentLevel++;
                if (screenshotCaptureSettings.FindPropertyRelative("downsamplerFilter").enumValueIndex == 2)
                {
                    screenshotCaptureSettings.FindPropertyRelative("downsamplerSharpness").floatValue = EditorGUILayout.Slider("Sharpness", screenshotCaptureSettings.FindPropertyRelative("downsamplerSharpness").floatValue, 0, 1);
                }
                else if (screenshotCaptureSettings.FindPropertyRelative("downsamplerFilter").enumValueIndex == 1)
                {
                    screenshotCaptureSettings.FindPropertyRelative("downsamplerSharpness").floatValue = EditorGUILayout.Slider("Sharpness", screenshotCaptureSettings.FindPropertyRelative("downsamplerSharpness").floatValue, 0, 1);
                    screenshotCaptureSettings.FindPropertyRelative("downsamplerDistance").floatValue  = EditorGUILayout.Slider("Sample Distance", screenshotCaptureSettings.FindPropertyRelative("downsamplerDistance").floatValue, 0, 1);
                }
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();
            if (GUILayout.Button(Application.isPlaying ? "Take Screenshot" : "Only available in play mode"))
            {
                if (Application.isPlaying)
                {
                    if (screenshotCaptureSettings.FindPropertyRelative("downsamplerEnabled").boolValue)
                    {
                        targetAsSSAA.TakeScreenshot(
                            targetAsSSAA.ScreenshotPath,
                            targetAsSSAA.ScreenshotCaptureSettings.outputResolution,
                            targetAsSSAA.ScreenshotCaptureSettings.screenshotMultiplier,
                            targetAsSSAA.ScreenshotCaptureSettings.downsamplerFilter,
                            targetAsSSAA.ScreenshotCaptureSettings.downsamplerSharpness,
                            targetAsSSAA.ScreenshotCaptureSettings.downsamplerDistance,
                            targetAsSSAA.ScreenshotCaptureSettings.postAntiAliasing
                            );
                    }
                    else
                    {
                        targetAsSSAA.TakeScreenshot(
                            targetAsSSAA.ScreenshotPath,
                            targetAsSSAA.ScreenshotCaptureSettings.outputResolution,
                            targetAsSSAA.ScreenshotCaptureSettings.screenshotMultiplier,
                            targetAsSSAA.ScreenshotCaptureSettings.postAntiAliasing
                            );
                    }
                }
            }
            EditorGUI.indentLevel--;
        }
        public virtual void DrawSectionSuperSampling()
        {
#if UNITY_2017_2_OR_NEWER
            EditorApplication.QueuePlayerLoopUpdate();
#endif
            EditorGUILayout.BeginVertical(styleContentBox);
            // SSAA tab
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(internalRenderMode, new GUIContent("Operation mode"), true);
            if (targetAsSSAA.GetType() != typeof(MadGoatSSAA_VR))
            {
                EditorGUILayout.PropertyField(internalRenderLayerMask, new GUIContent("Internal Render Culling Mask"));
            }
            // Draw content based on supersampling type
            if (internalRenderMode.intValue == 0)       // SSAA presets
            {
                DrawSSAA();
            }
            else if (internalRenderMode.intValue == 1)  // Resolution scale
            {
                DrawResScale();
            }
            else if (internalRenderMode.intValue == 2)  // per axis
            {
                DrawPerAxis();
            }
            else if (internalRenderMode.intValue == 4)  // Custom
            {
                DrawCustom();
            }
            else                                        // Adaptive
            {
                DrawAdaptive();
            }

            // Draw downsampler settings
            if (internalRenderMode.intValue != 0)
            {
                // Title
                styleTitle.fontSize = 12;
                EditorMacros.DrawHeader("Downsampling", styleHeader);
                EditorGUILayout.BeginVertical(styleContentBox);
                var unsupportedFilter = false;

#if SSAA_HDRP || SSAA_URP
                if (targetAsSSAA.GetType() == typeof(MadGoatSSAA_VR))
                {
                    EditorGUI.indentLevel--;
                    EditorGUILayout.HelpBox("Downsampling Filtering on VR under Scriptable Render Pipelines is currently not supported", MessageType.Warning);
                    EditorGUI.indentLevel++;
                    unsupportedFilter = true;
                }
#endif

                if (!unsupportedFilter)
                {
                    // Hint box
                    if (inspectorShowHelp.boolValue)
                    {
                        EditorGUI.indentLevel--;
                        EditorGUILayout.HelpBox("If using image filtering, the render image will be passed through a custom downsampling filter. If not, it will be resized as is.", MessageType.Info);
                        EditorGUI.indentLevel++;
                    }

                    // Settings
                    downsamplerEnabled.boolValue = EditorGUILayout.Toggle("Use Filter", downsamplerEnabled.boolValue);
                    if (downsamplerEnabled.boolValue)
                    {
                        EditorGUILayout.PropertyField(downsamplerFilter, new GUIContent("Downsampler Filter"));
                        downsamplerSharpness.floatValue = EditorGUILayout.Slider("Downsampler Sharpness", downsamplerSharpness.floatValue, 0f, 1f);

                        if (downsamplerFilter.intValue == 1)
                        {
                            downsamplerDistance.floatValue = EditorGUILayout.Slider("Distance Between Samples", downsamplerDistance.floatValue, 0.5f, 2f);
                        }
                    }
                    EditorGUILayout.Separator();
                }
                EditorGUILayout.EndVertical();
            }
            // Dpdate vertical for later usage in ui
            if (internalRenderMode.intValue != 2)
            {
                internalRenderMultiplierVertical.floatValue = internalRenderMultiplier.floatValue;
            }
            EditorGUI.indentLevel--;
        }
        public override void OnInspectorGUI()
        {
            SetupStyles();

            serializedTarget.Update();

            // Draw Title "MadGoat SSAA & Resolution Scale 2"
            EditorMacros.DrawTitle("MadGoat SSAA & Resolution Scale 2", styleTitle);

            var pipeline = RenderPipelineUtils.DetectPipeline();

            if (pipeline != RenderPipelineUtils.PipelineType.Unsupported)
            {
                // Draw Main Tab
                mainTab = GUILayout.Toolbar(mainTab, new string[] { "Super Sampling", "Screenshot", "Integrations & Misc" });
                EditorGUILayout.Separator();

                // Get current render resolution
                int width  = 0;
                int height = 0;
                if (targetAsSSAA.GetType() != typeof(MadGoatSSAA_VR))
                {
                    if (targetAsSSAA.RenderCamera && targetAsSSAA.RenderCamera.targetTexture)
                    {
                        width  = targetAsSSAA.RenderCamera.targetTexture.width;
                        height = targetAsSSAA.RenderCamera.targetTexture.height;
                    }
                }
                else
                {
#if UNITY_2017_2_OR_NEWER
                    width  = (int)(UnityEngine.XR.XRSettings.eyeTextureWidth * targetAsSSAA.InternalRenderMultiplier);
                    height = (int)(UnityEngine.XR.XRSettings.eyeTextureHeight * targetAsSSAA.InternalRenderMultiplier);
#else
                    width  = (int)(UnityEngine.VR.VRSettings.eyeTextureWidth * targetAsSSAA.InternalRenderMultiplier);
                    height = (int)(UnityEngine.VR.VRSettings.eyeTextureHeight * targetAsSSAA.InternalRenderMultiplier);
#endif
                }
                var resolution = width + " x " + height + " (x" + targetAsSSAA.InternalRenderMultiplier + ")";
                if (targetAsSSAA != null && targetAsSSAA.GetType() != typeof(MadGoatSSAA_VR) && targetAsSSAA.CurrentCamera != null && targetAsSSAA.CurrentCamera.targetTexture != null)
                {
                    resolution += " - Output is texture";
                }

                // Draw Content Header
                EditorMacros.DrawHeader(new string[] { "Super Sampling Settings - " + resolution, "Screenshot Settings", "Integrations" }[mainTab], styleHeader);

                // Draw Content
                switch (mainTab)
                {
                case 0:
                    DrawSectionSuperSampling();
                    break;

                case 1:
                    DrawSectionScreenshot();
                    break;

                case 2:
                    DrawSectionMisc();
                    break;
                }
            }
            else
            {
                EditorGUILayout.HelpBox("<b>Unsupported RenderPipeline detected.</b> \n\n" +
                                        "Pipeline Requirements: \n" +
                                        "   - HDRP: Unity 2019.1 or newer \n" +
                                        "   - HDRP + DXR: Unity 2019.3 or newer \n" +
                                        "   - Universal Pipeline: Unity 2019.3 or newer \n" +
                                        "   - Built-in: Unity 5 or newer", MessageType.Error);
            }

            // Draw Version Footer
            var versionStr = RenderPipelineUtils.DetectPipeline().ToString();
#if UNITY_2019_3_OR_NEWER && SSAA_HDRP && ENABLE_RAYTRACING
            versionStr += " <b>(DXR Enabled)</b>";
#endif
            EditorMacros.DrawVersion(SsaaUtils.ssaaversion, versionStr, styleNormal);

            // Apply modifications
            serializedTarget.ApplyModifiedProperties();
        }