From 2440fc5a74fab4ccca3870d807ad810378810133 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 11 Sep 2016 15:01:56 -0400 Subject: [PATCH] Merge pull request #554 from TehLeo/patch-2 Fix for MTR Framebuffers --- .../com/jme3/renderer/opengl/GLRenderer.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java index 70d25ccd4..d91694248 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java @@ -1672,16 +1672,15 @@ public final class GLRenderer implements Renderer { + " by the video hardware!"); } - if (context.boundDrawBuf != MRT_OFF + fb.getNumColorBuffers()) { - intBuf16.clear(); - for (int i = 0; i < fb.getNumColorBuffers(); i++) { - intBuf16.put(GLFbo.GL_COLOR_ATTACHMENT0_EXT + i); - } - - intBuf16.flip(); - glext.glDrawBuffers(intBuf16); - context.boundDrawBuf = MRT_OFF + fb.getNumColorBuffers(); + intBuf16.clear(); + for (int i = 0; i < fb.getNumColorBuffers(); i++) { + intBuf16.put(GLFbo.GL_COLOR_ATTACHMENT0_EXT + i); } + + intBuf16.flip(); + glext.glDrawBuffers(intBuf16); + context.boundDrawBuf = MRT_OFF + fb.getNumColorBuffers(); + } else { RenderBuffer rb = fb.getColorBuffer(fb.getTargetIndex()); // select this draw buffer