Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 53 files). Show all
Unified · Split
| @@ -12,6 +12,8 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include "RenderDeferredTask.h" |
| 14 | 14 | |
| 15 | +#include <DependencyManager.h> | |
| 16 | + | |
| 15 | 17 | #include <PerfStat.h> |
| 16 | 18 | #include <PathUtils.h> |
| 17 | 19 | #include <ViewFrustum.h> |
| @@ -177,7 +179,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 159 unmodified lines | ||
| 177 | 179 | task.addJob<DrawHaze>("DrawHazeDeferred", drawHazeInputs); |
| 178 | 180 | |
| 179 | 181 | // 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 | 183 | task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber); |
| 182 | 184 | |
| 183 | 185 | // Light Cluster Grid Debuging job |
| @@ -308,6 +310,8 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 124 unmodified lines | ||
| 308 | 310 | |
| 309 | 311 | const auto& inItems = inputs.get0(); |
| 310 | 312 | const auto& lightingModel = inputs.get1(); |
| 313 | + const auto& lightClusters = inputs.get2(); | |
| 314 | + auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>(); | |
| 311 | 315 | |
| 312 | 316 | RenderArgs* args = renderContext->args; |
| 313 | 317 | |
| @@ -329,7 +333,13 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 15 unmodified lines | ||
| 329 | 333 | // Setup lighting model for all items; |
| 330 | 334 | batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); |
| 331 | 335 | |
| 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 | |
| 333 | 343 | auto hazeStage = args->_scene->getStage<HazeStage>(); |
| 334 | 344 | if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) { |
| 335 | 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 | 362 | args->_batch = nullptr; |
| 353 | 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 | 371 | config->setNumDrawn((int)inItems.size()); |