Esempio n. 1
0
        public static SurfaceMaterial CreateFrameMaterial(FrameMaterialInfo mi)
        {
            BrdfClass brdfClass;
            if (!BrdfClass.TryParse(mi.BrdfClass, true, out brdfClass))
            {
                throw new ArgumentException("Invalid brdf class");
            }

            var matInfo = new MaterialInfo()
            {
                DataFile = mi.DataFile,
                Kd = mi.Diffuse,
                Kr = mi.Specular,
                Ks = mi.Glossy,
                PhongExponent = mi.Exponent,
                Name = mi.MaterialName,
                DiffuseTexture = new ImageTextureInfo() { FilePath = mi.DiffuseTexture },
                BumpTexture = new ImageTextureInfo() { FilePath = mi.BumpTexture },
                AlphaTexture = new ImageTextureInfo() { FilePath = mi.AlphaTexture },

            };

            return CreateMaterial(brdfClass, matInfo);
        }
Esempio n. 2
0
 public FrameMaterialBuilder(FrameMaterialInfo[] items)
 {
     this.items = items;
     surfMats = this.items.Select(SurfaceMaterials.CreateFrameMaterial).ToArray();
     //ApplyMaterialOverrides(surfMats, overrides);
 }