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;
}