Graphics/Camera: Add clear color per viewer

This commit is contained in:
Jérôme Leclercq
2021-11-13 20:06:34 +01:00
parent a812c69e69
commit 342c053faa
7 changed files with 22 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ namespace Nz
builder.TextureBarrier(textureTransition.srcStageMask, textureTransition.dstStageMask, textureTransition.srcAccessMask, textureTransition.dstAccessMask, textureTransition.oldLayout, textureTransition.newLayout, *texture);
}
builder.BeginRenderPass(*passData.framebuffer, *passData.renderPass, passData.renderRect);
builder.BeginRenderPass(*passData.framebuffer, *passData.renderPass, passData.renderRect, passData.outputClearValues.data(), passData.outputClearValues.size());
if (!passData.name.empty())
builder.BeginDebugRegion(passData.name, Color::Green);

View File

@@ -8,6 +8,11 @@
namespace Nz
{
const Color& Camera::GetClearColor() const
{
return m_clearColor;
}
UInt32 Camera::GetRenderMask() const
{
return m_renderMask;

View File

@@ -475,7 +475,7 @@ namespace Nz
forwardPass.SetDepthStencilInput(viewerData.depthStencilAttachment);
//forwardPass.SetDepthStencilOutput(viewerData.depthStencilAttachment);
forwardPass.SetClearColor(0, Color::Black);
forwardPass.SetClearColor(0, viewer->GetClearColor());
forwardPass.SetDepthStencilClear(1.f, 0);
forwardPass.SetExecutionCallback([&]()