Commit 94f26b02 authored by Christopher Tenter's avatar Christopher Tenter

- update stereo rendering

- change interface for postprocessing to allow multiple inputs

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19687 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bcd97a4d
......@@ -67,7 +67,7 @@ QString PostProcessorSobelPlugin::postProcessorName() {
return QString("Sobel");
}
void PostProcessorSobelPlugin::postProcess(ACG::GLState* _glstate, const PostProcessorInput& _input, GLuint _targetFBO) {
void PostProcessorSobelPlugin::postProcess(ACG::GLState* _glstate, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output) {
// ======================================================================================================
// Load shader if needed
......@@ -79,15 +79,18 @@ void PostProcessorSobelPlugin::postProcess(ACG::GLState* _glstate, const PostPro
// Bind input texture
// ======================================================================================================
const PostProcessorInput* input = _input[0];
glActiveTexture(GL_TEXTURE0);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, _input.colorTex_);
glBindTexture(GL_TEXTURE_2D, input->colorTex_);
// ======================================================================================================
// Bind output FBO
// ======================================================================================================
glBindFramebuffer(GL_FRAMEBUFFER, _targetFBO);
glBindFramebuffer(GL_FRAMEBUFFER, _output.fbo_);
glDrawBuffer(_output.drawBuffer_);
// ======================================================================================================
// Clear rendering buffer
......@@ -111,7 +114,7 @@ void PostProcessorSobelPlugin::postProcess(ACG::GLState* _glstate, const PostPro
shader_->use();
shader_->setUniform("textureSampler", 0);
ACG::Vec2f texcoordOffset(1.0f / float(_input.width), 1.0f / float(_input.height));
ACG::Vec2f texcoordOffset(1.0f / float(input->width), 1.0f / float(input->height));
shader_->setUniform("texcoordOffset", texcoordOffset);
// ======================================================================================================
......
......@@ -73,7 +73,7 @@ class PostProcessorSobelPlugin : public QObject, BaseInterface, PostProcessorInt
private slots:
void postProcess(ACG::GLState* _glstate, const PostProcessorInput& _input, GLuint _targetFBO);
void postProcess(ACG::GLState* _glstate, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output);
QString postProcessorName();
......
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