mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge pull request #8550 from zzmp/fix/ambient-skybox
fix washed out white ambient (by restoring tex)
This commit is contained in:
commit
76a7226bba
1 changed files with 6 additions and 11 deletions
|
@ -4318,18 +4318,14 @@ namespace render {
|
||||||
|
|
||||||
switch (backgroundMode) {
|
switch (backgroundMode) {
|
||||||
case model::SunSkyStage::SKY_DEFAULT: {
|
case model::SunSkyStage::SKY_DEFAULT: {
|
||||||
static const glm::vec3 DEFAULT_SKYBOX_COLOR{ 255.0f / 255.0f, 220.0f / 255.0f, 194.0f / 255.0f };
|
|
||||||
static const float DEFAULT_SKYBOX_INTENSITY{ 0.2f };
|
|
||||||
static const float DEFAULT_SKYBOX_AMBIENT_INTENSITY{ 2.0f };
|
|
||||||
static const glm::vec3 DEFAULT_SKYBOX_DIRECTION{ 0.0f, 0.0f, -1.0f };
|
|
||||||
|
|
||||||
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
|
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
|
||||||
auto sceneKeyLight = scene->getKeyLight();
|
auto sceneKeyLight = scene->getKeyLight();
|
||||||
|
|
||||||
scene->setSunModelEnable(false);
|
scene->setSunModelEnable(false);
|
||||||
sceneKeyLight->setColor(DEFAULT_SKYBOX_COLOR);
|
sceneKeyLight->setColor(ColorUtils::toVec3(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_COLOR));
|
||||||
sceneKeyLight->setIntensity(DEFAULT_SKYBOX_INTENSITY);
|
sceneKeyLight->setIntensity(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_INTENSITY);
|
||||||
sceneKeyLight->setAmbientIntensity(DEFAULT_SKYBOX_AMBIENT_INTENSITY);
|
sceneKeyLight->setAmbientIntensity(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_AMBIENT_INTENSITY);
|
||||||
sceneKeyLight->setDirection(DEFAULT_SKYBOX_DIRECTION);
|
sceneKeyLight->setDirection(KeyLightPropertyGroup::DEFAULT_KEYLIGHT_DIRECTION);
|
||||||
// fall through: render a skybox (if available), or the defaults (if requested)
|
// fall through: render a skybox (if available), or the defaults (if requested)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4348,8 +4344,7 @@ namespace render {
|
||||||
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();
|
||||||
// set the ambient sphere uniformly - the defaultSkyboxAmbientTexture has peaks that cause flashing when turning
|
sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
|
||||||
sceneKeyLight->setAmbientSphere(DependencyManager::get<TextureCache>()->getWhiteTexture()->getIrradiance());
|
|
||||||
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
|
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
|
||||||
// fall through: render defaults skybox
|
// fall through: render defaults skybox
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue