diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index 5f18916a92..7b1ea1768d 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -740,8 +740,8 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { _defaultLight = lp; // Add the global light to the light stage (for later shadow rendering) - auto defaultLightID = lightStage->addLight(lp); - lightStage->addShadow(defaultLightID); + _defaultLightID = lightStage->addLight(lp); + lightStage->addShadow(_defaultLightID); } auto backgroundStage = renderContext->_scene->getStage(); @@ -754,7 +754,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { _defaultBackground = background; // Add the global light to the light stage (for later shadow rendering) - auto defaultBackgroundID = backgroundStage->addBackground(_defaultBackground); + _defaultBackgroundID = backgroundStage->addBackground(_defaultBackground); } } } diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index 7fc9600d18..a4d62ea407 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -180,7 +180,9 @@ public: protected: model::LightPointer _defaultLight; + LightStage::Index _defaultLightID{ LightStage::INVALID_INDEX }; model::SunSkyStagePointer _defaultBackground; + BackgroundStage::Index _defaultBackgroundID{ BackgroundStage::INVALID_INDEX }; model::SkyboxPointer _defaultSkybox { new ProceduralSkybox() }; gpu::TexturePointer _defaultSkyboxTexture; gpu::TexturePointer _defaultSkyboxAmbientTexture;