mirror of
https://github.com/overte-org/overte.git
synced 2025-06-25 19:09:39 +02:00
set skybox default color to empty color
This commit is contained in:
parent
8d5a896ccf
commit
24162f0f3d
2 changed files with 14 additions and 7 deletions
|
@ -1220,7 +1220,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
_defaultSkyboxAmbientTexture = textureCache->getImageTexture(skyboxAmbientUrl, NetworkTexture::CUBE_TEXTURE, { { "generateIrradiance", true } });
|
_defaultSkyboxAmbientTexture = textureCache->getImageTexture(skyboxAmbientUrl, NetworkTexture::CUBE_TEXTURE, { { "generateIrradiance", true } });
|
||||||
|
|
||||||
_defaultSkybox->setCubemap(_defaultSkyboxTexture);
|
_defaultSkybox->setCubemap(_defaultSkyboxTexture);
|
||||||
_defaultSkybox->setColor({ 1.0, 1.0, 1.0 });
|
|
||||||
|
|
||||||
EntityItem::setEntitiesShouldFadeFunction([this]() {
|
EntityItem::setEntitiesShouldFadeFunction([this]() {
|
||||||
SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
|
SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
|
||||||
|
@ -4327,8 +4326,9 @@ namespace render {
|
||||||
sceneKeyLight->setIntensity(DEFAULT_SKYBOX_INTENSITY);
|
sceneKeyLight->setIntensity(DEFAULT_SKYBOX_INTENSITY);
|
||||||
sceneKeyLight->setAmbientIntensity(DEFAULT_SKYBOX_AMBIENT_INTENSITY);
|
sceneKeyLight->setAmbientIntensity(DEFAULT_SKYBOX_AMBIENT_INTENSITY);
|
||||||
sceneKeyLight->setDirection(DEFAULT_SKYBOX_DIRECTION);
|
sceneKeyLight->setDirection(DEFAULT_SKYBOX_DIRECTION);
|
||||||
// fall through: render a skybox, if available
|
// fall through: render a skybox (if available), or the defaults (if requested)
|
||||||
}
|
}
|
||||||
|
|
||||||
case model::SunSkyStage::SKY_BOX: {
|
case model::SunSkyStage::SKY_BOX: {
|
||||||
auto skybox = skyStage->getSkybox();
|
auto skybox = skyStage->getSkybox();
|
||||||
if (!skybox->empty()) {
|
if (!skybox->empty()) {
|
||||||
|
@ -4336,25 +4336,32 @@ namespace render {
|
||||||
skybox->render(batch, args->getViewFrustum());
|
skybox->render(batch, args->getViewFrustum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// fall through: render defaults, if available
|
// fall through: render defaults (if requested)
|
||||||
}
|
}
|
||||||
|
|
||||||
case model::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE: {
|
case model::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE: {
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
|
||||||
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
|
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
|
||||||
auto sceneKeyLight = scene->getKeyLight();
|
auto sceneKeyLight = scene->getKeyLight();
|
||||||
auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
|
auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
|
||||||
// do not set the ambient sphere - it peaks too high, and causes flashing when turning
|
// set the ambient sphere uniformly - the defaultSkyboxAmbientTexture has peaks that cause flashing when turning
|
||||||
|
sceneKeyLight->setAmbientSphere(DependencyManager::get<TextureCache>()->getWhiteTexture()->getIrradiance());
|
||||||
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
|
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
|
||||||
|
// fall through: render defaults skybox
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// fall through: render defaults, if available
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case model::SunSkyStage::SKY_DEFAULT_TEXTURE:
|
case model::SunSkyStage::SKY_DEFAULT_TEXTURE:
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) {
|
||||||
qApp->getDefaultSkybox()->render(batch, args->getViewFrustum());
|
qApp->getDefaultSkybox()->render(batch, args->getViewFrustum());
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Any other cases require no extra rendering
|
||||||
case model::SunSkyStage::NO_BACKGROUND:
|
case model::SunSkyStage::NO_BACKGROUND:
|
||||||
default:
|
default:
|
||||||
// this line intentionally left blank
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ protected:
|
||||||
|
|
||||||
class Schema {
|
class Schema {
|
||||||
public:
|
public:
|
||||||
glm::vec3 color { 1.0f, 1.0f, 1.0f };
|
glm::vec3 color { 0.0f, 0.0f, 0.0f };
|
||||||
float blend { 0.0f };
|
float blend { 0.0f };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue