16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

motion blur

This commit is contained in:
milek7
2018-07-23 01:22:36 +02:00
parent cfb066f678
commit d5ce1d57e7
32 changed files with 358 additions and 159 deletions

View File

@@ -22,6 +22,11 @@ gl::postfx::postfx(const shader &s)
}
void gl::postfx::apply(opengl_texture &src, framebuffer *dst)
{
apply({&src}, dst);
}
void gl::postfx::apply(std::vector<opengl_texture *> src, framebuffer *dst)
{
if (dst)
{
@@ -33,8 +38,12 @@ void gl::postfx::apply(opengl_texture &src, framebuffer *dst)
program.bind();
vao->bind();
src.bind(0);
size_t unit = 0;
for (opengl_texture *tex : src)
tex->bind(unit++);
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);
glDepthMask(GL_FALSE);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}