Fixes a bug in the frame buffers (thanks to Nehon's suggestion)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9950 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
jul..om 12 years ago
parent b9274a3ed2
commit a0a67abf06
  1. 12
      engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java

@ -1436,11 +1436,13 @@ public class JoglRenderer implements Renderer {
} }
if (fb.getWidth() > maxRBSize || fb.getHeight() > maxRBSize) { if (fb.getWidth() > maxRBSize || fb.getHeight() > maxRBSize) {
throw new UnsupportedOperationException("Resolution " + fb.getWidth() + ":" throw new RendererException("Resolution " + fb.getWidth()
+ fb.getHeight() + " is not supported."); + ":" + fb.getHeight() + " is not supported.");
} }
if (fb.getSamples() > 0 && gl.isExtensionAvailable("GL_EXT_framebuffer_multisample") TextureUtil.GLImageFormat glFmt = TextureUtil.getImageFormatWithError(rb.getFormat());
if (fb.getSamples() > 1 && gl.isExtensionAvailable("GL_EXT_framebuffer_multisample")
&& gl.isFunctionAvailable("glRenderbufferStorageMultisample")) { && gl.isFunctionAvailable("glRenderbufferStorageMultisample")) {
int samples = fb.getSamples(); int samples = fb.getSamples();
if (maxFBOSamples < samples) { if (maxFBOSamples < samples) {
@ -1448,11 +1450,11 @@ public class JoglRenderer implements Renderer {
} }
gl.getGL2() gl.getGL2()
.glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples, .glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples,
TextureUtil.convertTextureFormat(rb.getFormat()), fb.getWidth(), glFmt.internalFormat, fb.getWidth(),
fb.getHeight()); fb.getHeight());
} else { } else {
gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, gl.glRenderbufferStorage(GL.GL_RENDERBUFFER,
TextureUtil.convertTextureFormat(rb.getFormat()), fb.getWidth(), fb.getHeight()); glFmt.internalFormat, fb.getWidth(), fb.getHeight());
} }
} }

Loading…
Cancel
Save