VRAM loading question.

For questions about using Classic.

Post » Mon Aug 23, 2010 7:19 am

I'm making a scrolling game, that uses painted backgrounds. I didn't want the vram to be really high, so I tried keeping all the objects in a storage frame, then creating the objects on the frame when I need them (so the whole level doesn't have to be in the vram) then deleting them when they're out of frame.

At first, I thought I'd just have a couple of 1024x1024 BG sprites displayed at time, but when 1024x1024 textures are loaded into the frame there is a stutter/pause when it is loaded into vram. When I halved the textures to 512 x 512, I don't notice any stutter. However, I'm a bit worried that it might stutter on other computers, perhaps if I reduce the the size to 256 it might safer?

Is it best not to use this method of loading into VRAM, and just stick to the normal "load entire frame" at start up (it'll probably be around 90mb vram)? Or is it okay to do this?
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Aug 23, 2010 2:28 pm

When you create objects, the computer has to send the textures to the graphics card. That's not as quick a process as you think it might be. That pause is the amount of time it takes to get the texture to the graphics card, because the card has to wait for the texture to be able to draw the next frame.

If you split up the textures into 256x256 squares, but still load them all in the same tick, you'll probably still have the same problem because you'll still be loading as much texture information in the same tick. You might be able to get around it by distributing the loading across multiple frames by only loading one 256 square texture each tick.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Aug 23, 2010 2:59 pm

Yeah I can easily load them at separate times, that shouldn't be a problem. I guess it should be smooth loading 256x256 sprites.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests