git-svn-id: svn://db.shs.com.ru/libs@49 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-11-27 11:35:39 +00:00
parent 59eb135a60
commit 57d7920d8a
6 changed files with 269 additions and 167 deletions

View File

@@ -195,18 +195,22 @@ void RendererDeferredShading::renderScene() {
piSwap<int>(wi, ri);
}
fbo_out.setWriteBuffer(wi);
glActiveTextureChannel(1);
glBindTexture(GL_TEXTURE_2D, fbo_g.colorTexture(4));
shader_motion_blur->bind();
shader_motion_blur->setUniformValue("qgl_ModelViewProjectionMatrix", QMatrix4x4());
shader_motion_blur->setUniformValue("dt", QVector2D(1. / fbo_out.width(), 1. / fbo_out.height()));
shader_motion_blur->setUniformValue("t0", 0);
shader_motion_blur->setUniformValue("ts", 1);
glDrawQuad(shader_motion_blur);
glActiveTextureChannel(0);
glBindTexture(GL_TEXTURE_2D, fbo_out.colorTexture(wi));
piSwap<int>(wi, ri);
if (view.isMotionBlurEnabled()) {
fbo_out.setWriteBuffer(wi);
glActiveTextureChannel(1);
glBindTexture(GL_TEXTURE_2D, fbo_g.colorTexture(4));
shader_motion_blur->bind();
shader_motion_blur->setUniformValue("qgl_ModelViewProjectionMatrix", QMatrix4x4());
shader_motion_blur->setUniformValue("dt", QVector2D(1. / fbo_out.width(), 1. / fbo_out.height()));
shader_motion_blur->setUniformValue("t0", 0);
shader_motion_blur->setUniformValue("ts", 1);
shader_motion_blur->setUniformValue("factor", GLfloat(view.motionBlurFactor()));
shader_motion_blur->setUniformValue("steps", view.motionBlurSteps());
glDrawQuad(shader_motion_blur);
glActiveTextureChannel(0);
glBindTexture(GL_TEXTURE_2D, fbo_out.colorTexture(wi));
piSwap<int>(wi, ri);
}
glReleaseShaders();
fbo_out.release();