open3mod.MaterialMapper.UploadTextures C# (CSharp) Method

UploadTextures() public method

Uploads all the textures required for a given material to VRAM (i.e. create the corresponding Gl objects). Textures that have been uploaded before are not attempted again.
public UploadTextures ( Assimp.Material material ) : bool
material Assimp.Material
return bool
        public bool UploadTextures(Material material)
        {
            Debug.Assert(material != null);
            var any = false;

            // note: keep this up to date with the code in ApplyFixedFunctionMaterial
            if (material.GetMaterialTextureCount(TextureType.Diffuse) > 0)
            {
                TextureSlot tex;
                material.GetMaterialTexture(TextureType.Diffuse, 0, out tex);

                var gtex = _scene.TextureSet.GetOriginalOrReplacement(tex.FilePath);

                if (gtex.State == Texture.TextureState.WinFormsImageCreated)
                {
                    gtex.Upload();
                    any = true;
                }
                else if (gtex.ReconfigureUploadedTextureRequested)
                {
                    gtex.ReconfigureUploadedTexture();
                }
            }
            return any;
        }