History

Merge branch 'master' of http://github.com/highfidelity/hifi into taa

Olivier Prat committed 8 years ago

Commit 1aa41912 parents b7b478f b41129f53 files · +721 −344Browse files

Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 53 files). Show all

Unified · Split

libraries/render-utils/src/RenderDeferredTask.cpp+17−2
@@ -12,6 +12,8 @@ · 11 unmodified lines
12 12
13#include "RenderDeferredTask.h"13#include "RenderDeferredTask.h"
14 14
15#include <DependencyManager.h>
16
15#include <PerfStat.h>17#include <PerfStat.h>
16#include <PathUtils.h>18#include <PathUtils.h>
17#include <ViewFrustum.h>19#include <ViewFrustum.h>
@@ -177,7 +179,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 159 unmodified lines
177 task.addJob<DrawHaze>("DrawHazeDeferred", drawHazeInputs);179 task.addJob<DrawHaze>("DrawHazeDeferred", drawHazeInputs);
178 180
179 // Render transparent objects forward in LightingBuffer181 // Render transparent objects forward in LightingBuffer
180 const auto transparentsInputs = DrawDeferred::Inputs(transparents, lightingModel).asVarying();182 const auto transparentsInputs = DrawDeferred::Inputs(transparents, lightingModel, lightClusters).asVarying();
181 task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);183 task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);
182 184
183 // Light Cluster Grid Debuging job185 // Light Cluster Grid Debuging job
@@ -308,6 +310,8 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 124 unmodified lines
308 310
309 const auto& inItems = inputs.get0();311 const auto& inItems = inputs.get0();
310 const auto& lightingModel = inputs.get1();312 const auto& lightingModel = inputs.get1();
313 const auto& lightClusters = inputs.get2();
314 auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>();
311 315
312 RenderArgs* args = renderContext->args;316 RenderArgs* args = renderContext->args;
313 317
@@ -329,7 +333,13 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 15 unmodified lines
329 // Setup lighting model for all items;333 // Setup lighting model for all items;
330 batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());334 batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
331 335
332 // Setup haze iff current zone has haze336 deferredLightingEffect->setupLocalLightsBatch(batch,
337 render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_GRID_SLOT,
338 render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
339 render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_FRUSTUM_GRID_SLOT,
340 lightClusters);
341
342 // Setup haze if current zone has haze
333 auto hazeStage = args->_scene->getStage<HazeStage>();343 auto hazeStage = args->_scene->getStage<HazeStage>();
334 if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) {344 if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) {
335 graphics::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front());345 graphics::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front());
@@ -351,6 +361,11 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 15 unmodified lines
351 361
352 args->_batch = nullptr;362 args->_batch = nullptr;
353 args->_globalShapeKey = 0;363 args->_globalShapeKey = 0;
364
365 deferredLightingEffect->unsetLocalLightsBatch(batch,
366 render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_GRID_SLOT,
367 render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
368 render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_FRUSTUM_GRID_SLOT);
354 });369 });
355 370
356 config->setNumDrawn((int)inItems.size());371 config->setNumDrawn((int)inItems.size());