Skip to content
Snippets Groups Projects
Commit db76c806 authored by Jonathan Kunstwald's avatar Jonathan Kunstwald
Browse files

ViewerRenderer: Render vector overlay post-accumulation in skip output mode

parent 4c2a89b8
No related branches found
No related tags found
No related merge requests found
......@@ -337,23 +337,7 @@ void glow::viewer::ViewerRenderer::renderSubview(
+ tg::vec3::unit_y * (0.5f * (boundingInfo.aabb.max.y - boundingInfo.aabb.min.y) + scene.config.sunOffsetFactor * boundingInfo.diagonal);
// pass lambdas
auto performOutput = [&]()
{
if (bSkipOutput)
return;
// output
{
GLOW_SCOPED(debugGroup, "output");
auto shader = mShaderOutput->use();
shader["uTexOutput"] = subViewData.targetOutput;
shader["uAccumCnt"] = subViewData.accumCount;
shader["uViewportOffset"] = offset;
shader["uDebugPixels"] = scene.enableScreenshotDebug;
mMeshQuad->bind().draw();
}
// glow-extras-vector overlay
auto renderVectorOverlay = [&]()
{
RenderInfo info{cam.computeViewMatrix(),
cam.computeProjMatrix(),
......@@ -401,7 +385,26 @@ void glow::viewer::ViewerRenderer::renderSubview(
}
}
mVectorRenderer.render(mVectorImage, res.width, res.height);
};
auto performOutput = [&]()
{
if (bSkipOutput)
return;
// output
{
GLOW_SCOPED(debugGroup, "output");
auto shader = mShaderOutput->use();
shader["uTexOutput"] = subViewData.targetOutput;
shader["uAccumCnt"] = subViewData.accumCount;
shader["uViewportOffset"] = offset;
shader["uDebugPixels"] = scene.enableScreenshotDebug;
mMeshQuad->bind().draw();
}
// glow-extras-vector overlay
renderVectorOverlay();
};
// allocate pool targets
......@@ -852,5 +855,12 @@ void glow::viewer::ViewerRenderer::renderSubview(
++subViewData.accumCount;
}
if (bSkipOutput && subViewData.targetOutput2D)
{
auto fb = mFramebufferOutput->bind();
fb.attachColor("fOutput", subViewData.targetOutput2D);
renderVectorOverlay();
}
performOutput();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment