mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
commit
6051a3913f
1 changed files with 9 additions and 2 deletions
|
@ -511,12 +511,19 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
|
||||||
|
|
||||||
auto keyLight = lightAndShadow.first;
|
auto keyLight = lightAndShadow.first;
|
||||||
|
|
||||||
|
model::LightPointer keyAmbientLight;
|
||||||
|
if (lightStage && lightStage->_currentFrame._ambientLights.size()) {
|
||||||
|
keyAmbientLight = lightStage->getLight(lightStage->_currentFrame._ambientLights.front());
|
||||||
|
}
|
||||||
|
bool hasAmbientMap = (keyAmbientLight != nullptr);
|
||||||
|
|
||||||
// Setup the global directional pass pipeline
|
// Setup the global directional pass pipeline
|
||||||
{
|
{
|
||||||
if (deferredLightingEffect->_shadowMapEnabled) {
|
if (deferredLightingEffect->_shadowMapEnabled) {
|
||||||
|
|
||||||
// If the keylight has an ambient Map then use the Skybox version of the pass
|
// If the keylight has an ambient Map then use the Skybox version of the pass
|
||||||
// otherwise use the ambient sphere version
|
// otherwise use the ambient sphere version
|
||||||
if (keyLight->getAmbientMap()) {
|
if (hasAmbientMap) {
|
||||||
program = deferredLightingEffect->_directionalSkyboxLightShadow;
|
program = deferredLightingEffect->_directionalSkyboxLightShadow;
|
||||||
locations = deferredLightingEffect->_directionalSkyboxLightShadowLocations;
|
locations = deferredLightingEffect->_directionalSkyboxLightShadowLocations;
|
||||||
} else {
|
} else {
|
||||||
|
@ -526,7 +533,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
|
||||||
} else {
|
} else {
|
||||||
// If the keylight has an ambient Map then use the Skybox version of the pass
|
// If the keylight has an ambient Map then use the Skybox version of the pass
|
||||||
// otherwise use the ambient sphere version
|
// otherwise use the ambient sphere version
|
||||||
if (keyLight->getAmbientMap()) {
|
if (hasAmbientMap) {
|
||||||
program = deferredLightingEffect->_directionalSkyboxLight;
|
program = deferredLightingEffect->_directionalSkyboxLight;
|
||||||
locations = deferredLightingEffect->_directionalSkyboxLightLocations;
|
locations = deferredLightingEffect->_directionalSkyboxLightLocations;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue