X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpipeline.cpp;h=63bdc4e84bbf82f10b883ade20f7d89c6216bc12;hb=9addd3d476245415244e59333a36a8fc0eae42bf;hp=95f96536f81c1f6891c5be726c2517ca95a08e2a;hpb=cd446554e998204eaba22504b7b28227feb8edbb;p=libs%2Fgl.git diff --git a/source/pipeline.cpp b/source/pipeline.cpp index 95f96536..63bdc4e8 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -116,15 +116,18 @@ void Pipeline::add_postprocessor(PostProcessor &pp) if(!fbo) { fbo = new Framebuffer; + color_buf = new Texture2D; color_buf->set_min_filter(NEAREST); color_buf->set_mag_filter(NEAREST); color_buf->storage((hdr ? RGB16F : RGB), width, height); - color_buf->image(0, RGB, UNSIGNED_BYTE, 0); fbo->attach(COLOR_ATTACHMENT0, *color_buf, 0); - depth_buf = new Renderbuffer; + + depth_buf = new Texture2D; + depth_buf->set_min_filter(NEAREST); + depth_buf->set_mag_filter(NEAREST); depth_buf->storage(DEPTH_COMPONENT, width, height); - fbo->attach(DEPTH_ATTACHMENT, *depth_buf); + fbo->attach(DEPTH_ATTACHMENT, *depth_buf, 0); } } @@ -172,7 +175,7 @@ void Pipeline::render_all() const // XXX Need two color buffer textures to handle multiple post-processors correctly for(vector::const_iterator i=postproc.begin(); i!=postproc.end(); ++i) - (*i)->render(*color_buf); + (*i)->render(*color_buf, *depth_buf); }