//import org.lwjgl.opengl.ARBHalfFloatVertex;\r
//import org.lwjgl.opengl.ARBVertexArrayObject;\r
//import jme3tools.converters.MipMapGenerator;\r
+import jme3tools.converters.MipMapGenerator;\r
import org.lwjgl.opengl.ARBDrawBuffers;\r
//import org.lwjgl.opengl.ARBDrawInstanced;\r
import org.lwjgl.opengl.ARBDrawInstanced;\r
}\r
}\r
\r
- // Check sizes if graphics card doesn't support NPOT\r
+ // Yes, some OpenGL2 cards (GeForce 5) still dont support NPOT.\r
if (!GLContext.getCapabilities().GL_ARB_texture_non_power_of_two){\r
if (img.getWidth() != 0 && img.getHeight() != 0){\r
if (!FastMath.isPowerOfTwo(img.getWidth())\r
|| !FastMath.isPowerOfTwo(img.getHeight())\r
|| img.getWidth() != img.getHeight()){\r
- logger.log(Level.WARNING, "Encountered NPOT texture {0}, "\r
- + "it might not display correctly.", img);\r
+// logger.log(Level.WARNING, "Encountered NPOT texture {0}, "\r
+// + "it might not display correctly.", img);\r
\r
- //MipMapGenerator.resizeToPowerOf2(img);\r
+ MipMapGenerator.resizeToPowerOf2(img);\r
}\r
}\r
}\r
niftyMat.setBoolean("UseTex", true);\r
setColor(color);\r
\r
- float imageWidth = texture.getImage().getWidth();\r
- float imageHeight = texture.getImage().getHeight();\r
+ float imageWidth = jmeImage.getWidth();\r
+ float imageHeight = jmeImage.getHeight();\r
FloatBuffer texCoords = (FloatBuffer) quadModTC.getData();\r
\r
float startX = srcX / imageWidth;\r
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();