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

Added postprocess opaque pass

parent 083d7e86
...@@ -6,11 +6,16 @@ namespace pipeline ...@@ -6,11 +6,16 @@ namespace pipeline
{ {
enum class RenderPassType enum class RenderPassType
{ {
/// Only output depth values for zPre, normal depth test
ZPre, ZPre,
/// Output fColor, normal depth test
Opaque, Opaque,
/// Use special transparency.glsl header for weighted OIT
Transparent, Transparent,
/// TODO
Shadow, Shadow,
Postprocess /// Postprocess (no dept test, no culling) after opaque, before transparency resolve
PostprocessOpaque,
}; };
} }
} }
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
#include <glow/common/scoped_gl.hh> #include <glow/common/scoped_gl.hh>
#include <glow/objects/TextureRectangle.hh>
#include <glow/objects/Framebuffer.hh> #include <glow/objects/Framebuffer.hh>
#include <glow/objects/Program.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/FixedCamera.hh>
#include <glow-extras/camera/GenericCamera.hh>
#include <glow-extras/geometry/Quad.hh> #include <glow-extras/geometry/Quad.hh>
...@@ -79,16 +79,16 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)> ...@@ -79,16 +79,16 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)>
// TODO: inverse z-Buffer // 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_DEPTH_TEST);
GLOW_SCOPED(enable, GL_CULL_FACE); GLOW_SCOPED(enable, GL_CULL_FACE);
// GLOW_SCOPED(viewport, 0, 0, mWidth, mHeight); // - automatic // GLOW_SCOPED(viewport, 0, 0, mWidth, mHeight); // - automatic
camera::FixedCamera cam(mCamera->getPosition(), //
mCamera->getViewMatrix(), //
mCamera->getProjectionMatrix(), //
mCamera->getViewportSize());
// z-Pre // z-Pre
{ {
RenderPass rp; RenderPass rp;
...@@ -166,6 +166,18 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)> ...@@ -166,6 +166,18 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)>
{ {
// GLOW_SCOPED(viewport, 0, 0, mWidth, mHeight); // - automatic // 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 // Transparency resolve
if (mTransparentPass) 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