Reputation: 2085
If you have two 2048px X 2048px .png textures, with one being 300kb in size and the other only 30kb (10x smaller). Does the smaller texture have better rendering performance in opengl-es? Or does it not matter because opengl reads every pixel anyway?
Upvotes: 0
Views: 154
Reputation: 54592
It shouldn't make a difference at all. You'll have to uncompress the PNG file for loading it into an OpenGL texture, so the size difference goes away as soon as you loaded and uncompressed the file, and before OpenGL ever sees the image data.
OpenGL can support compressed textures, where the exact compression formats are very version and platform specific. ES 2.0 has the mechanism for compressed textures in place, but allows implementations to support as few as 0 compressed formats.
All of the common texture compression formats use lossy compression with a fixed compression factor. So once you choose the format, the content of the image is not going to make a difference in the resulting memory use and performance. It's possible that textures with little detail (which would typically compress well with PNG) will work better with texture compression because the lossy compression will introduce less quality loss. If your OpenGL implementation gives you a choice between different compression formats, you might be able to use a format with a higher compression factor for textures with "simple" content.
Upvotes: 2