Page 1 of 1

Power of 2 question

PostPosted: Sat Mar 15, 2014 1:50 am
by Fwumpy
I'm trying to understand the Power of 2. If I need a sprite to be at least 150x50, should I just make it 256x85 and scale it down in C2 to 150x50? Will there be any difference in load time or file size?

Re: Power of 2 question

PostPosted: Sat Mar 15, 2014 2:02 am
by Fimbul

Re: Power of 2 question

PostPosted: Sat Mar 15, 2014 5:30 am
by Fwumpy
@Fimbul

I appreciate the link, but my question has nothing to do with event optimization. I'm more concerned with image quality and overall file size at the moment. Thanks though.

Re: Power of 2 question

PostPosted: Sat Mar 15, 2014 8:25 am
by Joannak
You don't need to *scale* the existing stuff . In fact, I'm quite sure this ain't anything you really need to spend time thinking off. There are some limitations on mobile systems, but it's nothing you'd need to worry about.

Re: Power of 2 question

PostPosted: Sat Mar 15, 2014 5:18 pm
by Fwumpy
@Joannak

Visual quality is something I care about and scaling matters on high resolution devices. I should have mentioned that I'm not working 'on scale' because my game is intended for multiple screen sizes. My goal is to balance high quality visuals with a small file download size. I'm already pushing the limitations of the devices I'm testing on and I've had to cut certain things out because they create lag. Those things matter to me.

I just need a simple answer. Basically, does an image the size of 150x50 take up the same amount of space as an image 256x256, or more to the point, does the Power of 2 still apply to current devices? Everything I've read about it is dated and technology changes. I'm just looking for a confirmation.

Re: Power of 2 question

PostPosted: Sat Mar 15, 2014 7:27 pm
by digitalsoapbox
@Fwumpy
Power of 2 is still a thing, yes. It's less to do with visual quality and more to do with efficiently using available device memory based on the way GPUs process data. Images don't have to be square, so your 150x50 example would fit into 256x128 instead of 256x256. This will get done by the GPU itself, so you don't have to manually resize the image to 256x128, just be aware that a 150x50 image will have the same memory requirements as an image that's 256x128.

Unless you're doing a hugely complex game with hundreds of unique animations, though, it's not something worth concerning yourself with. Mobile devices are pretty speedy these days.

Re: Power of 2 question

PostPosted: Sun Mar 16, 2014 4:15 am
by shaircast
Resizing action itself takes up GPU a little bit, so resizing the sprite on every tick is not that good. But in this case, it seems that doesn't matter. It doesn't have something with the power of 2.