Texture dimension vs file size performance

Started by
4 comments, last by haegarr 9 years, 6 months ago

In opengl es, if you have two textures with the same dimensions of 2048px X 2048px, but with different file sizes, one being 300kb in size and the other only 30kb in size( 10X smaller), does the smaller file size texture have any performance benefits? This is for .png files in particular but it is more of a general question. Basically does the file size not actually matter since opengl reads every pixel which is the same since they have the same dimensions, or does it have benefits?

Advertisement

The size on disc only affects loading times -- you can move 30kb into RAM faster than you can move 300kb.

If they have different sizes when in memory, then the smaller one will have better performance, yes. However, when loading PNG textures, they probably both decompress to be the same size in RAM.

For how to compress textures in memory (not on disc), check out: http://stackoverflow.com/questions/9148795/android-opengl-texture-compression

The size on disc only affects loading times -- you can move 30kb into RAM faster than you can move 300kb.

If they have different sizes when in memory, then the smaller one will have better performance, yes. However, when loading PNG textures, they probably both decompress to be the same size in RAM.

For how to compress textures in memory (not on disc), check out: http://stackoverflow.com/questions/9148795/android-opengl-texture-compression

Thanks for the reply. My problem is that nearly all my .png's have transparencies and I don't seem to have any textures compression options on opengl es 2.0 android.

Which compression options do you have? You can often split your texture into an RGB part and a monochrome alpha part and then use an atlas or separate textures/samplers to recombine then in the shader at draw time.

Sean Middleditch – Game Systems Engineer – Join my team!

What do you mean you don’t have compression options?
PVRTC and ETC2 both support alpha and there are work-arounds for ETC1.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

IIRC then ETC1 is the only format supported on all Android GLES 2.0 devices. PVRTC is supported by PowerVR GPUs only, S3TC is supported on NVidia GPUs, and ATITC is supported on Qualcomm GPUs.

So another possibility is to support the latter 3 formats (for textures with alpha) and to decide at start-up time based on the GL extension strings which files to load later on. This way makes the package bigger but has no negative consequences for the runtime.

This topic is closed to new replies.

Advertisement