Exemplo n.º 1
0
        public static void CalculateAllAlphas(MaterialPtr material)
        {
            if (material == null)
            {
                return;
            }

            foreach (var technique in material.GetTechniqueIterator())
            {
                foreach (var pass in technique.GetPassIterator())
                {
                    foreach (var textureUnit in pass.GetTextureUnitStateIterator())
                    {
                        if (string.IsNullOrEmpty(textureUnit.TextureName))
                        {
                            return;
                        }

                        if (TextureManager.Singleton.GetByName(textureUnit.TextureName) == null)
                        {
                            var texture = TextureManager.Singleton.Load(textureUnit.TextureName, material.Group,
                                                                        TextureType.TEX_TYPE_2D,
                                                                        textureUnit.NumMipmaps, 1, false,
                                                                        PixelFormat.PF_A8R8G8B8);
                            CalculateAplha(texture);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void CalculateAllAlphas(MaterialPtr material)
        {
            if (material == null) return;

            foreach (var technique in material.GetTechniqueIterator())
            {
                foreach (var pass in technique.GetPassIterator())
                {
                    foreach (var textureUnit in pass.GetTextureUnitStateIterator())
                    {
                        if (string.IsNullOrEmpty(textureUnit.TextureName)) return;

                        if (TextureManager.Singleton.GetByName(textureUnit.TextureName) == null)
                        {
                            var texture = TextureManager.Singleton.Load(textureUnit.TextureName, material.Group,
                                                                        TextureType.TEX_TYPE_2D,
                                                                        textureUnit.NumMipmaps, 1, false,
                                                                        PixelFormat.PF_A8R8G8B8);
                            CalculateAplha(texture);
                        }
                    }
                }
            }
        }