Commit 09d04e59 authored by Philip Trettner's avatar Philip Trettner

Added postprocess opaque pass

parent 083d7e86
......@@ -6,11 +6,16 @@ namespace pipeline
{
enum class RenderPassType
{
/// Only output depth values for zPre, normal depth test
ZPre,
/// Output fColor, normal depth test
Opaque,
/// Use special transparency.glsl header for weighted OIT
Transparent,
/// TODO
Shadow,
Postprocess
/// Postprocess (no dept test, no culling) after opaque, before transparency resolve
PostprocessOpaque,
};
}
}
......@@ -2,12 +2,12 @@
#include <glow/common/scoped_gl.hh>
#include <glow/objects/TextureRectangle.hh>
#include <glow/objects/Framebuffer.hh>
#include <glow/objects/Program.hh>
#include <glow/objects/TextureRectangle.hh>
#include <glow-extras/camera/GenericCamera.hh>
#include <glow-extras/camera/FixedCamera.hh>
#include <glow-extras/camera/GenericCamera.hh>
#include <glow-extras/geometry/Quad.hh>
......@@ -79,16 +79,16 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)>
// TODO: inverse z-Buffer
camera::FixedCamera cam(mCamera->getPosition(), //
mCamera->getViewMatrix(), //
mCamera->getProjectionMatrix(), //
mCamera->getViewportSize());
{
GLOW_SCOPED(enable, GL_DEPTH_TEST);
GLOW_SCOPED(enable, GL_CULL_FACE);
// GLOW_SCOPED(viewport, 0, 0, mWidth, mHeight); // - automatic
camera::FixedCamera cam(mCamera->getPosition(), //
mCamera->getViewMatrix(), //
mCamera->getProjectionMatrix(), //
mCamera->getViewportSize());
// z-Pre
{
RenderPass rp;
......@@ -166,6 +166,18 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)>
{
// GLOW_SCOPED(viewport, 0, 0, mWidth, mHeight); // - automatic
// Postprocess pass after opaque
{
RenderPass rp;
rp.type = RenderPassType::PostprocessOpaque;
rp.pipeline = this;
rp.camera = &cam;
auto fbo = (toColorTmp ? mFboToColor : mFboToColorTmp)->bind();
renderFunc(rp);
}
// Transparency resolve
if (mTransparentPass)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment