示例#1
0
        private void texHighlight_Click(object sender, EventArgs e)
        {
            // figure out which stage we're modifying.
            Bootstrap.TextureStage stage = null;
            ButtonAdv button             = sender as ButtonAdv;

            if (button == btnDiffuseHighlight)
            {
                stage = _materialPass.DiffuseStage;
            }
            else if (button == btnSpecularHighlight)
            {
                stage = _materialPass.SpecularStage;
            }
            else if (button == btnEmissiveHighlight)
            {
                stage = _materialPass.EmissiveStage;
            }
            else if (button == btnAmbientHighlight)
            {
                stage = _materialPass.AmbientStage;
            }
            else
            {
                return;
            }

            // crate a new color dialog and show it.
            Dialogs.HDRColorDialog colorDialog = new Dialogs.HDRColorDialog();
            colorDialog.Color = stage.TexColorAdd;
            colorDialog.ShowDialog();
            stage.TexColorAdd = colorDialog.Color;

            // make sure the highlight picture boxes are updated.
            UpdateHighlightPreviews();
        }
示例#2
0
        private void texButton_Click(object sender, EventArgs e)
        {
            // TODO: present some sort of output letting the user know
            // that they need to have a texture selected.
            if (_materialPass == null)
            {
                return;
            }

            // present the texture dialog to the user.
            Dialogs.TextureSelectionDialog dialog = new Dialogs.TextureSelectionDialog(false);
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            // get the current selection (or possibly none).
            string selection = null;
            int    count     = dialog.Selection.Count;

            if (count > 0)
            {
                selection = dialog.Selection[0];
            }
            else
            {
                return;
            }

            // figure out what stage to bind the texture to.
            Bootstrap.TextureStage stage = null;
            ButtonAdv button             = sender as ButtonAdv;

            if (button == btnDiffuseTexture)
            {
                stage = _materialPass.DiffuseStage;
            }
            else if (button == btnSpecularTexture)
            {
                stage = _materialPass.SpecularStage;
            }
            else if (button == btnNormalTexture)
            {
                stage = _materialPass.NormalStage;
            }
            else if (button == btnBumpTexture)
            {
                stage = _materialPass.BumpStage;
            }
            else if (button == btnEmissiveTexture)
            {
                stage = _materialPass.EmissiveStage;
            }
            else if (button == btnAmbientTexture)
            {
                stage = _materialPass.AmbientStage;
            }
            else
            {
                return;
            }

            // finish by binding the texture to the stage.
            stage.Texture = selection;
        }