Beispiel #1
0
        private WowMaterial MakeMaterialFromWhTexUnit(WhTexUnit whTexUnit)
        {
            var material = new WowMaterial()
            {
                BothSides = !whTexUnit.Cull,
                Type      = GetMaterialTypeFromBlendFlag(whTexUnit.RenderFlag.Blend)
            };

            var whTextures = whTexUnit.GetTextures();

            var images = new TextureImage[]
            {
                GetImageFromWhTextureInfo(whTextures["Texture1"]),
                GetImageFromWhTextureInfo(whTextures["Texture2"]),
                GetImageFromWhTextureInfo(whTextures["Texture3"]),
                GetImageFromWhTextureInfo(whTextures["Texture4"])
            };

            material.MainImage = images.FirstOrDefault(x => x != null);

            material.Image1 = images[0];
            material.Image2 = images[1];
            material.Image3 = images[2];
            material.Image4 = images[3];

            return(material);
        }