How to deal with large images?

For questions about using Classic.

Post » Wed Sep 16, 2009 12:09 am

Hi all,

I would like to ask this essential (well, at least for me) question. For my project I have to use a large image of 1800x1800 pixel in size. What is the best or recommended way to integrate it?

It should be something Construct is optimized for, but what is it? Put the whole image in a sprite, or better in a canvas, or split it to as many sprites as possible, or split it to several canvases?

I've run a test with a smaller image of nearly 1000x800 pixel, loaded to a single sprite. It worked fine, smooth scrolling and such, but it took about 4 seconds to load it. I think, that's not a good sign, but on the other hand I'm no programmer.

Any hint is greatly appreciated.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Sep 16, 2009 2:09 am

It would probably be better to leave it as one big image. Splitting it up, as far as I'm aware, wouldn't speed up loading times.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Wed Sep 16, 2009 9:00 am

One big picture should be better performance wise, than many small pictures.
B
3
G
3
Posts: 33
Reputation: 941

Post » Wed Sep 16, 2009 11:35 am

1800 x 1800 is not very effiicient in terms of VRAM. You should be working with power of two sized textures - 2, 4, 8, 16, 32, 64, 128 .... 1024, 2048.

Your 1800 square image will actually use 2048x2048 pixels in VRAM, with over 200 pixels wasted in each direction. If I was you, I'd shrink it down to 1024, then stretch it up to the size you need. The texture should end up filtered and smoothed when you stretch it, and in motion you probably won't notice the reduced resolution.

Bear I mind that I often think I know what I'm talking about only to be proven wrong by more knowledgable folks, so take this with a pinch of salt.
B
2
S
2
G
3
Posts: 105
Reputation: 1,510

Post » Wed Sep 16, 2009 2:36 pm

As GMG said it will probably behind-the-scenes be put on a 2048x2048 surface, but I think most modern graphics cards support textures that size and have enough memory to fit that in. Be careful though, you should only use one image that size if you can, if your game has lots of them low-end graphics cards will quickly run out of memory.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Sep 16, 2009 3:11 pm

I think that only older cards don't support other than power of 2 but newer should be ok. But yeah rezising to 1024 is good option
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Wed Sep 16, 2009 7:21 pm

[quote="Sagal":mlu41rwx]I think that only older cards don't support other than power of 2 but newer should be ok. But yeah rezising to 1024 is good option[/quote:mlu41rwx]
That doesn't matter really, Construct puts it on a power-of-two size texture if non-power-of-two textures are not supported. I think really really old cards might have a limit of 1024x1024 textures, but then they couldn't even make a texture the size of most modern monitor resolutions.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Sep 16, 2009 11:32 pm

Thank you for your answers. They help me a lot. I will use one sprite and downsize the image to 1024 and later scale it up within Construct.

Let me say something offtopic: I am very excited about Construct. I nearly gave up hope finding a tool that not only claims to be easy enough to use for people like me, but really is ;) Currently, I am playing around with Construct to learn before the "real work" starts, and almost everything works out well. That is so motivating! Therefore I hope this project will have a long future :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Sep 17, 2009 6:42 am

@Ashley ok I didn't really mean that old cards couldn't support 1024x1024 but in general that it should be a lot more performance friendly than 1800x1000 (or whatever it was) But didn't know that Construct changes it if not supported so now i've learned something :)
B
11
S
3
G
4
Posts: 622
Reputation: 3,186


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests