42 #include <ACG/GL/acg_glew.hh> 47 PostProcessorInput::PostProcessorInput( GLuint _colTex, GLuint _depthTex,
int _width,
int _height) :
48 colorTex_(_colTex), depthTex_(_depthTex), width(_width), height(_height), sampleCount_(0), texfmt_(0)
52 depthRange_[0] = 0.0; depthRange_[1] = 1.0f;
56 void PostProcessorInput::bindColorTex(
int _texSlot )
const 58 glActiveTexture(GL_TEXTURE0 + _texSlot);
59 glBindTexture(sampleCount_ ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D, colorTex_);
62 void PostProcessorInput::bindDepthTex(
int _texSlot )
const 64 glActiveTexture(GL_TEXTURE0 + _texSlot);
65 glBindTexture(sampleCount_ ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D, depthTex_);
69 PostProcessorOutput::PostProcessorOutput( GLuint _fbo , GLuint _drawBuffer ,
int _width ,
int _height ,
const GLint* _viewport ) : fbo_(_fbo), drawBuffer_(_drawBuffer), width(_width), height(_height)
73 viewport_[0] = _viewport[0];
74 viewport_[1] = _viewport[1];
75 viewport_[2] = _viewport[2];
76 viewport_[3] = _viewport[3];
80 viewport_[0] = viewport_[1] = 0;
81 viewport_[2] = _width;
82 viewport_[3] = _height;
86 void PostProcessorOutput::bind()
const 88 glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
89 glDrawBuffer(drawBuffer_);
90 glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3]);