Only consider model transparent if all texs are

This commit is contained in:
Zach Pomerantz 2016-03-11 15:15:30 -08:00
parent a89a76dc4b
commit 9dcdf26567

View file

@ -135,7 +135,7 @@ bool NetworkGeometry::isLoadedWithTextures() const {
}
if (!_isLoadedWithTextures) {
_hasTransparentTextures = false;
_hasTransparentTextures = true;
for (auto&& material : _materials) {
if ((material->albedoTexture && !material->albedoTexture->isLoaded()) ||
@ -152,7 +152,8 @@ bool NetworkGeometry::isLoadedWithTextures() const {
const auto& usage = material->albedoTexture->getGPUTexture()->getUsage();
bool isTransparentTexture = usage.isAlpha() && !usage.isAlphaMask();
material->_material->setTransparentTexture(isTransparentTexture);
_hasTransparentTextures = _hasTransparentTextures || isTransparentTexture;
// FIXME: Materials with *some* transparent textures seem to give all *other* textures alphas of 0.
_hasTransparentTextures = isTransparentTexture && _hasTransparentTextures;
}
}