示例#1
0
        public void SetMaterial(Material material)
        {
            var loc = GetUniformLocation("u_material.ambient");
            GL.Uniform4(loc, material.Ambient);

            loc = GetUniformLocation("u_material.diffuse");
            GL.Uniform4(loc, material.Diffuse);

            loc = GetUniformLocation("u_material.specular");
            GL.Uniform4(loc, material.Specular);

            loc = GetUniformLocation("u_material.shininess");
            GL.Uniform1(loc, material.Shininess);
        }
示例#2
0
        protected override void Init()
        {
            Material = new Material()
            {
                Ambient = new Vector4(0, 0, 0, 1),
                Diffuse = new Vector4(0.4f, 0.4f, 0.4f, 1),
                TextureTilingX = 1,
                TextureTilingY = 1,
                TextureRepeatX = false,
                TextureRepeatY = false
            };

            Vertices = new Vector3[0];
            Normals = new Vector3[0];
            Indices = new short[0];
            UV = new Vector2[0];
        }
示例#3
0
        private void MaterialDlg_Load(object sender, EventArgs e)
        {
            if (_material == null) _material = new Material();

            ShowColors();
        }
示例#4
0
 public MeshComponent(GameObject gameObject)
     : base(gameObject)
 {
     Material = new Material();
 }