- June 27, 2012 at 10:41 pm #30901
In an effort to target android markets that don’t support apk filtering based on GL extensions, specifically texture compression extensions, I have modified our engine to use ETC1 compression supported by all OGLES 2.0 devices. At first this appeared to work fine, but after closer inspection I have noticed that some small
rectangular npot textures are corrupted exclusively on PowerVR hardware (the textures in question render fine on tegra, adreno, and mali devices). You can witness the issue by downloading the current version (1.4.6) of the following game off of the google play market:
https://play.google.com/store/apps/details?id=com.hotheadgames.google.free.bigwinsoccer&feature=nav_result#?t=W251bGwsMSwyLDNd , follow the tutorial flow and once you are watching a match notice the advertising banners at the edge of the pitch are corrupted. Is this a known issue?June 29, 2012 at 12:32 am #35913
So I have confirmed that the issue is related to texture dimensions. I resized one of the corrupted textures to 128×128 and it renders fine so it looks like a bug in the driver… Now I just need to know what dimensions cause the problem…June 29, 2012 at 4:41 am #35914
i’ve met the same issue,it seems the driver only support etc image which width&height is power of 2 (16,32,64,..)June 29, 2012 at 10:02 am #35915
NPOT support is not a core part of OpenGL ES, so just to make sure, are you checking for the extension “GL_OES_texture_npot”? Without this extension, Non-power of two textures will not work properly.
Also, can I ask which devices are you seeing this issue on?
TobiasJuly 2, 2012 at 6:20 am #35916
the device: Samsung GalaxyTab PT1010 (Android2.2)
I think the worst part is:
there is no error(glGetError) after glTexImage2D/glCompressedTexImage2D,
but when use the texture,
program crashed.July 3, 2012 at 3:16 pm #35917
I believe there’s a known issue with that error check that was fixed in later drivers, I’ll double check this though. So that I can get to the answer quicker, do you know if the NPOT extension is present on that device?July 3, 2012 at 6:59 pm #35918
From the OGLES 2.0 specification:OpenGL ES 2.0 supports non-power of two 2D textures, and cubemaps, with the caveat that mipmappingand texture wrap modes other than clamp to edge are not supported. Mip-mapping and all OpenGLES 2.0 texture wrap modes are supported for power of two 2D textures, and cubemaps.The OES texture npot extension allows implementations to support mip-mapping and REPEAT andMIRRORED REPEAT texture wrap modes for non-power of two 2D textures, cubemaps, and also for 3Dtextures, if OES texture 3D extension is supported.So the only time you should have to check the npot extension is if you are planning on mipmapping or wrapping a npot, aside from that they should render fine regardless of the texture compression.July 3, 2012 at 9:42 pm #35919
Oh and it is happening on all of our PowerVR test devices (all SGX based, running android 2.2 – 4.0.4)July 4, 2012 at 10:04 am #35920
Ah you’re right, sorry! I mis-read your original post and thought you’d mentioned smaller MIP Levels rather than smaller exclusive textures. There was an issue we had previously on some really old devices with lower MIP-Maps for ETC, which is probably why I thought that. I will investigate this further and get back to you.
TobiasJuly 4, 2012 at 11:01 am #35921
Unfortunately it turns out that we don’t support NPOT ETC1 – the original spec was written with only POT textures in mind, as it was written against OpenGL ES 1.x. Subsequently our current hardware only supports POT ETC. The fact that you’re not getting any sort of error is a bug however, so I will submit a bug report to our driver team to investigate+fix this.
So I’m afraid that on our hardware you’ll have to workaround it by using POT textures exclusively for ETC. It’s not all bad news though – POT textures generally perform better on most hardware, so it’s an optimisation that should give you a performance boost across all devices. It should be noted that you shouldn’t need to use square textures, rectangular is fine as long as the individual dimensions are POT.