mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 03:40:20 +02:00
possible fix for transparency
This commit is contained in:
parent
faeb5b36dc
commit
5be6a31b6c
2 changed files with 7 additions and 9 deletions
|
@ -409,11 +409,11 @@ void Geometry::setTextures(const QVariantMap& textureMap) {
|
||||||
|
|
||||||
material->setTextures(textureMap);
|
material->setTextures(textureMap);
|
||||||
_areTexturesLoaded = false;
|
_areTexturesLoaded = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we only use cached textures, they should all be loaded
|
// If we only use cached textures, they should all be loaded
|
||||||
areTexturesLoaded();
|
areTexturesLoaded();
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
qCWarning(modelnetworking) << "Ignoring setTextures(); geometry not ready";
|
qCWarning(modelnetworking) << "Ignoring setTextures(); geometry not ready";
|
||||||
}
|
}
|
||||||
|
@ -422,10 +422,7 @@ void Geometry::setTextures(const QVariantMap& textureMap) {
|
||||||
bool Geometry::areTexturesLoaded() const {
|
bool Geometry::areTexturesLoaded() const {
|
||||||
if (!_areTexturesLoaded) {
|
if (!_areTexturesLoaded) {
|
||||||
for (auto& material : _materials) {
|
for (auto& material : _materials) {
|
||||||
// Check if material textures are loaded
|
if (material->isMissingTexture()) {
|
||||||
bool materialMissingTexture = material->isMissingTexture();
|
|
||||||
|
|
||||||
if (materialMissingTexture) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -482,6 +482,7 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial
|
||||||
auto itr = textureMaps.find(graphics::MaterialKey::ALBEDO_MAP);
|
auto itr = textureMaps.find(graphics::MaterialKey::ALBEDO_MAP);
|
||||||
if (itr != textureMaps.end()) {
|
if (itr != textureMaps.end()) {
|
||||||
if (itr->second->isDefined()) {
|
if (itr->second->isDefined()) {
|
||||||
|
material->resetOpacityMap();
|
||||||
drawMaterialTextures->setTexture(gr::Texture::MaterialAlbedo, itr->second->getTextureView());
|
drawMaterialTextures->setTexture(gr::Texture::MaterialAlbedo, itr->second->getTextureView());
|
||||||
wasSet = true;
|
wasSet = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -492,8 +493,8 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial
|
||||||
forceDefault = true;
|
forceDefault = true;
|
||||||
}
|
}
|
||||||
schemaKey.setAlbedoMap(true);
|
schemaKey.setAlbedoMap(true);
|
||||||
schemaKey.setOpacityMaskMap(materialKey.isOpacityMaskMap());
|
schemaKey.setOpacityMaskMap(material->getKey().isOpacityMaskMap());
|
||||||
schemaKey.setTranslucentMap(materialKey.isTranslucentMap());
|
schemaKey.setTranslucentMap(material->getKey().isTranslucentMap());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case graphics::MaterialKey::METALLIC_MAP_BIT:
|
case graphics::MaterialKey::METALLIC_MAP_BIT:
|
||||||
|
|
Loading…
Reference in a new issue