mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 03:13:51 +02:00
FINALLY fix transparent textures rendering wrong
This commit is contained in:
parent
6f011b70ac
commit
10a0f77d4c
1 changed files with 5 additions and 2 deletions
|
@ -422,7 +422,7 @@ bool Geometry::areTexturesLoaded() const {
|
|||
}
|
||||
// Failed texture downloads need to be considered as 'loaded'
|
||||
// or the object will never fade in
|
||||
bool finished = texture->isLoaded() || texture->isFailed();
|
||||
bool finished = texture->isFailed() || (texture->isLoaded() && texture->getGPUTexture() && texture->getGPUTexture()->isDefined());
|
||||
if (!finished) {
|
||||
return true;
|
||||
}
|
||||
|
@ -434,8 +434,11 @@ bool Geometry::areTexturesLoaded() const {
|
|||
}
|
||||
|
||||
// If material textures are loaded, check the material translucency
|
||||
// FIXME: This should not be done here. The opacity map should already be reset in Material::setTextureMap.
|
||||
// However, currently that code can be called before the albedo map is defined, so resetOpacityMap will fail.
|
||||
// Geometry::areTexturesLoaded() is called repeatedly until it returns true, so we do the check here for now
|
||||
const auto albedoTexture = material->_textures[NetworkMaterial::MapChannel::ALBEDO_MAP];
|
||||
if (albedoTexture.texture && albedoTexture.texture->getGPUTexture()) {
|
||||
if (albedoTexture.texture) {
|
||||
material->resetOpacityMap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue