Does Chrome NWjs support non-power-of-two sizes?

Discussion and feedback on Construct 2

Post » Sun Jul 09, 2017 8:46 pm

referring to this blog post
https://www.scirra.com/blog/112/remembe ... ory?page=7

I realize Ashley was referring to mobile systems but does this at all apply to desktop Chrome (NWjs)?

"Many mobile systems don't support images which are not a power-of-two size (e.g. 32x32, 64x64, 128x128...). To work around this images will be placed in memory on a power-of-two size texture big enough to fit it. In this case the 1920x1080 image will be placed on a 2048x2048 sized texture in memory!"

Do I need to be cautious of power of two sizes? or rather does it waste memory having a non-power-of-two size?
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Sun Jul 09, 2017 8:53 pm

Nope.
In fact you would have to scale sprites down a pixel in order to get any benefit as exports add padding to the spritesheet.
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Sun Jul 09, 2017 9:11 pm

@newt so I would get a benefit from downscaling? I don't understand what you mean.

I was thinking for desktops C2 would NOT place images in memory on a power-of-two size texture big enough to fit it.
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Sun Jul 09, 2017 9:47 pm

If you import sprites that are power of two, they will not end up being power of two on the sprite sheet as the exporter adds a 1 pixel border to avoid tiling issues.
Im saying that type of management is arbitrary.
Pick a scale, go with it.
Power of two won't be an issue on modern machines, circa 2007 and current.
The only issue is max texture size, which is usually above 2k.
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Sun Jul 09, 2017 11:04 pm

newt wrote:The only issue is max texture size, which is usually above 2k.

okay makes sense..

so if my sprite is 65x65 and has 30 frames I'm not wasting any memory. excellent.
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Mon Jul 10, 2017 12:09 am

Well 30 frames might push things a bit.
That is to say if you have a bunch at the same time.
That's why iso rts's are so hard. 16 frames for 8 directions gets out of hand quickly.
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Mon Jul 10, 2017 12:50 am

newt wrote:Well 30 frames might push things a bit.
That is to say if you have a bunch at the same time.
That's why iso rts's are so hard. 16 frames for 8 directions gets out of hand quickly.


I'm not talking about performance, I'm just talking about wasting memory.

Although now that you mention it I do have 400 sprites currently using 30 frames of looping animation. Hoping to decrease the number of frames, but it runs okay right now in tests. A steady 60 fps. If the number goes above 800 I start to have issues, so I make sure to cap it at 400.
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715


Return to Construct 2 General

Who is online

Users browsing this forum: mihirolover and 27 guests