Skip to content

Commit

Permalink
Fixed|Renderer|FX: Update GL viewports for post-processing shader
Browse files Browse the repository at this point in the history
Fixes the problem where the sidebar editor would cause the view to
appear squished.
  • Loading branch information
skyjake committed Dec 4, 2013
1 parent 1f4a458 commit dcb6687
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doomsday/client/src/render/fx/postprocessing.cpp
Expand Up @@ -70,7 +70,9 @@ DENG2_PIMPL(PostProcessing)
/**
* @todo The offscreen target should simply use the viewport area, not
* the full canvas size. This way the shader could, for instance,
* easily mirror texture coordinates.
* easily mirror texture coordinates. However, this would require
* drawing the frame without applying a further GL viewport in the game
* widgets. -jk
*/
//return self.viewRect().size();
return root().window().canvas().size();
Expand Down Expand Up @@ -158,7 +160,10 @@ DENG2_PIMPL(PostProcessing)
update();

framebuf.target().clear(GLTarget::ColorDepthStencil);
GLState::push().setTarget(framebuf.target()).apply();
GLState::push()
.setTarget(framebuf.target())
.setViewport(Rectangleui::fromSize(consoleSize()))
.apply();
}

void end()
Expand Down Expand Up @@ -187,6 +192,7 @@ DENG2_PIMPL(PostProcessing)
GLState::push()
.setBlend(false)
.setDepthTest(false)
.setViewport(Rectangleui::fromSize(root().window().canvas().size()))
.apply();

frame.draw();
Expand Down

0 comments on commit dcb6687

Please sign in to comment.