diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 28bc934772..ab5edec527 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3694,7 +3694,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se pendingChanges.resetItem(BackgroundRenderData::_item, backgroundRenderPayload); } - // Assuming nothing get's rendered through that + // Assuming nothing get's rendered through that if (!selfAvatarOnly) { if (DependencyManager::get()->shouldRenderEntities()) { // render models... @@ -3722,9 +3722,23 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se pendingChanges.resetItem(WorldBoxRenderData::_item, worldBoxRenderPayload); } else { pendingChanges.updateItem(WorldBoxRenderData::_item, - [](WorldBoxRenderData& payload) { - payload._val++; - }); + [](WorldBoxRenderData& payload) { + payload._val++; + }); + } + + // Setup the current Zone Entity lighting and skybox + // Fixme: We need a better soution through an actual render item !!! + { + DependencyManager::get()->setAmbientLightMode(getRenderAmbientLight()); + auto skyStage = DependencyManager::get()->getSkyStage(); + DependencyManager::get()->setGlobalLight(skyStage->getSunLight()->getDirection(), skyStage->getSunLight()->getColor(), skyStage->getSunLight()->getIntensity(), skyStage->getSunLight()->getAmbientIntensity()); + + auto skybox = model::SkyboxPointer(); + if (skyStage->getBackgroundMode() == model::SunSkyStage::SKY_BOX) { + skybox = skyStage->getSkybox(); + } + DependencyManager::get()->setGlobalSkybox(skybox); } {