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 | 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 | 116 | auto fadeEffect = DependencyManager::get<FadeEffect>(); |
| 117 | 117 | // Prepare the ShapePipelines |
| 118 | 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 | 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 | 145 | // Extract the Lighting Stages Current frame ( and zones) |
| 143 | − const auto lightingStageInputs = inputs.get1(); | |
| 146 | + const auto& lightingStageInputs = inputs.get2(); | |
| 144 | 147 | // Fetch the current frame stacks from all the stages |
| 145 | 148 | const auto currentStageFrames = lightingStageInputs.get0(); |
| 146 | 149 | const auto lightFrame = currentStageFrames[0]; |
| @@ -151,11 +154,12 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 4 unmodified lines | ||
| 151 | 154 | const auto& zones = lightingStageInputs[1]; |
| 152 | 155 | |
| 153 | 156 | // Shadow Task Outputs |
| 154 | − const auto shadowTaskOutputs = inputs.get2(); | |
| 157 | + const auto& shadowTaskOutputs = inputs.get3(); | |
| 155 | 158 | |
| 156 | 159 | // Shadow Stage Frame |
| 157 | 160 | const auto shadowFrame = shadowTaskOutputs[1]; |
| 158 | 161 | |
| 162 | + | |
| 159 | 163 | fadeEffect->build(task, opaques); |
| 160 | 164 | |
| 161 | 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 | 170 | // Prepare deferred, generate the shared Deferred Frame Transform. Only valid with the scaled frame buffer |
| 167 | 171 | const auto deferredFrameTransform = task.addJob<GenerateDeferredFrameTransform>("DeferredFrameTransform", jitter); |
| 168 | − const auto lightingModel = task.addJob<MakeLightingModel>("LightingModel"); | |
| 169 | 172 | |
| 170 | 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 | 205 | const auto scatteringResource = task.addJob<SubsurfaceScattering>("Scattering"); |
| 203 | 206 | |
| 204 | 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 | 209 | const auto ambientOcclusionOutputs = task.addJob<AmbientOcclusionEffect>("AmbientOcclusion", ambientOcclusionInputs); |
| 207 | − const auto ambientOcclusionFramebuffer = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Outputs>(0); | |
| 208 | − const auto ambientOcclusionUniforms = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Outputs>(1); | |
| 210 | + const auto ambientOcclusionFramebuffer = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Output>(0); | |
| 211 | + const auto ambientOcclusionUniforms = ambientOcclusionOutputs.getN<AmbientOcclusionEffect::Output>(1); | |
| 209 | 212 | |
| 210 | 213 | // Velocity |
| 211 | 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 | 223 | // DeferredBuffer is complete, now let's shade it into the LightingBuffer |
| 221 | 224 | const auto deferredLightingInputs = RenderDeferred::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel, |
| 222 | 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 | 228 | // Similar to light stage, background stage has been filled by several potential render items and resolved for the frame in this job |
| 226 | 229 | const auto backgroundInputs = DrawBackgroundStage::Inputs(lightingModel, backgroundFrame).asVarying(); |