Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 18 files). Show all
Unified · Split
| @@ -112,7 +112,7 @@ void RenderDeferredTask::configure(const Config& config) { · 111 unmodified lines | |||
| 112 | upsamplePrimaryBufferConfig->setProperty("factor", 1.0f / config.resolutionScale); | 112 | upsamplePrimaryBufferConfig->setProperty("factor", 1.0f / config.resolutionScale); |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output, bool renderShadows) { | 115 | void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output) { |
| 116 | auto fadeEffect = DependencyManager::get<FadeEffect>(); | 116 | auto fadeEffect = DependencyManager::get<FadeEffect>(); |
| 117 | // Prepare the ShapePipelines | 117 | // Prepare the ShapePipelines |
| 118 | ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>(); | 118 | ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>(); |
| @@ -139,8 +139,11 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 20 unmodified lines | |||
| 139 | 139 | ||
| 140 | const auto& spatialSelection = fetchedItems.get1(); | 140 | const auto& spatialSelection = fetchedItems.get1(); |
| 141 | 141 | ||
| 142 | // Lighting model comes next, the big configuration of the view | ||
| 143 | const auto& lightingModel = inputs[1]; | ||
| 144 | |||
| 142 | // Extract the Lighting Stages Current frame ( and zones) | 145 | // Extract the Lighting Stages Current frame ( and zones) |
| 143 | const auto lightingStageInputs = inputs.get1(); | 146 | const auto& lightingStageInputs = inputs.get2(); |
| 144 | // Fetch the current frame stacks from all the stages | 147 | // Fetch the current frame stacks from all the stages |
| 145 | const auto currentStageFrames = lightingStageInputs.get0(); | 148 | const auto currentStageFrames = lightingStageInputs.get0(); |
| 146 | const auto lightFrame = currentStageFrames[0]; | 149 | const auto lightFrame = currentStageFrames[0]; |
| @@ -151,11 +154,12 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 4 unmodified lines | |||
| 151 | const auto& zones = lightingStageInputs[1]; | 154 | const auto& zones = lightingStageInputs[1]; |
| 152 | 155 | ||
| 153 | // Shadow Task Outputs | 156 | // Shadow Task Outputs |
| 154 | const auto shadowTaskOutputs = inputs.get2(); | 157 | const auto& shadowTaskOutputs = inputs.get3(); |
| 155 | 158 | ||
| 156 | // Shadow Stage Frame | 159 | // Shadow Stage Frame |
| 157 | const auto shadowFrame = shadowTaskOutputs[1]; | 160 | const auto shadowFrame = shadowTaskOutputs[1]; |
| 158 | 161 | ||
| 162 | |||
| 159 | fadeEffect->build(task, opaques); | 163 | fadeEffect->build(task, opaques); |
| 160 | 164 | ||
| 161 | const auto jitter = task.addJob<JitterSample>("JitterCam"); | 165 | const auto jitter = task.addJob<JitterSample>("JitterCam"); |
| @@ -165,7 +169,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 3 unmodified lines | |||
| 165 | 169 | ||
| 166 | // Prepare deferred, generate the shared Deferred Frame Transform. Only valid with the scaled frame buffer | 170 | // Prepare deferred, generate the shared Deferred Frame Transform. Only valid with the scaled frame buffer |
| 167 | const auto deferredFrameTransform = task.addJob<GenerateDeferredFrameTransform>("DeferredFrameTransform", jitter); | 171 | const auto deferredFrameTransform = task.addJob<GenerateDeferredFrameTransform>("DeferredFrameTransform", jitter); |
| 168 | const auto lightingModel = task.addJob<MakeLightingModel>("LightingModel"); | ||
| 169 | 172 | ||
| 170 | const auto opaqueRangeTimer = task.addJob<BeginGPURangeTimer>("BeginOpaqueRangeTimer", "DrawOpaques"); | 173 | const auto opaqueRangeTimer = task.addJob<BeginGPURangeTimer>("BeginOpaqueRangeTimer", "DrawOpaques"); |
| 171 | 174 | ||
| @@ -202,10 +205,10 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 30 unmodified lines | |||
| 202 | const auto scatteringResource = task.addJob<SubsurfaceScattering>("Scattering"); | 205 | const auto scatteringResource = task.addJob<SubsurfaceScattering>("Scattering"); |
| 203 | 206 | ||
| 204 | // AO job | 207 | // AO job |
| 205 | const auto ambientOcclusionInputs = AmbientOcclusionEffect::Inputs(deferredFrameTransform, deferredFramebuffer, linearDepthTarget).asVarying(); | 208 | const auto ambientOcclusionInputs = AmbientOcclusionEffect::Input(lightingModel, deferredFrameTransform, deferredFramebuffer, linearDepthTarget).asVarying(); |
| 206 | const auto ambientOcclusionOutputs = task.addJob<AmbientOcclusionEffect>("AmbientOcclusion", ambientOcclusionInputs); | 209 | const auto ambientOcclusionOutputs = task.addJob<AmbientOcclusionEffect>("AmbientOcclusion", ambientOcclusionInputs); |
| 207 | const auto ambientOcclusionFramebuffer = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Outputs>(0); | 210 | const auto ambientOcclusionFramebuffer = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Output>(0); |
| 208 | const auto ambientOcclusionUniforms = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Outputs>(1); | 211 | const auto ambientOcclusionUniforms = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Output>(1); |
| 209 | 212 | ||
| 210 | // Velocity | 213 | // Velocity |
| 211 | const auto velocityBufferInputs = VelocityBufferPass::Inputs(deferredFrameTransform, deferredFramebuffer).asVarying(); | 214 | const auto velocityBufferInputs = VelocityBufferPass::Inputs(deferredFrameTransform, deferredFramebuffer).asVarying(); |
| @@ -220,7 +223,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 8 unmodified lines | |||
| 220 | // DeferredBuffer is complete, now let's shade it into the LightingBuffer | 223 | // DeferredBuffer is complete, now let's shade it into the LightingBuffer |
| 221 | const auto deferredLightingInputs = RenderDeferred::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel, | 224 | const auto deferredLightingInputs = RenderDeferred::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel, |
| 222 | surfaceGeometryFramebuffer, ambientOcclusionFramebuffer, scatteringResource, lightClusters, lightFrame, shadowFrame, hazeFrame).asVarying(); | 225 | surfaceGeometryFramebuffer, ambientOcclusionFramebuffer, scatteringResource, lightClusters, lightFrame, shadowFrame, hazeFrame).asVarying(); |
| 223 | task.addJob<RenderDeferred>("RenderDeferred", deferredLightingInputs, renderShadows); | 226 | task.addJob<RenderDeferred>("RenderDeferred", deferredLightingInputs); |
| 224 | 227 | ||
| 225 | // Similar to light stage, background stage has been filled by several potential render items and resolved for the frame in this job | 228 | // Similar to light stage, background stage has been filled by several potential render items and resolved for the frame in this job |
| 226 | const auto backgroundInputs = DrawBackgroundStage::Inputs(lightingModel, backgroundFrame).asVarying(); | 229 | const auto backgroundInputs = DrawBackgroundStage::Inputs(lightingModel, backgroundFrame).asVarying(); |