Merge remote-tracking branch 'origin/master' into gi

This commit is contained in:
Wojciech Figat
2022-04-21 12:57:08 +02:00
78 changed files with 604 additions and 311 deletions

View File

@@ -448,8 +448,9 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext)
}
// Run forward pass
auto forwardPassResult = renderContext.Buffers->RT1_FloatRGB;
ForwardPass::Instance()->Render(renderContext, lightBuffer, forwardPassResult);
GPUTexture* frameBuffer = renderContext.Buffers->RT1_FloatRGB;
GPUTexture* tempBuffer = renderContext.Buffers->RT2_FloatRGB;
ForwardPass::Instance()->Render(renderContext, lightBuffer, frameBuffer);
// Cleanup
context->ResetRenderTarget();
@@ -462,16 +463,10 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext)
{
context->SetRenderTarget(task->GetOutputView());
context->SetViewportAndScissors(task->GetOutputViewport());
context->Draw(forwardPassResult);
context->Draw(frameBuffer);
return;
}
// Prepare buffers for post processing frame
GPUTexture* frameBuffer = renderContext.Buffers->RT1_FloatRGB;
GPUTexture* tempBuffer = renderContext.Buffers->RT2_FloatRGB;
if (forwardPassResult == tempBuffer)
Swap(frameBuffer, tempBuffer);
// Material and Custom PostFx
renderContext.List->RunMaterialPostFxPass(context, renderContext, MaterialPostFxLocation::BeforePostProcessingPass, frameBuffer, tempBuffer);
renderContext.List->RunCustomPostFxPass(context, renderContext, PostProcessEffectLocation::BeforePostProcessingPass, frameBuffer, tempBuffer);