From 70cc7d87e474baf0f7c8edc42e20a93cf4f03294 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 13 Jan 2016 17:52:02 -0800 Subject: [PATCH] Expose global light through DeferredLighting singleton --- libraries/render-utils/src/DeferredLightingEffect.cpp | 4 ++++ libraries/render-utils/src/DeferredLightingEffect.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index 7c8aa393d4..a5fce0b377 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -541,6 +541,10 @@ void DeferredLightingEffect::setGlobalLight(const glm::vec3& direction, const gl light->setAmbientIntensity(ambientIntensity); } +model::LightPointer DeferredLightingEffect::getGlobalLight() { + return _allocatedLights[_globalLights.front()]; +} + void DeferredLightingEffect::setGlobalSkybox(const model::SkyboxPointer& skybox) { _skybox = skybox; } diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index cb746153a1..e75961e11a 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -48,9 +48,10 @@ public: void setAmbientLightMode(int preset); void setGlobalLight(const glm::vec3& direction, const glm::vec3& diffuse, float intensity, float ambientIntensity); void setGlobalAtmosphere(const model::AtmospherePointer& atmosphere) { _atmosphere = atmosphere; } - void setGlobalSkybox(const model::SkyboxPointer& skybox); + model::LightPointer getGlobalLight(); + private: DeferredLightingEffect() = default;