From e645f8a1f121c3b0b2d566ddea821054c0d2e072 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 1 Feb 2016 16:25:55 -0800 Subject: [PATCH] FIxing the rendering bug, current zone enity lighting and skybox were not applied anymore --- interface/src/Application.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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); } {