Power of 2 best practice questions

Discussion and feedback on Construct 2

Post » Sat Mar 26, 2016 11:26 pm

I recall reading somewhere a long time ago regarding a 1px transparent pixel border that construct adds for images, but I don't seem to be able to find it anymore.

The reason I am asking was because I forgot the implications... for example should I be importing bitmaps at 512x512, or 510x510?

Or maybe did it have something to do with resized images or seamless tiling or 9patch? I can't remember!

I know I was having some issues with 9patch using exact pixels with solid colors and not leaving space around the edges, or similar when I make a solid color sprite square and down size it in the image editor, the edges pixels get changed to semi transparent. Are these related?
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Sat Mar 26, 2016 11:53 pm

It really won't matter much, unless its tiled background, then the texture should be power of 2.
Most modern gpu's can handle odd sizes well enough.
Then the only other time it matters is when you are doing tiled games, and it's just to make things easier.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Sun Mar 27, 2016 12:42 am

OK sound good. I was worried if I had images for example at 1024 and they all got bumped up to 2048 in memory, it would be a pretty significant waste of resources.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Sun Mar 27, 2016 1:19 am

Don't forget that it does matter for sprite sheets.
Like anything that doesn't tile over 1024 gets its own sheet.
But that's a size on disk issue, optimising for that is only an issue if you have hundreds or thousands of images.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Sun Mar 27, 2016 2:03 am

Single/static images: use power-of-two size. Unless you change the setting "downscaling quality" to "high" which forces all exported images to be padded to a power-of-two size.
Sprites with 2 or more frames: any size. Because they'll get turned into a power of 2 sheet.
Tiled backgrounds: power-of-two size.

Unfortunately we have to wait until WebGL 2.0 comes out before this silly power of 2 limitation is removed, however that may happen sometime this year.

Source: webgl-2-amp-c2-c3_p1007958?#p1007958
B
151
S
75
G
20
Posts: 1,793
Reputation: 22,749


Return to Construct 2 General

Who is online

Users browsing this forum: Psynaptik and 7 guests