Esempio n. 1
0
        private void btnCreateMtl_Click(object sender, EventArgs e)
        {
            try
            {
                MaterialProperty mtlProp = this.propertyGridMtl.SelectedObject as MaterialProperty;
                if (mtlProp != null)
                {
                    NMtlStatic mtl = new NMtlStatic(mtlProp.Name);
                    mtl.DefaultCreate(mtlProp.ShaderLoc);

                    mtlProp.BindMaterial(mtl);
                    this.propertyGridMtl.SelectedObject = mtlProp;
                    m_Material = mtl;

                    if (m_Sphere == null)
                    {
                        LoadSphere();
                    }
                    if (m_Material != null)
                    {
                        m_Sphere.SetMaterial(m_Material);
                    }
                    m_preview.Refresh();
                }
            }
            catch (System.Exception ex)
            {
                NexusEditor.Program.ShowException(ex, "Create Material FAILED");
            }
        }
Esempio n. 2
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            //新建材质
            NResourceLoc resLoc = new NResourceLoc("engine_data", "material/standard.hlsl");
            NMtlStatic   mtl    = new NMtlStatic(resLoc.ToString());

            mtl.DefaultCreate(resLoc);
            m_Material = mtl;
            MaterialProperty mtlProp = new MaterialProperty(m_Material);

            mtlProp.ApplyChange();
            this.propertyGridMtl.SelectedObject = mtlProp;
            LoadSphere();
        }
Esempio n. 3
0
        public MaterialEditor()
        {
            InitializeComponent();

            m_finalClose = false;
            m_realTime   = false;

            m_Location = new NResourceLoc("", "");

            m_preview = new ResourcePreview("MaterialPreview_LV");
            this.splitContainer1.Panel1.Controls.Add(m_preview);

            //新建材质
            NResourceLoc resLoc = new NResourceLoc("engine_data", "material/standard.hlsl");
            NMtlStatic   mtl    = new NMtlStatic(resLoc.ToString());

            mtl.DefaultCreate(resLoc);
            m_Material = mtl;
            MaterialProperty mtlProp = new MaterialProperty(m_Material);

            mtlProp.ApplyChange();
            this.propertyGridMtl.SelectedObject = mtlProp;
            LoadSphere();
        }