From 6c12808493c7fa87d39ce79be2ba0904ae23fae9 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sun, 17 Jul 2011 23:57:17 +0000 Subject: [PATCH] * Another ATI driver hack, now for framebuffers. Based on http://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7877 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java b/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java index 361f9f979..3bbd42251 100644 --- a/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java +++ b/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java @@ -1447,7 +1447,11 @@ public class LwjglRenderer implements Renderer { if (tex != null && tex.getMinFilter().usesMipMapLevels()) { setTexture(0, rb.getTexture()); - glGenerateMipmapEXT(convertTextureType(tex.getType(), tex.getImage().getMultiSamples())); + + int textureType = convertTextureType(tex.getType(), tex.getImage().getMultiSamples()); + glEnable(textureType); + glGenerateMipmapEXT(textureType); + glDisable(textureType); } } } @@ -1811,7 +1815,10 @@ public class LwjglRenderer implements Renderer { if (GLContext.getCapabilities().OpenGL30) { if (!img.hasMipmaps() && mips && img.getData() != null) { + // XXX: Required for ATI + glEnable(target); glGenerateMipmapEXT(target); + glDisable(target); } }