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
1212
1313 #include "RenderDeferredTask.h"
1414
15+#include <DependencyManager.h>
16+
1517 #include <PerfStat.h>
1618 #include <PathUtils.h>
1719 #include <ViewFrustum.h>
@@ -177,7 +179,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 159 unmodified lines
177179 task.addJob<DrawHaze>("DrawHazeDeferred", drawHazeInputs);
178180
179181 // 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();
181183 task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);
182184
183185 // Light Cluster Grid Debuging job
@@ -308,6 +310,8 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 124 unmodified lines
308310
309311 const auto& inItems = inputs.get0();
310312 const auto& lightingModel = inputs.get1();
313+ const auto& lightClusters = inputs.get2();
314+ auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>();
311315
312316 RenderArgs* args = renderContext->args;
313317
@@ -329,7 +333,13 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 15 unmodified lines
329333 // Setup lighting model for all items;
330334 batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
331335
332− // Setup haze iff current zone has haze
336+ 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
333343 auto hazeStage = args->_scene->getStage<HazeStage>();
334344 if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) {
335345 graphics::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front());
@@ -351,6 +361,11 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 15 unmodified lines
351361
352362 args->_batch = nullptr;
353363 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);
354369 });
355370
356371 config->setNumDrawn((int)inItems.size());