Failed to create RenderTexture with RGBA16 UNorm (24) format

RGBA16 UNorm rendertexture format runs without error on our android test devices but after release we’re seeing errors logged by gameanalytics from various other android devices, in fact in almost 30% of devices:

Affected devices include SM-A125U (Galaxy A12), Nexus 5X, Pixel 2 XL and many others but we don’t own any of these devices so we can’t check which texture formats are supported with the System.SupportedRenderTextures(xxx) as this would have to run on the target device.

It’s hard to find people with those specific devices that could reproduce the error and try which other texture formats are compatible. And it’s not clear from Unity docs such as RenderTextureFormat description. Nor is it clear from the error message itself what texture format should be used instead because the proposed format is the same as the ‘not supported’ (“use RGBA16 UNorm (24) format instead” but that’s the one it complains about in the first place).

How do we find the rendertexture formats supported by these specific android devices without owning the devices?

The unorm 16 formats require the GL extension GL_EXT_texture_norm16. You can check http://gpuinfo.org.
Alternative formats with more than 8bit per channel:
R10G10B10A2 should be supported by any ES3.0 GPU.
RGBA fp16 is widely supported but only mandatory since ES3.2. Before it requires GL_EXT_color_buffer_float or GL_EXT_color_buffer_half_float. Should work on any of the devices you listed.

1 Like

Thank you for the info.Is RGBA fp16 the same as “R16G16B16A16_SFLOAT” ?
What’s the recommended way to go with render textures at the moment if you want to make sure that all android devices are going to support it? As I understand R10G10B10A2 is >=ES3.0 so about a third of the devices listed on gpuinfo.org will not support it. RGBA fp16 is >=ES3.2 so most devices on that list don’t support it.

Is there any way to support all devices? Maybe we should do …

if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
{
    // use rendertexture with R16G16B16A16_SFLOAT format
}
else if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGB2101010))
{
   // use rendertexture with A2R10G10B10_UNORM_PACK32 format (haven't found any other matching formats in dropdown list)
   // or how do you enable GL_EXT_color_buffer_float or GL_EXT_color_buffer_half_float ?
} 
else
{
   /// not sure
}

yes

R8G8B8A8_UNorm works on any Android.
If you need higher precision then R10G10B10A2 or R16G16B16A16_SFLOAT.

If you really need ES2.0 support then I would suggest to try to stick to R8G8B8A8 on those devices.

The number of devices on gpuinfo.org don‘t really represent market share today.

1 Like

We’ve tried with R8G8B8A8_UNorm and it looks just the same so we’re going to go with that!
Finding the texture format that works on all android devices has always been confusing for me and too tedious to test it out, thanks for clearing that up!