Exemple #1
0
        public void onGUI(float x, float y)
        {
            if (GUI.Button(new Rect(x, y, 75, 20), "Default"))
            {
                m_activeConfig = AntiAliasingConfig.getDefaultPreset();
            }

            if (GUI.Button(new Rect(x + 75, y, 75, 20), "Load"))
            {
                m_activeConfig = ConfigUtility.Deserialize <AntiAliasingConfig>(configFilename);
                if (m_activeConfig == null)
                {
                    m_activeConfig = AntiAliasingConfig.getDefaultPreset();
                }
            }
            y += 25;

            m_activeConfig.mode = (AntiAliasingMode)PPFXUtility.drawIntSliderWithLabel(x, y, 0, (int)AntiAliasingMode.Maximum - 2, "Mode: ", m_activeConfig.getLabelFromMode(), (int)m_activeConfig.mode);
            y += 25;

            if (m_activeConfig.mode == AntiAliasingMode.FXAA)
            {
                m_activeConfig.fxaaQuality = PPFXUtility.drawIntSliderWithLabel(x, y, 0, 4, m_activeConfig.getLabelFromFxaaQuality(), m_activeConfig.fxaaQuality);
                y += 25;
            }

            if (m_activeConfig.mode == AntiAliasingMode.SMAA)
            {
                m_activeConfig.smaaQuality = (QualityPreset)PPFXUtility.drawIntSliderWithLabel(x, y, 0, (int)QualityPreset.Custom - 1, m_activeConfig.getLabelFromSmaaQuality(), (int)m_activeConfig.smaaQuality);
                y += 25;

                m_activeConfig.smaaTemporal = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.smaaTemporal, "Enable temporal");
                y += 25;

                //m_activeConfig.smaaPredication = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.smaaPredication, "enable predication");
            }

            applyConfig();
        }
Exemple #2
0
        public void onGUI(float x, float y)
        {
            if (GUI.Button(new Rect(x, y, 75, 20), "Default"))
            {
                m_activeConfig = new BloomConfig();
            }

            if (GUI.Button(new Rect(x + 75, y, 75, 20), "Medium"))
            {
                m_activeConfig = BloomConfig.getMediumPreset();
            }

            if (GUI.Button(new Rect(x + 150, y, 75, 20), "High"))
            {
                m_activeConfig = BloomConfig.getHighPreset();
            }

            if (GUI.Button(new Rect(x + 225, y, 75, 20), "Load"))
            {
                load();
            }

            y += 25;
            m_activeConfig.bloomEnabled = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.bloomEnabled, "Enable bloom");
            y += 25;

            m_activeConfig.intensity = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 2.0f, "Intensity", m_activeConfig.intensity);
            y += 25;

            m_activeConfig.threshhold = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 1.0f, "Threshold", m_activeConfig.threshhold);
            y += 25;

            m_activeConfig.blurSpread = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 2.0f, "Spread", m_activeConfig.blurSpread);
            y += 25;

            m_activeConfig.blurIterations = PPFXUtility.drawIntSliderWithLabel(x, y, 1, 5, "Spread", m_activeConfig.blurIterations);
            y += 25;

            m_activeConfig.lensflareEnabled = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.lensflareEnabled, "Enable lensflare.");
            y += 25;

            m_activeConfig.lensflareIntensity = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 2.0f, "Intensity", m_activeConfig.lensflareIntensity);
            y += 25;

            m_activeConfig.lensflareThreshold = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 1.0f, "Threshold", m_activeConfig.lensflareThreshold);
            y += 25;

            m_activeConfig.lensflareSaturation = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 1.0f, "Saturation", m_activeConfig.lensflareSaturation);
            y += 25;

            m_activeConfig.lensflareRotation = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 3.14f, "Rotation", m_activeConfig.lensflareRotation);
            y += 25;

            m_activeConfig.lensflareStretchWidth = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 5.0f, "Width", m_activeConfig.lensflareStretchWidth);
            y += 25;

            m_activeConfig.lensflareBlurIterations = PPFXUtility.drawIntSliderWithLabel(x, y, 1, 5, "Blur Iterations", m_activeConfig.lensflareBlurIterations);
            y += 25;

            m_activeConfig.lensFlareStyle = (LensFlareStyle)PPFXUtility.drawIntSliderWithLabel(x, y, 0, 2, "Style", m_activeConfig.getLensFlareStyleLabel(), (int)m_activeConfig.lensFlareStyle);
            y += 25;

            //m_activeConfig.lensflareSun = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.lensflareSun, "Enable sun lensflare.");
            //y += 25;

            applyConfig();
        }