3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-12 10:22:26 +02:00

possible fix for transparency

This commit is contained in:
SamGondelman 2019-01-29 12:20:46 -08:00
parent faeb5b36dc
commit 5be6a31b6c
2 changed files with 7 additions and 9 deletions
libraries
model-networking/src/model-networking
render-utils/src

View file

@ -409,11 +409,11 @@ void Geometry::setTextures(const QVariantMap& textureMap) {
material->setTextures(textureMap);
_areTexturesLoaded = false;
// If we only use cached textures, they should all be loaded
areTexturesLoaded();
}
}
// If we only use cached textures, they should all be loaded
areTexturesLoaded();
} else {
qCWarning(modelnetworking) << "Ignoring setTextures(); geometry not ready";
}
@ -422,10 +422,7 @@ void Geometry::setTextures(const QVariantMap& textureMap) {
bool Geometry::areTexturesLoaded() const {
if (!_areTexturesLoaded) {
for (auto& material : _materials) {
// Check if material textures are loaded
bool materialMissingTexture = material->isMissingTexture();
if (materialMissingTexture) {
if (material->isMissingTexture()) {
return false;
}

View file

@ -482,6 +482,7 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial
auto itr = textureMaps.find(graphics::MaterialKey::ALBEDO_MAP);
if (itr != textureMaps.end()) {
if (itr->second->isDefined()) {
material->resetOpacityMap();
drawMaterialTextures->setTexture(gr::Texture::MaterialAlbedo, itr->second->getTextureView());
wasSet = true;
} else {
@ -492,8 +493,8 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial
forceDefault = true;
}
schemaKey.setAlbedoMap(true);
schemaKey.setOpacityMaskMap(materialKey.isOpacityMaskMap());
schemaKey.setTranslucentMap(materialKey.isTranslucentMap());
schemaKey.setOpacityMaskMap(material->getKey().isOpacityMaskMap());
schemaKey.setTranslucentMap(material->getKey().isTranslucentMap());
}
break;
case graphics::MaterialKey::METALLIC_MAP_BIT: