Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've read a lot about the importance of using powers of 2 png's for textures when using OpenGL ES. However, how does this relate to Google's own documentation regarding the resizing of graphics for the various screen density's. I will explain:

Let's say I have a 256 x 256 texture that I use for in the XHDPI folder for use on Extra High Density screens. Using Google's own recommended scaling factors, I would scale this by 75% to use in my HDPI folder, it would then become 185 by 185 which isn't a power of 2?

Could someone clear this up for me?

As noted, I'm asking specifically with regards to 2D sprites using quads.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Regarding scaling up or down your textures: no, absolutely not. The DPI/scaling factors are for readability of icons. It doesn't change the data inside the images. Having a very high density screen is akin to making a PC game designed to run on a monitor with a high resolution. You need to prepare for it, but not by simply scaling your texture assets.

The power of two recommendations are for graphics hardware's ability to manage ram efficiently. For instance, some graphics libraries and hardware can only handle mipmap generation if the texture has an easily divisible (or bit-shiftable) number. Modern, dedicate hardware doesn't really care, although they are probably still optimized to handle power-of-two more efficiently.

The screen density/scaling recommendations are generally ridiculous (IMO). Don't use them as your guide for graphics programming.

share|improve this answer
    
Thanks @SethBattin, normally what I've done in the past, is design my graphics for the highest density screen that I'm targeting and then I've scaled them down. Never up. Are you saying that I shouldn't scale at all? Just use one set of resources? Would that not be a bit wasteful (say if I have a 1024 x 1024 image and I'm loading it into a phone with a really low density / resolution screen?) Or are you saying to scale them but stick to powers of 2 and not so rigidly to the Google recommendation? Thanks for your help - just so I'm clear in my mind! :-) –  user22241 Apr 16 '13 at 13:53
    
> "are you saying to scale them but stick to powers of 2 and not so rigidly to the Google recommendation?" (block quotes fail me.) Yes to this one. If you intend to manage multiple screen resolutions for your game, then you may require different assets. But don't follow that silly DPI diagram to do it; do what looks good for any given resolution. –  Seth Battin Apr 16 '13 at 14:21
    
Thank you sir, that's what I thought but just wanted it confirming! –  user22241 Apr 16 '13 at 14:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.