mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
Merge pull request #7349 from zzmp/fix/guard-skybox-tex
Guard against failure to load skybox tex
This commit is contained in:
commit
307a0cf05a
1 changed files with 10 additions and 6 deletions
|
@ -379,15 +379,19 @@ void EntityTreeRenderer::applyZonePropertiesToScene(std::shared_ptr<ZoneEntityIt
|
||||||
_pendingSkyboxTexture = false;
|
_pendingSkyboxTexture = false;
|
||||||
|
|
||||||
auto texture = _skyboxTexture->getGPUTexture();
|
auto texture = _skyboxTexture->getGPUTexture();
|
||||||
skybox->setCubemap(texture);
|
if (texture) {
|
||||||
if (!isAmbientTextureSet) {
|
skybox->setCubemap(texture);
|
||||||
sceneKeyLight->setAmbientSphere(texture->getIrradiance());
|
if (!isAmbientTextureSet) {
|
||||||
sceneKeyLight->setAmbientMap(texture);
|
sceneKeyLight->setAmbientSphere(texture->getIrradiance());
|
||||||
isAmbientTextureSet = true;
|
sceneKeyLight->setAmbientMap(texture);
|
||||||
|
isAmbientTextureSet = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qCDebug(entitiesrenderer) << "Failed to load skybox texture:" << zone->getSkyboxProperties().getURL();
|
||||||
|
skybox->setCubemap(nullptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
skybox->setCubemap(nullptr);
|
skybox->setCubemap(nullptr);
|
||||||
qCDebug(entitiesrenderer) << "Failed to load skybox:" << zone->getSkyboxProperties().getURL();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
skyStage->setBackgroundMode(model::SunSkyStage::SKY_BOX);
|
skyStage->setBackgroundMode(model::SunSkyStage::SKY_BOX);
|
||||||
|
|
Loading…
Reference in a new issue