Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 436 files). Show all
Unified · Split
| @@ -12,12 +12,15 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include "RenderDeferredTask.h" |
| 14 | 14 | |
| 15 | +#include <QtCore/qglobal.h> | |
| 16 | + | |
| 15 | 17 | #include <DependencyManager.h> |
| 16 | 18 | |
| 17 | 19 | #include <PerfStat.h> |
| 18 | 20 | #include <PathUtils.h> |
| 19 | 21 | #include <ViewFrustum.h> |
| 20 | 22 | #include <gpu/Context.h> |
| 23 | +#include <graphics/ShaderConstants.h> | |
| 21 | 24 | |
| 22 | 25 | #include <render/CullTask.h> |
| 23 | 26 | #include <render/FilterTask.h> |
| @@ -29,6 +32,7 @@ · 5 unmodified lines | ||
| 29 | 32 | #include <render/ResampleTask.h> |
| 30 | 33 | |
| 31 | 34 | #include "RenderHifi.h" |
| 35 | +#include "render-utils/ShaderConstants.h" | |
| 32 | 36 | #include "RenderCommonTask.h" |
| 33 | 37 | #include "LightingModel.h" |
| 34 | 38 | #include "StencilMaskPass.h" |
| @@ -56,6 +60,17 @@ · 21 unmodified lines | ||
| 56 | 60 | using namespace render; |
| 57 | 61 | extern void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePipeline::BatchSetter& batchSetter, const render::ShapePipeline::ItemSetter& itemSetter); |
| 58 | 62 | |
| 63 | +namespace ru { | |
| 64 | + using render_utils::slot::texture::Texture; | |
| 65 | + using render_utils::slot::buffer::Buffer; | |
| 66 | +} | |
| 67 | + | |
| 68 | +namespace gr { | |
| 69 | + using graphics::slot::texture::Texture; | |
| 70 | + using graphics::slot::buffer::Buffer; | |
| 71 | +} | |
| 72 | + | |
| 73 | + | |
| 59 | 74 | RenderDeferredTask::RenderDeferredTask() |
| 60 | 75 | { |
| 61 | 76 | } |
| @@ -358,27 +373,18 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 296 unmodified lines | ||
| 358 | 373 | batch.setViewTransform(viewMat); |
| 359 | 374 | |
| 360 | 375 | // Setup lighting model for all items; |
| 361 | − batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); | |
| 376 | + batch.setUniformBuffer(ru::Buffer::LightModel, lightingModel->getParametersBuffer()); | |
| 362 | 377 | |
| 363 | 378 | // Set the light |
| 364 | − deferredLightingEffect->setupKeyLightBatch(args, batch, | |
| 365 | − render::ShapePipeline::Slot::KEY_LIGHT, | |
| 366 | − render::ShapePipeline::Slot::LIGHT_AMBIENT_BUFFER, | |
| 367 | − render::ShapePipeline::Slot::LIGHT_AMBIENT_MAP); | |
| 368 | − | |
| 369 | − deferredLightingEffect->setupLocalLightsBatch(batch, | |
| 370 | − render::ShapePipeline::Slot::LIGHT_ARRAY_BUFFER, | |
| 371 | − render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_GRID_SLOT, | |
| 372 | − render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT, | |
| 373 | − render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_FRUSTUM_GRID_SLOT, | |
| 374 | − lightClusters); | |
| 379 | + deferredLightingEffect->setupKeyLightBatch(args, batch); | |
| 380 | + deferredLightingEffect->setupLocalLightsBatch(batch, lightClusters); | |
| 375 | 381 | |
| 376 | 382 | // Setup haze if current zone has haze |
| 377 | 383 | auto hazeStage = args->_scene->getStage<HazeStage>(); |
| 378 | 384 | if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) { |
| 379 | 385 | graphics::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front()); |
| 380 | 386 | if (hazePointer) { |
| 381 | − batch.setUniformBuffer(render::ShapePipeline::Slot::HAZE_MODEL, hazePointer->getHazeParametersBuffer()); | |
| 387 | + batch.setUniformBuffer(ru::Buffer::HazeParams, hazePointer->getHazeParametersBuffer()); | |
| 382 | 388 | } |
| 383 | 389 | } |
| 384 | 390 | |
| @@ -396,16 +402,8 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& · 11 unmodified lines | ||
| 396 | 402 | args->_batch = nullptr; |
| 397 | 403 | args->_globalShapeKey = 0; |
| 398 | 404 | |
| 399 | − deferredLightingEffect->unsetLocalLightsBatch(batch, | |
| 400 | − render::ShapePipeline::Slot::LIGHT_ARRAY_BUFFER, | |
| 401 | − render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_GRID_SLOT, | |
| 402 | − render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT, | |
| 403 | − render::ShapePipeline::Slot::LIGHT_CLUSTER_GRID_FRUSTUM_GRID_SLOT); | |
| 404 | − | |
| 405 | − deferredLightingEffect->unsetKeyLightBatch(batch, | |
| 406 | − render::ShapePipeline::Slot::KEY_LIGHT, | |
| 407 | − render::ShapePipeline::Slot::LIGHT_AMBIENT_BUFFER, | |
| 408 | − render::ShapePipeline::Slot::LIGHT_AMBIENT_MAP); | |
| 405 | + deferredLightingEffect->unsetLocalLightsBatch(batch); | |
| 406 | + deferredLightingEffect->unsetKeyLightBatch(batch); | |
| 409 | 407 | }); |
| 410 | 408 | |
| 411 | 409 | config->setNumDrawn((int)inItems.size()); |
| @@ -440,7 +438,7 @@ void DrawStateSortDeferred::run(const RenderContextPointer& renderContext, const · 28 unmodified lines | ||
| 440 | 438 | batch.setViewTransform(viewMat); |
| 441 | 439 | |
| 442 | 440 | // Setup lighting model for all items; |
| 443 | − batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); | |
| 441 | + batch.setUniformBuffer(ru::Buffer::LightModel, lightingModel->getParametersBuffer()); | |
| 444 | 442 | |
| 445 | 443 | // From the lighting model define a global shapeKey ORED with individiual keys |
| 446 | 444 | ShapeKey::Builder keyBuilder; |