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 088a6e3fd..95ee90957 100644 --- a/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java +++ b/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java @@ -83,6 +83,7 @@ import java.util.logging.Logger; //import org.lwjgl.opengl.ARBHalfFloatVertex; //import org.lwjgl.opengl.ARBVertexArrayObject; //import jme3tools.converters.MipMapGenerator; +import jme3tools.converters.MipMapGenerator; import org.lwjgl.opengl.ARBDrawBuffers; //import org.lwjgl.opengl.ARBDrawInstanced; import org.lwjgl.opengl.ARBDrawInstanced; @@ -1620,16 +1621,16 @@ public class LwjglRenderer implements Renderer { } } - // Check sizes if graphics card doesn't support NPOT + // Yes, some OpenGL2 cards (GeForce 5) still dont support NPOT. if (!GLContext.getCapabilities().GL_ARB_texture_non_power_of_two){ if (img.getWidth() != 0 && img.getHeight() != 0){ if (!FastMath.isPowerOfTwo(img.getWidth()) || !FastMath.isPowerOfTwo(img.getHeight()) || img.getWidth() != img.getHeight()){ - logger.log(Level.WARNING, "Encountered NPOT texture {0}, " - + "it might not display correctly.", img); +// logger.log(Level.WARNING, "Encountered NPOT texture {0}, " +// + "it might not display correctly.", img); - //MipMapGenerator.resizeToPowerOf2(img); + MipMapGenerator.resizeToPowerOf2(img); } } } diff --git a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java index 27e6ab8bd..22906a4e5 100644 --- a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java +++ b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java @@ -224,8 +224,8 @@ public class RenderDeviceJme implements RenderDevice { niftyMat.setBoolean("UseTex", true); setColor(color); - float imageWidth = texture.getImage().getWidth(); - float imageHeight = texture.getImage().getHeight(); + float imageWidth = jmeImage.getWidth(); + float imageHeight = jmeImage.getHeight(); FloatBuffer texCoords = (FloatBuffer) quadModTC.getData(); float startX = srcX / imageWidth; diff --git a/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java b/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java index bddb17309..5a9eb47d8 100644 --- a/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java +++ b/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java @@ -74,11 +74,11 @@ public class RenderImageJme implements RenderImage { } public int getWidth() { - return image.getWidth(); + return width; } public int getHeight() { - return image.getHeight(); + return height; } public void dispose() { diff --git a/engine/src/tools/jme3tools/converters/MipMapGenerator.java b/engine/src/tools/jme3tools/converters/MipMapGenerator.java index 0271c11bc..a4541e6cc 100644 --- a/engine/src/tools/jme3tools/converters/MipMapGenerator.java +++ b/engine/src/tools/jme3tools/converters/MipMapGenerator.java @@ -52,7 +52,7 @@ public class MipMapGenerator { BufferedImage targetImage = new BufferedImage(targetWidth, targetHeight, sourceImage.getType()); Graphics2D g = targetImage.createGraphics(); - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g.drawImage(sourceImage, 0, 0, targetWidth, targetHeight, 0, 0, sourceWidth, sourceHeight, null); g.dispose();