From ba8f8db23c2dce9b48ae3565fe908f2584f5f65c Mon Sep 17 00:00:00 2001 From: "iwg..om" Date: Sun, 7 Apr 2013 01:17:56 +0000 Subject: [PATCH] Android: Add support for OGLES20 extension "GL_IMG_texture_npot" in addition to the currently used extension "GL_OES_texture_npot" to detect NPOT support. Added additional Renderbufferstorage formats for RGB8 and RGBA8 image formats git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10517 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/android/com/jme3/renderer/android/TextureUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/android/com/jme3/renderer/android/TextureUtil.java b/engine/src/android/com/jme3/renderer/android/TextureUtil.java index ae569719d..92c12c84e 100644 --- a/engine/src/android/com/jme3/renderer/android/TextureUtil.java +++ b/engine/src/android/com/jme3/renderer/android/TextureUtil.java @@ -29,7 +29,7 @@ public class TextureUtil { public static void loadTextureFeatures(String extensionString) { ETC1support = extensionString.contains("GL_OES_compressed_ETC1_RGB8_texture"); DEPTH24 = extensionString.contains("GL_OES_depth24"); - NPOT = extensionString.contains("GL_OES_texture_npot") || extensionString.contains("GL_NV_texture_npot_2D_mipmap"); + NPOT = extensionString.contains("GL_IMG_texture_npot") || extensionString.contains("GL_OES_texture_npot") || extensionString.contains("GL_NV_texture_npot_2D_mipmap"); DXT1 = extensionString.contains("GL_EXT_texture_compression_dxt1"); DEPTH_TEXTURE = extensionString.contains("GL_OES_depth_texture"); logger.log(Level.FINE, "Supports ETC1? {0}", ETC1support); @@ -287,6 +287,7 @@ public class TextureUtil { case RGB8: imageFormat.format = GLES20.GL_RGB; imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE; + imageFormat.renderBufferStorageFormat = 0x8058; break; case BGR8: imageFormat.format = GLES20.GL_RGB; @@ -295,6 +296,7 @@ public class TextureUtil { case RGBA8: imageFormat.format = GLES20.GL_RGBA; imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE; + imageFormat.renderBufferStorageFormat = 0x8058; break; case Depth: case Depth16: