コード例 #1
0
 /// <summary>
 /// Creates the configuration controls of this component.
 /// </summary>
 public static void AddControls(ModelFilter modelFilter, ClipControl owner)
 {
     // Model
     var model = CommonControls.AssetSelector<Model>("Model", owner, modelFilter, "Model");
     model.Top = 10;
     owner.AdjustHeightFromChildren();
 } // AddControls
コード例 #2
0
 /// <summary>
 /// Creates the configuration controls of this component.
 /// </summary>
 public static void AddControls(SpotLight spotLight, ClipControl owner)
 {
     // Enabled
     CheckBox enabled = CommonControls.CheckBox("Enabled", owner, spotLight.Enabled, spotLight, "Enabled");
     enabled.Top = 10;
     // Intensity
     var intensity = CommonControls.SliderNumericFloat("Intensity", owner, spotLight.Intensity, false, true, 0, 100, spotLight, "Intensity");
     // Diffuse Color
     var diffuseColor = CommonControls.SliderColor("Color", owner, spotLight.Color, spotLight, "Color");
     // Range
     var range = CommonControls.SliderNumericFloat("Range", owner, spotLight.Range, false, true, 0, 500, spotLight, "Range");
     // Inner Cone Angle
     var innerConeAngle = CommonControls.SliderNumericFloat("Inner Cone Angle", owner, spotLight.InnerConeAngle, false, false, 0, 175, spotLight, "InnerConeAngle");
     // Outer Cone Angle
     var outerConeAngle = CommonControls.SliderNumericFloat("Outer Cone Angle", owner, spotLight.OuterConeAngle, false, false, 0, 175, spotLight, "OuterConeAngle");
     // Mask Texture
     var maskTexture = CommonControls.AssetSelector<Texture>("Mask Texture", owner, spotLight, "LightMaskTexture");
     // Shadow
     var shadow = CommonControls.AssetSelector<BasicShadow>("Shadow", owner, spotLight, "Shadow");
     // Enabled
     enabled.CheckedChanged += delegate
     {
         intensity.Enabled      = spotLight.Enabled;
         diffuseColor.Enabled   = spotLight.Enabled;
         range.Enabled          = spotLight.Enabled;
         innerConeAngle.Enabled = spotLight.Enabled;
         outerConeAngle.Enabled = spotLight.Enabled;
         maskTexture.Enabled    = spotLight.Enabled;
         shadow.Enabled         = spotLight.Enabled;
     };
     owner.AdjustHeightFromChildren();
 } // AddControls
コード例 #3
0
        /// <summary>
        /// Creates the configuration controls of this asset.
        /// </summary>
        public static void AddControls(AmbientLight asset, Window owner, ComboBox comboBoxResource)
        {
            GroupBox groupGeneral = CommonControls.Group("General", owner);
            var intensity = CommonControls.SliderNumericFloat("Intensity", groupGeneral, asset.Intensity, true, true, 0, 10,
                                                         asset, "Intensity");
            var color = CommonControls.SliderColor("Color", groupGeneral, asset.Color, asset, "Color");
            var ambientOcclusion = CommonControls.AssetSelector<AmbientOcclusion>("Ambient Occlusion", owner, asset, "AmbientOcclusion");
            groupGeneral.AdjustHeightFromChildren();

        } // AddControls       
コード例 #4
0
 /// <summary>
 /// Creates the configuration controls of this component.
 /// </summary>
 public static void AddControls(ModelRenderer modelRenderer, ClipControl owner)
 {
     // Enabled
     CheckBox enabled = CommonControls.CheckBox("Enabled", owner, modelRenderer.Enabled, modelRenderer, "Enabled");
     enabled.Top = 10;
     // Material
     var material = CommonControls.AssetSelector<Material>("Material", owner, modelRenderer, "Material");
     // Enabled
     enabled.CheckedChanged += delegate
     {
         material.Enabled = modelRenderer.Enabled;
     };
     owner.AdjustHeightFromChildren();
 } // AddControls
コード例 #5
0
        /// <summary>
        /// Creates the configuration controls of this asset.
        /// </summary>
        public static void AddControls(Constant asset, Window owner)
        {

            #region Diffuse

            GroupBox groupDiffuse = CommonControls.Group("Diffuse", owner);
            // Diffuse Color
            var sliderDiffuseColor = CommonControls.SliderColor("Diffuse Color", groupDiffuse, asset.DiffuseColor, asset, "DiffuseColor");
            // Diffuse Texture
            var assetSelectorDiffuseTexture = CommonControls.AssetSelector<Texture>("Diffuse Texture", groupDiffuse, asset, "DiffuseTexture");
            groupDiffuse.AdjustHeightFromChildren();

            #endregion

        } // AddControls
コード例 #6
0
 /// <summary>
 /// Creates the configuration controls of this component.
 /// </summary>
 public static void AddControls(DirectionalLight directionalLight, ClipControl owner)
 {
     // Enabled
     CheckBox enabled = CommonControls.CheckBox("Enabled", owner, directionalLight.Enabled, directionalLight, "Enabled");
     enabled.Top = 10;
     // Intensity
     var intensity = CommonControls.SliderNumericFloat("Intensity", owner, directionalLight.Intensity, false, true, 0, 100, directionalLight, "Intensity");
     // Diffuse Color
     var diffuseColor = CommonControls.SliderColor("Color", owner, directionalLight.Color, directionalLight, "Color");
     // Shadow
     var shadow = CommonControls.AssetSelector<Shadow>("Shadow", owner, directionalLight, "Shadow");
     // Enabled
     enabled.CheckedChanged += delegate
     {
         intensity.Enabled      = directionalLight.Enabled;
         diffuseColor.Enabled   = directionalLight.Enabled;
         shadow.Enabled         = directionalLight.Enabled;
     };
     owner.AdjustHeightFromChildren();
 } // AddControls
コード例 #7
0
 /// <summary>
 /// Creates the configuration controls of this component.
 /// </summary>
 public static void AddControls(Camera camera, ClipControl owner)
 {
     // Enabled
     var enabled = CommonControls.CheckBox("Enabled", owner, camera.Enabled, camera, "Enabled");
     enabled.Top = 10;
     // Clear Color
     var clearColor = CommonControls.SliderColor("Clear Color", owner, camera.ClearColor, camera, "ClearColor");
     var sky = CommonControls.AssetSelector<Sky>("Sky", owner, camera, "Sky");
     var postProcess = CommonControls.AssetSelector<PostProcess>("Post Process", owner, camera, "PostProcess");
     var ambientLight = CommonControls.AssetSelector<AmbientLight>("Ambient Light", owner, camera, "AmbientLight");
     
     enabled.CheckedChanged += delegate
     {
         clearColor.Enabled = enabled.Checked;
         sky.Enabled = enabled.Checked;
         postProcess.Enabled = enabled.Checked;
         ambientLight.Enabled = enabled.Checked;
     };
     owner.AdjustHeightFromChildren();
 } // AddControls
コード例 #8
0
        /// <summary>
        /// Creates the configuration controls of this asset.
        /// </summary>
        public static void AddControls(CarPaint asset, Window owner)
        {

            #region Diffuse

            GroupBox groupDiffuse = CommonControls.Group("Diffuse", owner);
            // Base Paint Color
            var sliderBasePaintColor = CommonControls.SliderColor("Base Paint Color", groupDiffuse, asset.BasePaintColor, asset, "BasePaintColor");
            // Second Base Paint Color
            var sliderSecondBasePaintColor = CommonControls.SliderColor("Second Base Paint Color", groupDiffuse, asset.SecondBasePaintColor, asset, "SecondBasePaintColor");
            // Flake Layer Color 1
            var sliderFlakeLayerColor1 = CommonControls.SliderColor("Third Base Paint Color", groupDiffuse, asset.ThirdBasePaintColor, asset, "ThirdBasePaintColor"); 
            groupDiffuse.AdjustHeightFromChildren();

            #endregion

            #region Specular

            GroupBox groupSpecular = CommonControls.Group("Specular", owner);
            CheckBox checkBoxSpecularPowerFromTexture = null;
            // Specular Intensity
            var sliderSpecularIntensity = CommonControls.SliderNumericFloat("Specular Intensity", groupSpecular, asset.SpecularIntensity, false, true, 0, 2, asset, "SpecularIntensity");
            // Specular Power
            var sliderSpecularPower = CommonControls.SliderNumericFloat("Specular Power", groupSpecular, asset.SpecularPower, true, true, 0, 100, asset, "SpecularPower");
            sliderSpecularPower.Draw += delegate
            {
                sliderSpecularPower.Enabled = !checkBoxSpecularPowerFromTexture.Enabled || (checkBoxSpecularPowerFromTexture.Enabled && !checkBoxSpecularPowerFromTexture.Checked);
            };
            // Specular Texture
            var assetSelectorSpecularTexture = CommonControls.AssetSelector<Texture>("Specular Texture", groupSpecular, asset, "SpecularTexture");
            assetSelectorSpecularTexture.ItemIndexChanged += delegate { checkBoxSpecularPowerFromTexture.Enabled = asset.SpecularTexture != null; };
            // Specular Texture Power Enabled
            checkBoxSpecularPowerFromTexture = CommonControls.CheckBox("Use specular power from Texture", groupSpecular, asset.SpecularPowerFromTexture, 
                asset, "SpecularPowerFromTexture",
                "Indicates if the specular power will be read from the texture (the alpha channel of the specular texture) or from the specular power property.");
            // Reflection Texture
            var assetSelectorReflectionTexture = CommonControls.AssetSelector<TextureCube>("Reflection Texture", groupSpecular, asset, "ReflectionTexture");
            groupSpecular.AdjustHeightFromChildren();

            #endregion

            #region Normals

            GroupBox groupNormals = CommonControls.Group("Normals", owner);
            // Normal Texture
            var assetSelectorNormalTexture = CommonControls.AssetSelector<Texture>("Normal Texture", groupNormals, asset, "NormalTexture");

            groupNormals.AdjustHeightFromChildren();

            #endregion

            #region Flakes

            var groupFlakes = CommonControls.Group("Flakes", owner);

            // Flakes Color
            var sliderFlakesColor = CommonControls.SliderColor("Flake Color", groupFlakes, asset.FlakesColor, asset, "FlakesColor");
            // Flakes Scale
            var sliderFlakesScale = CommonControls.SliderNumericFloat("Flakes Scale", groupFlakes, asset.FlakesScale, true, true, 0, 500, asset, "FlakesScale");
            // Flakes Exponent
            var sliderFlakesExponent = CommonControls.SliderNumericFloat("Flakes Exponent", groupFlakes, asset.FlakesExponent, true, true, 0, 500, asset, "FlakesExponent");
            // Flake Perturbation
            var sliderFlakePerturbation = CommonControls.SliderNumericFloat("Flake Perturbation", groupFlakes, asset.MicroflakePerturbation, false, false, -1, 1, asset, "MicroflakePerturbation");
            // Flake Perturbation A
            var sliderFlakePerturbationA = CommonControls.SliderNumericFloat("Flake Perturbation A", groupFlakes, asset.MicroflakePerturbationA, false, false, 0, 1, asset, "MicroflakePerturbationA");
            // Normal Perturbation
            var sliderNormalPerturbation = CommonControls.SliderNumericFloat("Normal Perturbation", groupFlakes, asset.NormalPerturbation, false, false, -1, 1, asset, "NormalPerturbation");
            groupFlakes.AdjustHeightFromChildren();

            #endregion

        } // AddControls
コード例 #9
0
        /// <summary>
        /// Creates the configuration controls of this asset.
        /// </summary>
        public static void AddControls(BlinnPhong asset, Window owner)
        {

            #region Diffuse

            GroupBox groupDiffuse = CommonControls.Group("Diffuse", owner);
            // Diffuse Color
            var sliderDiffuseColor = CommonControls.SliderColor("Diffuse Color", groupDiffuse, asset.DiffuseColor, asset, "DiffuseColor");
            // Diffuse Texture
            var assetSelectorDiffuseTexture = CommonControls.AssetSelector<Texture>("Diffuse Texture", groupDiffuse, asset, "DiffuseTexture");
            groupDiffuse.AdjustHeightFromChildren();

            #endregion

            #region Specular

            GroupBox groupSpecular = CommonControls.Group("Specular", owner);
            CheckBox checkBoxSpecularPowerFromTexture = null;
            // Specular Intensity
            var sliderSpecularIntensity = CommonControls.SliderNumericFloat("Specular Intensity", groupSpecular, asset.SpecularIntensity, false, true, 0, 2, asset, "SpecularIntensity");
            // Specular Power
            var sliderSpecularPower = CommonControls.SliderNumericFloat("Specular Power", groupSpecular, asset.SpecularPower, true, true, 0, 100, asset, "SpecularPower");
            sliderSpecularPower.Draw += delegate
            {
                sliderSpecularPower.Enabled = !checkBoxSpecularPowerFromTexture.Enabled || (checkBoxSpecularPowerFromTexture.Enabled && !checkBoxSpecularPowerFromTexture.Checked);
            };
            // Specular Texture
            var assetSelectorSpecularTexture = CommonControls.AssetSelector<Texture>("Specular Texture", groupSpecular, asset, "SpecularTexture");
            assetSelectorSpecularTexture.ItemIndexChanged += delegate { checkBoxSpecularPowerFromTexture.Enabled = asset.SpecularTexture != null; };
            // Specular Texture Power Enabled
            checkBoxSpecularPowerFromTexture = CommonControls.CheckBox("Use specular power from Texture", groupSpecular, asset.SpecularPowerFromTexture, 
                asset, "SpecularPowerFromTexture",
                "Indicates if the specular power will be read from the texture (the alpha channel of the specular texture) or from the specular power property.");
            // Reflection Texture
            var assetSelectorReflectionTexture = CommonControls.AssetSelector<TextureCube>("Reflection Texture", groupSpecular, asset, "ReflectionTexture");
            groupSpecular.AdjustHeightFromChildren();

            #endregion

            #region Normals

            GroupBox groupNormals = CommonControls.Group("Normals", owner);
            // Normal Texture
            var assetSelectorNormalTexture = CommonControls.AssetSelector<Texture>("Normal Texture", groupNormals, asset, "NormalTexture");
            // Parallax Enabled
            CheckBox checkBoxParallaxEnabled = CommonControls.CheckBox("Enabled", groupNormals, asset.ParallaxEnabled, asset, "ParallaxEnabled");
            // Parallax Threshold
            var sliderParallaxLodThreshold = CommonControls.SliderNumericInt("Parallax LOD Threshold", groupNormals,
                                             asset.ParallaxLodThreshold, false, false, 0, 10, asset, "ParallaxLodThreshold");
            // Parallax Minimum Number Samples
            var sliderParallaxMinimumNumberSamples = CommonControls.SliderNumericInt("Parallax Minimum Number Samples", groupNormals,
                                                     asset.ParallaxMinimumNumberSamples, false, false, 0, 50, asset, "ParallaxMinimumNumberSamples");
            // Parallax Maximum Number Samples
            var sliderParallaxMaximumNumberSamples = CommonControls.SliderNumericInt("Parallax Maximum Number Samples", groupNormals,
                                                     asset.ParallaxMaximumNumberSamples, false, false, 0, 500, asset, "ParallaxMaximumNumberSamples");
            // Parallax Maximum Number Samples
            var sliderParallaxHeightMapScale = CommonControls.SliderNumericFloat("Parallax Height Map Scale", groupNormals,
                                               asset.ParallaxHeightMapScale, false, false, 0, 1, asset, "ParallaxHeightMapScale");
            checkBoxParallaxEnabled.CheckedChanged += delegate
            {
                asset.ParallaxEnabled = checkBoxParallaxEnabled.Checked;
                sliderParallaxLodThreshold.Enabled = asset.ParallaxEnabled;
                sliderParallaxMinimumNumberSamples.Enabled = asset.ParallaxEnabled;
                sliderParallaxMaximumNumberSamples.Enabled = asset.ParallaxEnabled;
                sliderParallaxHeightMapScale.Enabled = asset.ParallaxEnabled;
            };
            assetSelectorNormalTexture.Draw += delegate
            {
                if (asset.NormalTexture == null)
                    checkBoxParallaxEnabled.Enabled = false;
            };
            groupNormals.AdjustHeightFromChildren();

            #endregion

        } // AddControls
コード例 #10
0
        /// <summary>
        /// Creates the configuration controls of this asset.
        /// </summary>
        public static void AddControls(PostProcess asset, Window owner, ComboBox comboBoxResource)
        {
            
            #region Group Lens Exposure

            GroupBox groupToneMapping = CommonControls.Group("Tone Mapping", owner);
            // Lens Exposure
            var sliderLensExposure = CommonControls.SliderNumericFloat("Lens Exposure", groupToneMapping, asset.ToneMapping.LensExposure, true, true, -10, 10,
                                                                  asset.ToneMapping, "LensExposure");
            // Auto Exposure Enabled
            CheckBox checkBoxAutoExposureEnabled = CommonControls.CheckBox("Auto Exposure Enabled", groupToneMapping, asset.ToneMapping.AutoExposureEnabled, 
                                                                           asset.ToneMapping, "AutoExposureEnabled");
            // Auto Exposure Adaptation Time Multiplier
            var sliderAutoExposureAdaptationTimeMultiplier = CommonControls.SliderNumericFloat("Adaptation Time Multiplier", groupToneMapping,
                                                                                          asset.ToneMapping.AutoExposureAdaptationTimeMultiplier,
                                                                                          false, true, 0, 10,
                                                                                          asset.ToneMapping, "AutoExposureAdaptationTimeMultiplier");
            // Auto Exposure Luminance Low Threshold
            var sliderAutoExposureLuminanceLowThreshold = CommonControls.SliderNumericFloat("Luminance Low Threshold", groupToneMapping,
                                                                                       asset.ToneMapping.AutoExposureLuminanceLowThreshold, false, true, 0, 0.5f,
                                                                                       asset.ToneMapping, "AutoExposureLuminanceLowThreshold");
            // Auto Exposure Luminance High Threshold

            var sliderAutoExposureLuminanceHighThreshold = CommonControls.SliderNumericFloat("Luminance High Threshold", groupToneMapping,
                asset.ToneMapping.AutoExposureLuminanceHighThreshold, false, true, 0.5f, 20f, asset.ToneMapping, "AutoExposureLuminanceHighThreshold");
            // Auto Exposure Enabled
            checkBoxAutoExposureEnabled.CheckedChanged += delegate
            {
                sliderLensExposure.Enabled                         = !asset.ToneMapping.AutoExposureEnabled;
                sliderAutoExposureAdaptationTimeMultiplier.Enabled = asset.ToneMapping.AutoExposureEnabled;
                sliderAutoExposureLuminanceLowThreshold.Enabled    = asset.ToneMapping.AutoExposureEnabled;
                sliderAutoExposureLuminanceHighThreshold.Enabled   = asset.ToneMapping.AutoExposureEnabled;
            };

            #region Tone Mapping Curve

            ComboBox comboBoxToneMappingCurve = CommonControls.ComboBox("Tone Mapping Curve", groupToneMapping);
            comboBoxToneMappingCurve.Items.AddRange(new[]
            {
                "Filmic ALU",
                "Filmic Uncharted 2",
                "Duiker",
                "Reinhard",
                "Reinhard Modified",
                "Exponential",
                "Logarithmic",
                "Drago Logarithmic"
            });
            comboBoxToneMappingCurve.ItemIndex = (int)asset.ToneMapping.ToneMappingFunction;
            comboBoxToneMappingCurve.ItemIndexChanged += delegate { asset.ToneMapping.ToneMappingFunction = (ToneMapping.ToneMappingFunctionEnumerate)comboBoxToneMappingCurve.ItemIndex; };
            comboBoxToneMappingCurve.Draw += delegate
            {
                if (comboBoxToneMappingCurve.ListBoxVisible)
                    return;
                comboBoxToneMappingCurve.ItemIndex = (int)asset.ToneMapping.ToneMappingFunction;
            };

            #endregion

            // White Level
            var sliderWhiteLevel = CommonControls.SliderNumericFloat("White Level", groupToneMapping, asset.ToneMapping.ToneMappingWhiteLevel,
                false, true, 0f, 50f, asset.ToneMapping, "ToneMappingWhiteLevel");
            // Luminance Saturation
            var sliderLuminanceSaturation = CommonControls.SliderNumericFloat("Luminance Saturation", groupToneMapping, asset.ToneMapping.ToneMappingLuminanceSaturation,
                false, true, 0f, 2f, asset.ToneMapping, "ToneMappingLuminanceSaturation");
            // Drago Bias
            var sliderDragoBias = CommonControls.SliderNumericFloat("Drago Bias", groupToneMapping, asset.ToneMapping.DragoBias,
                false, true, 0f, 1f, asset.ToneMapping, "DragoBias");
            // Shoulder Strength
            var sliderShoulderStrength = CommonControls.SliderNumericFloat("Shoulder Strength", groupToneMapping, asset.ToneMapping.Uncharted2ShoulderStrength,
                false, true, 0f, 1f, asset.ToneMapping, "Uncharted2ShoulderStrength");
            // Linear Strength
            var sliderLinearStrength = CommonControls.SliderNumericFloat("Linear Strength", groupToneMapping, asset.ToneMapping.Uncharted2LinearStrength,
                false, true, 0f, 1f, asset.ToneMapping, "Uncharted2LinearStrength");
            // Linear Angle
            var sliderLinearAngle = CommonControls.SliderNumericFloat("Linear Angle", groupToneMapping, asset.ToneMapping.Uncharted2LinearAngle,
                false, true, 0f, 3f, asset.ToneMapping, "Uncharted2LinearAngle");
            // Toe Strength
            var sliderToeStrength = CommonControls.SliderNumericFloat("Toe Strength", groupToneMapping, asset.ToneMapping.Uncharted2ToeStrength,
                false, true, 0f, 1f, asset.ToneMapping, "Uncharted2ToeStrength");
            // Toe Numerator
            var sliderToeNumerator = CommonControls.SliderNumericFloat("Toe Numerator", groupToneMapping, asset.ToneMapping.Uncharted2ToeNumerator,
                false, true, 0f, 0.1f, asset.ToneMapping, "Uncharted2ToeNumerator");
            // Toe Denominator
            var sliderToeDenominator = CommonControls.SliderNumericFloat("Toe Denominator", groupToneMapping, asset.ToneMapping.Uncharted2ToeDenominator,
                false, true, 0f, 1f, asset.ToneMapping, "Uncharted2ToeDenominator");
            // Linear White
            var sliderLinearWhite = CommonControls.SliderNumericFloat("Linear White", groupToneMapping, asset.ToneMapping.Uncharted2LinearWhite,
                false, true, 0f, 40f, asset.ToneMapping, "Uncharted2LinearWhite");

            #region Sliders enabled?

            comboBoxToneMappingCurve.ItemIndexChanged += delegate
            {
                sliderWhiteLevel.Enabled = false;
                sliderLuminanceSaturation.Enabled = false;
                sliderDragoBias.Enabled = false;
                sliderShoulderStrength.Enabled = false;
                sliderLinearStrength.Enabled = false;
                sliderLinearAngle.Enabled = false;
                sliderToeStrength.Enabled = false;
                sliderToeNumerator.Enabled = false;
                sliderToeDenominator.Enabled = false;
                sliderLinearWhite.Enabled = false;
                if (asset.ToneMapping.ToneMappingFunction == ToneMapping.ToneMappingFunctionEnumerate.DragoLogarithmic)
                {
                    sliderWhiteLevel.Enabled = true;
                    sliderLuminanceSaturation.Enabled = true;
                    sliderDragoBias.Enabled = true;
                }
                else if (asset.ToneMapping.ToneMappingFunction == ToneMapping.ToneMappingFunctionEnumerate.Exponential)
                {
                    sliderWhiteLevel.Enabled = true;
                    sliderLuminanceSaturation.Enabled = true;
                }
                else if (asset.ToneMapping.ToneMappingFunction == ToneMapping.ToneMappingFunctionEnumerate.FilmicUncharted2)
                {
                    sliderShoulderStrength.Enabled = true;
                    sliderLinearStrength.Enabled = true;
                    sliderLinearAngle.Enabled = true;
                    sliderToeStrength.Enabled = true;
                    sliderToeNumerator.Enabled = true;
                    sliderToeDenominator.Enabled = true;
                    sliderLinearWhite.Enabled = true;
                }
                else if (asset.ToneMapping.ToneMappingFunction == ToneMapping.ToneMappingFunctionEnumerate.Logarithmic)
                {
                    sliderWhiteLevel.Enabled = true;
                    sliderLuminanceSaturation.Enabled = true;
                }
                else if (asset.ToneMapping.ToneMappingFunction == ToneMapping.ToneMappingFunctionEnumerate.Reinhard)
                {
                    sliderLuminanceSaturation.Enabled = true;
                }
                else if (asset.ToneMapping.ToneMappingFunction == ToneMapping.ToneMappingFunctionEnumerate.ReinhardModified)
                {
                    sliderWhiteLevel.Enabled = true;
                    sliderLuminanceSaturation.Enabled = true;
                }
            };

            #endregion

            groupToneMapping.AdjustHeightFromChildren();

            #endregion

            #region Group Bloom

            GroupBox groupBloom = CommonControls.Group("Bloom", owner);

            // Enabled
            CheckBox checkBoxBloomEnabled = CommonControls.CheckBox("Enabled", groupBloom, asset.Bloom.Enabled,
                asset.Bloom, "Enabled", "The effect produces fringes (or feathers) of light around very bright objects in an image.");
            // Scale
            var sliderBloomScale = CommonControls.SliderNumericFloat("Scale", groupBloom, asset.Bloom.Scale, false, true, 0, 2,  asset.Bloom, "Scale");
            // Threshold
            var sliderBloomThreshold = CommonControls.SliderNumericFloat("Threshold", groupBloom, asset.Bloom.Threshold, false, true, 0, 10, asset.Bloom, "Threshold");
            // Enabled
            checkBoxBloomEnabled.CheckedChanged += delegate
            {
                sliderBloomScale.Enabled = asset.Bloom.Enabled;
                sliderBloomThreshold.Enabled = asset.Bloom.Enabled;
            };

            groupBloom.AdjustHeightFromChildren();

            #endregion

            #region Group MLAA

            GroupBox groupMlaa = CommonControls.Group("MLAA", owner);
            // Enabled
            CheckBox checkBoxMlaaEnabled = CommonControls.CheckBox("Enabled", groupMlaa, asset.MLAA.Enabled, asset.MLAA, "Enabled", "Enables Morphological Antialiasing.");
            
            #region Edge Detection
            
            var comboBoxEdgeDetection = CommonControls.ComboBox("Edge Detection Type", groupMlaa,
                "Color: uses the color information. Good for texture and geometry aliasing. Depth: uses the depth buffer. Great for geometry aliasing. Both: the two at the same time. A little more costly with slightly better results.");
            // Add textures name
            comboBoxEdgeDetection.Items.Add("Both");
            comboBoxEdgeDetection.Items.Add("Color");
            comboBoxEdgeDetection.Items.Add("Depth");
            // Events
            comboBoxEdgeDetection.ItemIndexChanged += delegate
            {
                switch (comboBoxEdgeDetection.ItemIndex)
                {
                    case 0: asset.MLAA.EdgeDetection = MLAA.EdgeDetectionType.Both; break;
                    case 1: asset.MLAA.EdgeDetection = MLAA.EdgeDetectionType.Color; break;
                    case 2: asset.MLAA.EdgeDetection = MLAA.EdgeDetectionType.Depth; break;
                }
            };
            comboBoxEdgeDetection.Draw += delegate
            {
                if (comboBoxEdgeDetection.ListBoxVisible)
                    return;
                switch (asset.MLAA.EdgeDetection)
                {
                    case MLAA.EdgeDetectionType.Both: comboBoxEdgeDetection.ItemIndex = 0; break;
                    case MLAA.EdgeDetectionType.Color: comboBoxEdgeDetection.ItemIndex = 1; break;
                    case MLAA.EdgeDetectionType.Depth: comboBoxEdgeDetection.ItemIndex = 2; break;
                }
            };

            #endregion

            // Threshold Color
            var sliderMlaaColorThreshold = CommonControls.SliderNumericFloat("Color Threshold", groupMlaa, asset.MLAA.ThresholdColor,
                false, false, 0, 0.5f, asset.MLAA, "ThresholdColor");
            // Threshold Depth
            var sliderMlaaDepthThreshold = CommonControls.SliderNumericFloat("Depth Threshold", groupMlaa, asset.MLAA.ThresholdDepth,
                false, false, 0, 0.5f, asset.MLAA, "ThresholdDepth");

            checkBoxMlaaEnabled.CheckedChanged += delegate
            {
                comboBoxEdgeDetection.Enabled = asset.MLAA.Enabled;
                sliderMlaaColorThreshold.Enabled = asset.MLAA.Enabled;
                sliderMlaaDepthThreshold.Enabled = asset.MLAA.Enabled;
            };

            groupMlaa.AdjustHeightFromChildren();

            #endregion

            #region Group Film Grain

            GroupBox groupFilmGrain = CommonControls.Group("Film Grain", owner);

            // Enabled
            CheckBox checkBoxFilmGrainEnabled = CommonControls.CheckBox("Enabled", groupFilmGrain, asset.FilmGrain.Enabled, asset.FilmGrain, "Enabled",
                "Is the random optical texture of processed photographic film.");
            // Strength
            var sliderFilmgrainStrength = CommonControls.SliderNumericFloat("Strength", groupFilmGrain, asset.FilmGrain.Strength, false, true, 0, 0.5f, asset.FilmGrain, "Strength");
            // Random Noise Strength
            var sliderFilmGrainRandomNoiseStrength = CommonControls.SliderNumericFloat("Random Noise Strength", groupFilmGrain, asset.FilmGrain.RandomNoiseStrength, 
                false, false, 0, 5, asset.FilmGrain, "RandomNoiseStrength");
            // Accentuate Dark Noise Power
            var sliderFilmGrainAccentuateDarkNoisePower = CommonControls.SliderNumericFloat("Accentuate Dark Noise Power", groupFilmGrain, asset.FilmGrain.AccentuateDarkNoisePower,
                false, false, 0, 10, asset.FilmGrain, "AccentuateDarkNoisePower");

            checkBoxFilmGrainEnabled.CheckedChanged += delegate
            {
                sliderFilmgrainStrength.Enabled = asset.FilmGrain.Enabled;
                sliderFilmGrainRandomNoiseStrength.Enabled = asset.FilmGrain.Enabled;
                sliderFilmGrainAccentuateDarkNoisePower.Enabled = asset.FilmGrain.Enabled;
            };

            groupFilmGrain.AdjustHeightFromChildren();

            #endregion

            #region Group Adjust Levels

            GroupBox groupAdjustLevels = CommonControls.Group("Adjust Levels", owner);

            // Enabled
            CheckBox checkBoxAdjustLevelsEnabled = CommonControls.CheckBox("Enabled", groupAdjustLevels, asset.AdjustLevels.Enabled,
                asset.AdjustLevels, "Enabled", "Adjust color levels just like Photoshop.");
            // Input Black
            var sliderAdjustLevelsInputBlack = CommonControls.SliderNumericFloat("Input Black", groupAdjustLevels, asset.AdjustLevels.InputBlack,
                false, false, 0, 0.9f, asset.AdjustLevels, "InputBlack");
            // Input White
            var sliderAdjustLevelsInputWhite = CommonControls.SliderNumericFloat("Input White", groupAdjustLevels, asset.AdjustLevels.InputWhite,
                false, false, 0.1f, 1f, asset.AdjustLevels, "InputWhite");
            // Input Gamma
            var sliderAdjustLevelsInputGamma = CommonControls.SliderNumericFloat("Input Gamma", groupAdjustLevels, asset.AdjustLevels.InputGamma,
                false, false, 0.01f, 9.99f, asset.AdjustLevels, "InputGamma");
            // Output Black
            var sliderAdjustLevelsOutputBlack = CommonControls.SliderNumericFloat("Output Black", groupAdjustLevels, asset.AdjustLevels.OutputBlack,
                false, false, 0, 1, asset.AdjustLevels, "OutputBlack");
            // Output White
            var sliderAdjustLevelsOutputWhite = CommonControls.SliderNumericFloat("Output White", groupAdjustLevels, asset.AdjustLevels.OutputWhite,
                false, false, 0, 1, asset.AdjustLevels, "OutputWhite");
            
            checkBoxAdjustLevelsEnabled.CheckedChanged += delegate
            {
                sliderAdjustLevelsInputBlack.Enabled  = asset.AdjustLevels.Enabled;
                sliderAdjustLevelsInputWhite.Enabled  = asset.AdjustLevels.Enabled;
                sliderAdjustLevelsInputGamma.Enabled  = asset.AdjustLevels.Enabled;
                sliderAdjustLevelsOutputBlack.Enabled = asset.AdjustLevels.Enabled;
                sliderAdjustLevelsOutputWhite.Enabled = asset.AdjustLevels.Enabled;
            };

            groupAdjustLevels.AdjustHeightFromChildren();

            #endregion

            #region Group Color Correction

            GroupBox groupColorCorrection = CommonControls.Group("Color Correction", owner);

            // Enabled
            CheckBox checkBoxColorCorrectionEnabled = CommonControls.CheckBox("Enabled", groupColorCorrection, asset.ColorCorrection.Enabled, asset.ColorCorrection, "Enabled");
            // First Lookup Table
            var assetCreatorFirstLookupTable = CommonControls.AssetSelector<LookupTable>("First Lookup Table", groupColorCorrection, asset.ColorCorrection, "FirstLookupTable");
            // Second Lookup Table
            var assetCreatorSecondLookupTable = CommonControls.AssetSelector<LookupTable>("Second Lookup Table", groupColorCorrection, asset.ColorCorrection, "SecondLookupTable");
            assetCreatorSecondLookupTable.Draw += delegate
            {
                assetCreatorSecondLookupTable.Enabled = asset.ColorCorrection.FirstLookupTable != null && checkBoxColorCorrectionEnabled.Checked;                
            };
            // Lerp Original Color Amount
            var sliderLerpOriginalColorAmount = CommonControls.SliderNumericFloat("Lerp Original Color", groupColorCorrection, asset.ColorCorrection.LerpOriginalColorAmount, 
                false, false, 0, 1, asset.ColorCorrection, "LerpOriginalColorAmount");
            sliderLerpOriginalColorAmount.Draw += delegate
            {
                sliderLerpOriginalColorAmount.Enabled = asset.ColorCorrection.FirstLookupTable != null && checkBoxColorCorrectionEnabled.Checked;
            };
            // Lerp Lookup Tables Amount
            var sliderLerpLookupTablesAmount = CommonControls.SliderNumericFloat("Lerp Lookup Tables", groupColorCorrection, asset.ColorCorrection.LerpLookupTablesAmount,
                false, false, 0, 1, asset.ColorCorrection, "LerpLookupTablesAmount");
            sliderLerpLookupTablesAmount.Draw += delegate
            {
                sliderLerpLookupTablesAmount.Enabled = asset.ColorCorrection.SecondLookupTable != null && asset.ColorCorrection.FirstLookupTable != null && checkBoxColorCorrectionEnabled.Checked;
            };

            checkBoxColorCorrectionEnabled.CheckedChanged += delegate { assetCreatorFirstLookupTable.Enabled = asset.ColorCorrection.Enabled; };

            groupColorCorrection.AdjustHeightFromChildren();

            #endregion

        } // AddControls