Esempio n. 1
0
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            var fxaaTarget = (FXAA)target;
            int selectedPreset = 2;

            if (fxaaTarget.preset.Equals(FXAA.Preset.extremePerformancePreset))
                selectedPreset = 0;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.performancePreset))
                selectedPreset = 1;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.defaultPreset))
                selectedPreset = 2;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.qualityPreset))
                selectedPreset = 3;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.extremeQualityPreset))
                selectedPreset = 4;

            EditorGUI.BeginChangeCheck();
            selectedPreset = EditorGUILayout.Popup("Preset", selectedPreset, presetNames);

            if (EditorGUI.EndChangeCheck())
            {
                if (selectedPreset < 0)
                    selectedPreset = 0;
                else if (selectedPreset > 4)
                    selectedPreset = 4;

                fxaaTarget.preset = FXAA.availablePresets[selectedPreset];
                return true;
            }
            return false;
        }
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            var fxaaTarget = (FXAA)target;

            if (!fxaaTarget.validSourceFormat)
                EditorGUILayout.HelpBox("FXAA should be used at the end of the post-processing stack after conversion to LDR (after Tonemapping) to maximize quality and avoid artifacts.", MessageType.Warning);

            int selectedPreset = 2;

            if (fxaaTarget.preset.Equals(FXAA.Preset.extremePerformancePreset))
                selectedPreset = 0;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.performancePreset))
                selectedPreset = 1;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.defaultPreset))
                selectedPreset = 2;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.qualityPreset))
                selectedPreset = 3;
            else if (fxaaTarget.preset.Equals(FXAA.Preset.extremeQualityPreset))
                selectedPreset = 4;

            EditorGUI.BeginChangeCheck();
            selectedPreset = EditorGUILayout.Popup("Preset", selectedPreset, presetNames);

            if (EditorGUI.EndChangeCheck())
            {
                if (selectedPreset < 0)
                    selectedPreset = 0;
                else if (selectedPreset > 4)
                    selectedPreset = 4;

                fxaaTarget.preset = FXAA.availablePresets[selectedPreset];
                return true;
            }
            return false;
        }
Esempio n. 3
0
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            EditorGUI.BeginChangeCheck();

            foreach (var setting in m_TopLevelFields)
                EditorGUILayout.PropertyField(setting);

            foreach (var group in m_GroupFields)
            {
                if (group.Key.FieldType == typeof(SMAA.QualitySettings) && (target as SMAA).settings.quality != SMAA.QualityPreset.Custom)
                    continue;

                string title = group.Key.Name;
                title = char.ToUpper(title[0]) + title.Substring(1);

                EditorGUILayout.Space();
                EditorGUILayout.LabelField(title, EditorStyles.boldLabel);
                EditorGUI.indentLevel++;

                var enabledField = group.Value.FirstOrDefault(x => x.propertyPath == group.Key.Name + ".enabled");
                if (enabledField != null && !enabledField.boolValue)
                {
                    EditorGUILayout.PropertyField(enabledField);
                    EditorGUI.indentLevel--;
                    continue;
                }

                foreach (var field in group.Value)
                    EditorGUILayout.PropertyField(field);

                EditorGUI.indentLevel--;
            }
            return EditorGUI.EndChangeCheck();
        }
Esempio n. 4
0
 private void UpdateUsedAAInterface()
 {
     if (method == (int)Method.Smaa)
     {
         m_Interface = m_SMAA;
     }
     else
     {
         m_Interface = m_FXAA;
     }
 }
Esempio n. 5
0
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            var fxaaTarget = (FXAA)target;

            if (!fxaaTarget.validSourceFormat)
            {
                EditorGUILayout.HelpBox("FXAA should be used at the end of the post-processing stack after conversion to LDR (after Tonemapping) to maximize quality and avoid artifacts.", MessageType.Warning);
            }

            int selectedPreset = 2;

            if (fxaaTarget.preset.Equals(FXAA.Preset.extremePerformancePreset))
            {
                selectedPreset = 0;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.performancePreset))
            {
                selectedPreset = 1;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.defaultPreset))
            {
                selectedPreset = 2;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.qualityPreset))
            {
                selectedPreset = 3;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.extremeQualityPreset))
            {
                selectedPreset = 4;
            }

            EditorGUI.BeginChangeCheck();
            selectedPreset = EditorGUILayout.Popup("Preset", selectedPreset, presetNames);

            if (EditorGUI.EndChangeCheck())
            {
                if (selectedPreset < 0)
                {
                    selectedPreset = 0;
                }
                else if (selectedPreset > 4)
                {
                    selectedPreset = 4;
                }

                fxaaTarget.preset = FXAA.availablePresets[selectedPreset];
                return(true);
            }
            return(false);
        }
Esempio n. 6
0
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            var fxaaTarget     = (FXAA)target;
            int selectedPreset = 2;

            if (fxaaTarget.preset.Equals(FXAA.Preset.extremePerformancePreset))
            {
                selectedPreset = 0;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.performancePreset))
            {
                selectedPreset = 1;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.defaultPreset))
            {
                selectedPreset = 2;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.qualityPreset))
            {
                selectedPreset = 3;
            }
            else if (fxaaTarget.preset.Equals(FXAA.Preset.extremeQualityPreset))
            {
                selectedPreset = 4;
            }

            EditorGUI.BeginChangeCheck();
            selectedPreset = EditorGUILayout.Popup("Preset", selectedPreset, presetNames);

            if (EditorGUI.EndChangeCheck())
            {
                if (selectedPreset < 0)
                {
                    selectedPreset = 0;
                }
                else if (selectedPreset > 4)
                {
                    selectedPreset = 4;
                }

                fxaaTarget.preset = FXAA.availablePresets[selectedPreset];
                return(true);
            }
            return(false);
        }
Esempio n. 7
0
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            EditorGUI.BeginChangeCheck();

            foreach (var setting in m_TopLevelFields)
            {
                EditorGUILayout.PropertyField(setting);
            }

            foreach (var group in m_GroupFields)
            {
                if (group.Key.FieldType == typeof(SMAA.QualitySettings) && (target as SMAA).settings.quality != SMAA.QualityPreset.Custom)
                {
                    continue;
                }

                bool   isExperimental = group.Key.GetCustomAttributes(typeof(SMAA.ExperimentalGroup), false).Length > 0;
                string title          = ObjectNames.NicifyVariableName(group.Key.Name);
                if (isExperimental)
                {
                    title += " (Experimental)";
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField(title, EditorStyles.boldLabel);
                EditorGUI.indentLevel++;

                var enabledField = group.Value.FirstOrDefault(x => x.propertyPath == "m_SMAA." + group.Key.Name + ".enabled");
                if (enabledField != null && !enabledField.boolValue)
                {
                    EditorGUILayout.PropertyField(enabledField);
                    EditorGUI.indentLevel--;
                    continue;
                }

                foreach (var field in group.Value)
                {
                    EditorGUILayout.PropertyField(field);
                }

                EditorGUI.indentLevel--;
            }
            return(EditorGUI.EndChangeCheck());
        }
Esempio n. 8
0
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            EditorGUI.BeginChangeCheck();

            foreach (var setting in m_TopLevelFields)
            {
                EditorGUILayout.PropertyField(setting);
            }

            if ((target as SMAA).settings.quality != SMAA.QualityPreset.Custom)
            {
                return(EditorGUI.EndChangeCheck());
            }

            foreach (var group in m_GroupFields)
            {
                string title = ObjectNames.NicifyVariableName(group.name);
                if (group.experimental)
                {
                    title += " (Experimental)";
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField(title, EditorStyles.boldLabel);
                EditorGUI.indentLevel++;

                var enabledField = group.properties.FirstOrDefault(x => x.propertyPath == "m_SMAA." + group.name + ".enabled");
                if (enabledField != null && !enabledField.boolValue)
                {
                    EditorGUILayout.PropertyField(enabledField);
                    EditorGUI.indentLevel--;
                    continue;
                }

                foreach (var field in group.properties)
                {
                    EditorGUILayout.PropertyField(field);
                }

                EditorGUI.indentLevel--;
            }
            return(EditorGUI.EndChangeCheck());
        }
        public bool OnInspectorGUI(IAntiAliasing target)
        {
            EditorGUI.BeginChangeCheck();

            foreach (var setting in m_TopLevelFields)
                EditorGUILayout.PropertyField(setting);

            foreach (var group in m_GroupFields)
            {
                if (group.quality && (target as SMAA).settings.quality != SMAA.QualityPreset.Custom)
                {
                    continue;
                }

                string title = ObjectNames.NicifyVariableName(group.name);
                if (group.experimental)
                    title += " (Experimental)";

                EditorGUILayout.Space();
                EditorGUILayout.LabelField(title, EditorStyles.boldLabel);
                EditorGUI.indentLevel++;

                var enabledField = group.properties.FirstOrDefault(x => x.propertyPath == "m_SMAA." + group.name + ".enabled");
                if (enabledField != null && !enabledField.boolValue)
                {
                    EditorGUILayout.PropertyField(enabledField);
                    EditorGUI.indentLevel--;
                    continue;
                }

                foreach (var field in group.properties)
                    EditorGUILayout.PropertyField(field);

                EditorGUI.indentLevel--;
            }
            return EditorGUI.EndChangeCheck();
        }
Esempio n. 10
0
 private void UpdateUsedAAInterface()
 {
     if (method == (int)Method.Smaa)
         m_Interface = m_SMAA;
     else
         m_Interface = m_FXAA;
 }