Showing the changes to libraries/render-utils/src/RenderViewTask.cpp (1 of 18 files). Show all
Unified · Split
| @@ -16,24 +16,25 @@ · 15 unmodified lines | |||
| 16 | #include "RenderForwardTask.h" | 16 | #include "RenderForwardTask.h" |
| 17 | 17 | ||
| 18 | void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, bool isDeferred, uint8_t tagBits, uint8_t tagMask) { | 18 | void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, bool isDeferred, uint8_t tagBits, uint8_t tagMask) { |
| 19 | // auto items = input.get<Input>(); | ||
| 20 | |||
| 21 | const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask); | 19 | const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask); |
| 22 | assert(items.canCast<RenderFetchCullSortTask::Output>()); | 20 | assert(items.canCast<RenderFetchCullSortTask::Output>()); |
| 23 | 21 | ||
| 24 | // const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items[0]); | 22 | // Issue the lighting model, aka the big global settings for the view |
| 23 | const auto lightingModel = task.addJob<MakeLightingModel>("LightingModel"); | ||
| 24 | |||
| 25 | // Assemble the lighting stages current frames | ||
| 25 | const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items); | 26 | const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items); |
| 26 | 27 | ||
| 27 | if (isDeferred) { | 28 | if (isDeferred) { |
| 28 | // Warning : the cull functor passed to the shadow pass should only be testing for LOD culling. If frustum culling | 29 | // Warning : the cull functor passed to the shadow pass should only be testing for LOD culling. If frustum culling |
| 29 | // is performed, then casters not in the view frustum will be removed, which is not what we wish. | 30 | // is performed, then casters not in the view frustum will be removed, which is not what we wish. |
| 30 | const auto& ligthStageFrame = lightingStageFramesAndZones.get<AssembleLightingStageTask::Output>().get0()[0]; | 31 | const auto shadowTaskIn = RenderShadowTask::Input(lightingStageFramesAndZones.get<AssembleLightingStageTask::Output>().get0()[0], lightingModel).asVarying(); |
| 31 | const auto cascadeSceneBBoxes = task.addJob<RenderShadowTask>("RenderShadowTask", ligthStageFrame, cullFunctor, tagBits, tagMask); | 32 | const auto shadowTaskOut = task.addJob<RenderShadowTask>("RenderShadowTask", shadowTaskIn, cullFunctor, tagBits, tagMask); |
| 32 | 33 | ||
| 33 | const auto renderInput = RenderDeferredTask::Input(items, lightingStageFramesAndZones, cascadeSceneBBoxes).asVarying(); | 34 | const auto renderInput = RenderDeferredTask::Input(items, lightingModel, lightingStageFramesAndZones, shadowTaskOut).asVarying(); |
| 34 | task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput, true); | 35 | task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput); |
| 35 | } else { | 36 | } else { |
| 36 | const auto renderInput = RenderForwardTask::Input(items, lightingStageFramesAndZones).asVarying(); | 37 | const auto renderInput = RenderForwardTask::Input(items, lightingModel, lightingStageFramesAndZones).asVarying(); |
| 37 | task.addJob<RenderForwardTask>("Forward", renderInput); | 38 | task.addJob<RenderForwardTask>("Forward", renderInput); |
| 38 | } | 39 | } |
| 39 | } | 40 | } |