ryerrabelli / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

NonPowerOfTwo do not need to check if image's width equals to its height #410

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in LwjglGL1Renderer.java

// Check sizes if graphics card doesn't 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()) {

                    // Resize texture to Power-of-2 size
                    MipMapGenerator.resizeToPowerOf2(img);

                }
            }
        }

img.getWidth() != img.getHeight() is not needed, textures such as 64x512 could 
be loaded correctly by display cards without GL_ARB_texture_non_power_of_two.

If texture of 64x512 resized, diplay will differs from what we see in blender 
or 3dmax depends on the mipmap.

Original issue reported on code.google.com by wujiay...@msn.com on 20 Oct 2011 at 7:25

GoogleCodeExporter commented 8 years ago

Original comment by normen667 on 20 Oct 2011 at 6:56

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 21 Oct 2011 at 1:21