Correction.

This commit is contained in:
Nissim Hadar 2017-10-30 19:20:49 -07:00
parent 1357877618
commit b00db6a68f

View file

@ -498,7 +498,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
auto lightStage = renderContext->_scene->getStage<LightStage>(); auto lightStage = renderContext->_scene->getStage<LightStage>();
assert(lightStage); assert(lightStage);
assert(lightStage->getNumLights() > 0); assert(lightStage->getNumLights() > 0);
auto lightAndShadow = lightStage->getLightAndShadow(0); auto lightAndShadow = lightStage->getCurrentKeyLightAndShadow();
const auto& globalShadow = lightAndShadow.second; const auto& globalShadow = lightAndShadow.second;
// Bind the shadow buffer // Bind the shadow buffer
@ -509,7 +509,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
auto& program = deferredLightingEffect->_directionalSkyboxLight; auto& program = deferredLightingEffect->_directionalSkyboxLight;
LightLocationsPtr locations = deferredLightingEffect->_directionalSkyboxLightLocations; LightLocationsPtr locations = deferredLightingEffect->_directionalSkyboxLightLocations;
auto keyLight = lightStage->getLight(0); auto keyLight = lightAndShadow.first;
model::LightPointer keyAmbientLight; model::LightPointer keyAmbientLight;
if (lightStage && lightStage->_currentFrame._ambientLights.size()) { if (lightStage && lightStage->_currentFrame._ambientLights.size()) {