public MtrlFile(BrgMaterial mat)
: this()
{
this.Diffuse = mat.DiffuseColor;
this.Ambient = mat.AmbientColor;
this.Specular = mat.SpecularColor;
this.Emissive = mat.EmissiveColor;
this.SpecularLevel = mat.SpecularExponent;
this.Alpha = mat.Opacity;
if (!mat.Flags.HasFlag(BrgMatFlag.WrapUTx1))
{
this.ClampU = 1;
}
if (!mat.Flags.HasFlag(BrgMatFlag.WrapVTx1))
{
this.ClampV = 1;
}
if (mat.Flags.HasFlag(BrgMatFlag.AdditiveBlend))
{
this.AlphaMode = 6;
}
if (mat.Flags.HasFlag(BrgMatFlag.PixelXForm1))
{
this.ColorTransform = 4;
}
if (mat.Flags.HasFlag(BrgMatFlag.REFLECTIONTEXTURE))
{
this.TextureFactor = 1275068416;
this.MultiTextureMode = 12;
this.TexGenMode1 = 1;
}
this.Texture = mat.DiffuseMap;
}