Rockthesmurf
Advanced Member
Hi there,
Up until now, I have been using .png graphics in my engine, either 8bit palettised ones, or full 32bit RGBA ones. On load these get unpacked to a R8G8B8A8 texture and sent off to OpenGL - there are a few exceptions, but these can be ignored for now. One of the reasons for doing this is for simplicity, but now the time has come that I am looking to squeeze out more performance, and am interested in utilizing various texture compression schemes that different hardware can support. Interestingly, I am finding there is not as much information on this subject as I hoped. I currently target Pandora, iPhone and Android, having a fixed specification for Pandora/iPhone is a nice luxury, Android on the other hand seems to support various compression schemes based on the device, doh! The formats I have seen listed so far are:
Pandora/Droid (latest Android handset, from Motorola)
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_OES_compressed_ETC1_RGB8_texture
GL_IMG_texture_compression_pvrtc
GL_IMG_texture_format_BGRA8888
GL_EXT_texture_format_BGRA8888
GL_IMG_texture_stream
IPhone - maybe more than listed here
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_IMG_texture_compression_pvrtc
GL_IMG_texture_format_BGRA8888
G1/MyHero/Touch (older, but quite common handsets)
GL_ATI_texture_compression_atitc
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_QUALCOMM_direct_texture
Android Emulator (not too important, just here as reference)
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_ARB_texture_compression
GL_ANDROID_direct_texture
In a perfect world (from my point of view), I'd be able to use a common texture format for all platforms - the two common format that appears in the above list are GL_OES_draw_texture and GL_OES_compressed_paletted_texture. The first appears to more or less copy a texture (or region of texture) from a source texture to the back buffer - it doesn't seem to cater for alpha blending/z testing, so other than my background, I don't think it is of use for my particular requirements, which is a shame, as some Android documents say this method provides the best performance for a lot of Android devices. The compressed palleted texture sounds a bit more interesting, although I am not sure if it offers improved performance. I appreciate it takes up less memory, but I have heard that it is slow as you have to do two lookups per texel read (one for the palette and one for the actual data). I am currently pixel bound on all platforms, so while saving memory is always nice, what I am really after is a way to improve performance. It seems on more modern devices, GL_IMG_texture_compression_pvrtc is a good format to go for, if you can put up with the compression artifacts (which vary from almost perfect, to pretty nasty). Although one thing I am not clear about, is the GPU technical documents (for Pandora/Droid) state the supported formats are: Compressed textures PVR-TC1, PVR-TC2, ETC1 - but as of yet the texture compression tools I have found will compress to PVRTC 2BPP or PVRTC 4BPP, but they don't specify if that is PVR-TC1 or PVR-TC2.
After a fair bit of Googling, I have not been able to come up with much information regarding the ATITC compression format, I have heard that The Compressonator (ATI/AMD tool) can compress to this format, but I'm not entirely sure what settings are required to do this, or how to read the data back on the device.
Does anyone have any information relating to the above? I know this post is a bit of a ramble, speaking of various devices/compressions and so on, but essentially I am just trying to find out if there is a good resource that explains all these various formats, and shows their relative performance/memory foot print, or if anyone has any input as to what the best format(s) would be for me to use on various devices? I just want to be able to draw as much as possible before getting pixel bound! It isn't a problem for me to have unique textures for iPhone/Pandora, but having unique textures for different Android devices is a bit much, as at that point I wouldn't be able to bundle all my assets in with the application (it would be too big), and instead I would have to have a downloader built in to the application to download the 'best' textures for your specific platform, I don't really like the idea of this as it adds a lot of complications.
Any help will be much appreciated,
Steve
Up until now, I have been using .png graphics in my engine, either 8bit palettised ones, or full 32bit RGBA ones. On load these get unpacked to a R8G8B8A8 texture and sent off to OpenGL - there are a few exceptions, but these can be ignored for now. One of the reasons for doing this is for simplicity, but now the time has come that I am looking to squeeze out more performance, and am interested in utilizing various texture compression schemes that different hardware can support. Interestingly, I am finding there is not as much information on this subject as I hoped. I currently target Pandora, iPhone and Android, having a fixed specification for Pandora/iPhone is a nice luxury, Android on the other hand seems to support various compression schemes based on the device, doh! The formats I have seen listed so far are:
Pandora/Droid (latest Android handset, from Motorola)
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_OES_compressed_ETC1_RGB8_texture
GL_IMG_texture_compression_pvrtc
GL_IMG_texture_format_BGRA8888
GL_EXT_texture_format_BGRA8888
GL_IMG_texture_stream
IPhone - maybe more than listed here
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_IMG_texture_compression_pvrtc
GL_IMG_texture_format_BGRA8888
G1/MyHero/Touch (older, but quite common handsets)
GL_ATI_texture_compression_atitc
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_QUALCOMM_direct_texture
Android Emulator (not too important, just here as reference)
GL_OES_compressed_paletted_texture
GL_OES_draw_texture
GL_ARB_texture_compression
GL_ANDROID_direct_texture
In a perfect world (from my point of view), I'd be able to use a common texture format for all platforms - the two common format that appears in the above list are GL_OES_draw_texture and GL_OES_compressed_paletted_texture. The first appears to more or less copy a texture (or region of texture) from a source texture to the back buffer - it doesn't seem to cater for alpha blending/z testing, so other than my background, I don't think it is of use for my particular requirements, which is a shame, as some Android documents say this method provides the best performance for a lot of Android devices. The compressed palleted texture sounds a bit more interesting, although I am not sure if it offers improved performance. I appreciate it takes up less memory, but I have heard that it is slow as you have to do two lookups per texel read (one for the palette and one for the actual data). I am currently pixel bound on all platforms, so while saving memory is always nice, what I am really after is a way to improve performance. It seems on more modern devices, GL_IMG_texture_compression_pvrtc is a good format to go for, if you can put up with the compression artifacts (which vary from almost perfect, to pretty nasty). Although one thing I am not clear about, is the GPU technical documents (for Pandora/Droid) state the supported formats are: Compressed textures PVR-TC1, PVR-TC2, ETC1 - but as of yet the texture compression tools I have found will compress to PVRTC 2BPP or PVRTC 4BPP, but they don't specify if that is PVR-TC1 or PVR-TC2.
After a fair bit of Googling, I have not been able to come up with much information regarding the ATITC compression format, I have heard that The Compressonator (ATI/AMD tool) can compress to this format, but I'm not entirely sure what settings are required to do this, or how to read the data back on the device.
Does anyone have any information relating to the above? I know this post is a bit of a ramble, speaking of various devices/compressions and so on, but essentially I am just trying to find out if there is a good resource that explains all these various formats, and shows their relative performance/memory foot print, or if anyone has any input as to what the best format(s) would be for me to use on various devices? I just want to be able to draw as much as possible before getting pixel bound! It isn't a problem for me to have unique textures for iPhone/Pandora, but having unique textures for different Android devices is a bit much, as at that point I wouldn't be able to bundle all my assets in with the application (it would be too big), and instead I would have to have a downloader built in to the application to download the 'best' textures for your specific platform, I don't really like the idea of this as it adds a lot of complications.
Any help will be much appreciated,
Steve