コード例 #1
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
コード例 #2
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       
コード例 #3
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
コード例 #4
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
コード例 #5
0
 /// <summary>
 /// Creates the configuration controls of this component.
 /// </summary>
 public static void AddControls(PointLight pointLight, ClipControl owner)
 {
     // Enabled
     CheckBox enabled = CommonControls.CheckBox("Enabled", owner, pointLight.Enabled, pointLight, "Enabled");
     enabled.Top = 10;
     // Intensity
     var intensity = CommonControls.SliderNumericFloat("Intensity", owner, pointLight.Intensity, false, true, 0, 100, pointLight, "Intensity");
     // Diffuse Color
     var diffuseColor = CommonControls.SliderColor("Color", owner, pointLight.Color, pointLight, "Color");
     // Range
     var range = CommonControls.SliderNumericFloat("Range", owner, pointLight.Range, false, true, 0, 500, pointLight, "Range");
     // Enabled
     enabled.CheckedChanged += delegate
     {
         intensity.Enabled      = pointLight.Enabled;
         diffuseColor.Enabled   = pointLight.Enabled;
         range.Enabled          = pointLight.Enabled;
     };
     owner.AdjustHeightFromChildren();
 } // AddControls
コード例 #6
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
コード例 #7
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
コード例 #8
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