51 #include <ACG/GL/acg_glew.hh> 56 PostProcessorInput::PostProcessorInput( GLuint _colTex, GLuint _depthTex,
int _width,
int _height) :
57 colorTex_(_colTex), depthTex_(_depthTex), width(_width), height(_height), sampleCount_(0), texfmt_(0)
61 depthRange_[0] = 0.0; depthRange_[1] = 1.0f;
65 void PostProcessorInput::bindColorTex(
int _texSlot )
const 67 glActiveTexture(GL_TEXTURE0 + _texSlot);
68 glBindTexture(sampleCount_ ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D, colorTex_);
71 void PostProcessorInput::bindDepthTex(
int _texSlot )
const 73 glActiveTexture(GL_TEXTURE0 + _texSlot);
74 glBindTexture(sampleCount_ ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D, depthTex_);
78 PostProcessorOutput::PostProcessorOutput( GLuint _fbo , GLuint _drawBuffer ,
int _width ,
int _height ,
const GLint* _viewport ) : fbo_(_fbo), drawBuffer_(_drawBuffer), width(_width), height(_height)
82 viewport_[0] = _viewport[0];
83 viewport_[1] = _viewport[1];
84 viewport_[2] = _viewport[2];
85 viewport_[3] = _viewport[3];
89 viewport_[0] = viewport_[1] = 0;
90 viewport_[2] = _width;
91 viewport_[3] = _height;
95 void PostProcessorOutput::bind()
const 97 glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
98 glDrawBuffer(drawBuffer_);
99 glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3]);