Skip to content

Commit 8b24877

Browse files
authored
Merge pull request #1190 from asarium/fix/bloomAccumulator
Fix post processing framebuffer binding
2 parents 6efceb2 + c28bfcf commit 8b24877

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

code/graphics/opengl/gropenglpostprocessing.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ void opengl_post_pass_bloom()
103103
// we need the scissor test disabled
104104
GLboolean scissor_test = GL_state.ScissorTest(GL_FALSE);
105105

106-
GL_state.PushFramebufferState();
107-
108106
// ------ begin bright pass ------
109107
int width, height;
110108
{
@@ -379,15 +377,15 @@ void gr_opengl_post_process_end()
379377
GLboolean cull = GL_state.CullFace(GL_FALSE);
380378

381379
GL_state.Texture.SetShaderMode(GL_TRUE);
380+
381+
GL_state.PushFramebufferState();
382382

383383
// do bloom, hopefully ;)
384384
opengl_post_pass_bloom();
385385

386386
// do tone mapping
387387
opengl_post_pass_tonemap();
388388

389-
GL_state.PopFramebufferState();
390-
391389
// Do FXAA
392390
if (Cmdline_fxaa && !fxaa_unavailable && !GL_rendering_to_texture) {
393391
opengl_post_pass_fxaa();
@@ -437,7 +435,7 @@ void gr_opengl_post_process_end()
437435
}
438436

439437
// now render it to the screen ...
440-
GL_state.BindFrameBuffer(0);
438+
GL_state.PopFramebufferState();
441439
GL_state.Texture.SetActiveUnit(0);
442440
GL_state.Texture.SetTarget(GL_TEXTURE_2D);
443441
//GL_state.Texture.Enable(Scene_color_texture);

0 commit comments

Comments
 (0)