Corrupt ETC1 textures

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?

So I have confirmed that the issue is related to texture dimensions. I resized one of the corrupted textures to 128x128 and it renders fine so it looks like a bug in the driver… Now I just need to know what dimensions cause the problem…

i’ve met the same issue,

it seems the driver only support etc image which width&height is power of 2 (16,32,64,…)

Hi,

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?

Thanks,

Tobias



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.

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?



From the OGLES 2.0 specification:


OpenGL ES 2.0 supports non-power of two 2D textures, and cubemaps, with the caveat that mipmapping
and texture wrap modes other than clamp to edge are not supported. Mip-mapping and all OpenGL
ES 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 and
MIRRORED REPEAT texture wrap modes for non-power of two 2D textures, cubemaps, and also for 3D
textures, 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.

Oh and it is happening on all of our PowerVR test devices (all SGX based, running android 2.2 - 4.0.4)

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.

Thanks,

Tobias





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.

Thanks,

Tobias


Tobias2012-07-04 12:30:29