History

Shadows are completely working with settings on both pipeline

sam gateau committed 7 years ago

Commit 237fb4d1 parent 5a6f30b18 files · +284 −96Browse files

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

Unified · Split

libraries/render-utils/src/RenderViewTask.cpp+9−8
@@ -16,24 +16,25 @@ · 15 unmodified lines
1616 #include "RenderForwardTask.h"
1717
1818 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−
2119 const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask);
2220 assert(items.canCast<RenderFetchCullSortTask::Output>());
2321
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
2526 const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items);
2627
2728 if (isDeferred) {
2829 // Warning : the cull functor passed to the shadow pass should only be testing for LOD culling. If frustum culling
2930 // 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 cascadeSceneBBoxes = task.addJob<RenderShadowTask>("RenderShadowTask", ligthStageFrame, cullFunctor, tagBits, tagMask);
31+ const auto shadowTaskIn = RenderShadowTask::Input(lightingStageFramesAndZones.get<AssembleLightingStageTask::Output>().get0()[0], lightingModel).asVarying();
32+ const auto shadowTaskOut = task.addJob<RenderShadowTask>("RenderShadowTask", shadowTaskIn, cullFunctor, tagBits, tagMask);
3233
33− const auto renderInput = RenderDeferredTask::Input(items, lightingStageFramesAndZones, cascadeSceneBBoxes).asVarying();
34− task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput, true);
34+ const auto renderInput = RenderDeferredTask::Input(items, lightingModel, lightingStageFramesAndZones, shadowTaskOut).asVarying();
35+ task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput);
3536 } else {
36− const auto renderInput = RenderForwardTask::Input(items, lightingStageFramesAndZones).asVarying();
37+ const auto renderInput = RenderForwardTask::Input(items, lightingModel, lightingStageFramesAndZones).asVarying();
3738 task.addJob<RenderForwardTask>("Forward", renderInput);
3839 }
3940 }