From 4aa32cd016a408bba9ce84206cba7e9a61a507e2 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sat, 2 May 2015 15:53:57 -0400 Subject: [PATCH] MipMapGen: resize to nearest power of 2 in both dimensions Before it was selecting the largest dimension, but OpenGL does not have such requirement. --- jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java b/jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java index e7a33da3c..6bdfb6e65 100644 --- a/jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java +++ b/jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java @@ -100,8 +100,7 @@ public class MipMapGenerator { public static Image resizeToPowerOf2(Image original){ int potWidth = FastMath.nearestPowerOfTwo(original.getWidth()); int potHeight = FastMath.nearestPowerOfTwo(original.getHeight()); - int potSize = Math.max(potWidth, potHeight); - return scaleImage(original, potSize, potSize); + return scaleImage(original, potWidth, potHeight); } public static void generateMipMaps(Image image){