A question about transparency

Get help using Construct 2

Post » Tue Sep 30, 2014 5:12 am

Transparent pixels are rendered even if nothing is there. A giant transparent sprite will eat a huge chunk of memory even though nothing is visually put on screen.

So my question is. If I have a collision sprite and set it to not visible.
Will this object be treated as if transparent and take up gpu resources. Or is it ignored altogether saving draw calls and not going to affect the gpu.
B
28
S
8
G
1
Posts: 226
Reputation: 2,865

Post » Tue Sep 30, 2014 6:35 am

I don't think it will have any considerable impact on the FPS, which is mostly an issue for mobiles I would assume. However the image is still considered an image even if invisible and will take up as many resources as if it was transparent.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Tue Sep 30, 2014 12:09 pm

There's two sides to the question:
- the source image has to be held in memory, and if it is large it will take a lot of memory, even if it is transparent
- if it is drawn, transparent pixels still use up rendering bandwidth even though no visual change occurs

If you set it invisible it is not drawn, so that is not a concern. So then if you make it a small image (e.g. 32x32) and stretch it up as big as it needs to be, it won't use much memory either.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,671

Post » Tue Sep 30, 2014 12:28 pm

Ashley wrote:So then if you make it a small image (e.g. 32x32) and stretch it up as big as it needs to be, it won't use much memory either.

Never really thought about this taking less resources, but its actually quite a lot you can reduce it if you need collision sprites that are invisible and then just stretch the hell out of them. made a sprite with 150000x150000 and it only used est. 0.3 mb original size was 128, so good to know :)
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Tue Sep 30, 2014 5:08 pm

Great to know.

Thank you all for your replies.
B
28
S
8
G
1
Posts: 226
Reputation: 2,865

Post » Tue Sep 30, 2014 5:33 pm

nimos100 wrote:
Ashley wrote:So then if you make it a small image (e.g. 32x32) and stretch it up as big as it needs to be, it won't use much memory either.

Never really thought about this taking less resources, but its actually quite a lot you can reduce it if you need collision sprites that are invisible and then just stretch the hell out of them. made a sprite with 150000x150000 and it only used est. 0.3 mb original size was 128, so good to know :)


Why the hell would you ever need a sprite 150,000 x 150,000 pixels?! God damn, people.
B
56
S
15
G
13
Posts: 826
Reputation: 17,665


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests