Jump to content
  • Advertisement
Sign in to follow this  
Njguy

OpenGL Texture dimension vs file size performance

This topic is 1463 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Edited by haegarr

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!