VRAM & Pow 2 Textures

For questions about using Classic.

Post » Wed Oct 20, 2010 6:34 pm

So I've been reading that instead of importing giant images for a level, you should cut them into small pow 2 size pieces and put them together - to save VRAM.

Well I used Construct's "Import Tiles" to cut up a giant image into small 256x256 frames, then copy/pasted it and used the "Start Frame" feature to select which pieces to use.

I thought this would save me a ton of VRAM, but it's exactly the same as importing the whole image as one piece.

Have I misinterpreted this technique?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Wed Oct 20, 2010 6:50 pm

Yeah thats more if you you have a texture size that's like 32x64. Some graphics cards will pad the texture to make it 64x64. Using two 32x32 textures would save VRAM.
B
77
S
49
G
25
Posts: 346
Reputation: 17,409

Post » Wed Oct 20, 2010 6:58 pm

Ah so it's only to prevent padding..Well damn, I guess I'll have to stick to ROJOhound's VRAM memory management technique. I fear my finished map will easily be over 100mb :(
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Wed Oct 20, 2010 9:39 pm

If you have a huge graphic, for instance for a background, cutting it up into smaller pieces and piecing it together again in Construct won't save you VRam, because you're basically using the same large image, albeit in smaller pieces.

The idea is to look at your large image, and work out if you can make it up out of smaller, repetitive graphics.

For instance, you could use a tiled background to give yourself your base colour, and then place several smaller graphics over that to make up the image that you want.

Could you post a picture of the large graphic that you want to display?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Wed Oct 20, 2010 9:45 pm

I'm having the same problem with my game, I'm using blocks of 800x800 px to load my levels (I thought that would save vram too... :/ also it's easier to paint). There is something else I can do to increase the game's performance? Maybe there is some way to only load the images that are close to the camera...
B
2
S
1
G
2
Posts: 32
Reputation: 864

Post » Wed Oct 20, 2010 10:31 pm

It's more useful to chop a big image into smaller chunks when there are big spaces with nothing relevant, for example cloud-less sky between tall towers/mountains, following this example you chop the towers and put them back together on the editor, and the sky color is made by setting it on the scene parameters, or adding a gradient object.
B
2
G
2
Posts: 32
Reputation: 714

Post » Thu Oct 21, 2010 12:10 am

There's more than saving vram. Graphic cards support textures only up to a specific size. Modern cards may support 8192x8192, older may only support 512x512 or even only 256x256.

So, when you have a huge image, let's say 8192x4096, you should cut it into smaller pieces, if you want to support players with older gfx cards.

Also, when using pixel shaders in your game, you could get in trouble, too. Only ps3 (and up) is guaranteed to work on 4k textures. (This could be misleading, let me say it this way: If a card supports ps3, it also has to support 4k textures)

But you could also still save some vram. Let's take the example 800x800. It's just a matter of how you split the image. See the graphic below:
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Oct 21, 2010 7:45 am

Just a small question. Does enlarging an image in Construct increase VRAM usage? Or does it use the same VRAM as it uses when it is in its normal size?
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Thu Oct 21, 2010 9:33 am

I'd like to STRESS that 2D games in general are NOT made out of a single huge picture, as 3D games are not a single hulking 3D model.

Please. Research.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Oct 21, 2010 10:47 am

[quote:22f5mwcb]Just a small question. Does enlarging an image in Construct increase VRAM usage? Or does it use the same VRAM as it uses when it is in its normal size?[/quote:22f5mwcb]
VRAM usage will be the same.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests