Too many textures in GPU RAM?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
D. Novak
Posts: 14
Joined: Fri Dec 12, 2008 2:26 pm

Too many textures in GPU RAM?

Post by D. Novak »

I have a dataset which consists of a 3D Model with an aerial photograph attached to it. The texture is made of around 1000 256x256 texture tiles. On my laptop with 512 MiB GPU RAM it runs fine (~500'000 triangles with ~45 FPS). On my working computer (256 MiB GPU RAM) it slows down to 1 FPS.

With Rivatuner I've checked the GPU memory usage on my laptop and noticed that it grows to 246 MiB.
Can it be that once the GPU RAM is filled Irrlicht is not able to put out more than 1-2 FPS?

An additional question that arose is, why the textures take up so much space on the GPU RAM. When I calculate the total size on my harddisk it's 40.6 MB - so it's basically increasing it's size by a factor 5.
Sadly I cannot measure the GPU RAM utilization on my working computer because it runs Fedora 7 with an ATi FireGL v7200 and I haven't found a program to read the GPU RAM utilization.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Well if you fill up the GPU ram and still need more textures then textures will have to be switched in and out as necessary which is a costly procedure, so that will kill your performance.

Textures are stored in memory uncompressed. So you may have some lovely super compressed JPGs which are tiny on disc but when loaded into your app they're gonna be equivalent to 24/32bit BMPs pretty much. (this isn't Irrlicht's fault though!)
Image Image Image
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

1. yes, swapping will hit ur performance very hard
2. yeah, that factor of 5 is incorrect.... texture is stored uncompressed in mem
D. Novak
Posts: 14
Joined: Fri Dec 12, 2008 2:26 pm

Post by D. Novak »

JP wrote:Well if you fill up the GPU ram and still need more textures then textures will have to be switched in and out as necessary which is a costly procedure, so that will kill your performance.

Textures are stored in memory uncompressed. So you may have some lovely super compressed JPGs which are tiny on disc but when loaded into your app they're gonna be equivalent to 24/32bit BMPs pretty much. (this isn't Irrlicht's fault though!)
I just did a quick calculation and you're right. When I save them as 24bit bmp's I get around 190 MiB of texture data. I guess a little bit more if I include the alpha channel.
So in other words: It's no use to compress textures at all?

Although one thing that strikes me odd: I've seen a similar behaviour on a different machine. When the model was in sight the frames dropped to 1 FPS - when I didn't see it it went back to 300+ FPS.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

The use of compressing the textures is that if you want to distribute your application then it's a much smaller package to distribute if you compress your textures! I don't know if loading times are particularly affected by the compression or not...

Maybe when your model is in view it's having to do the texture switching, if not then the textures aren't needed to be switched (as the model isn't being rendered) so it gets a decent framerate.
Image Image Image
D. Novak
Posts: 14
Joined: Fri Dec 12, 2008 2:26 pm

Post by D. Novak »

I suppose the only solution would be to use some form of texture compression like DXT1 or similar to save memory space - just open source (FXT?).
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

This is as I'd expect. I use .bmp textures unless I need an alpha channel, since they're faster to load, and compress down just fine if you zip up a distribution. They're only larger on disk, but disk space is cheap.

Also, remember that the texture memory required will be 1/3 larger than the largest (power of 2) resolution, unless you disable mipmapping.

So while a 190 x 490 24 bit RGB source .bmp would be ~273KB, a texture based on it will (due to rounding up, alpha channel and mipmapping) require:

256 * 512 * 4 * 1.3333 = 683KB
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
D. Novak
Posts: 14
Joined: Fri Dec 12, 2008 2:26 pm

Post by D. Novak »

I was expecting the 1/3 bigger size because of the mip maps - what I didn't know was that the texture is basically 'uncompressed' again, taking the same amount of space like a bitmap. That's why I was surprised by the size.

I have another question, that goes roughly into the same direction:

When I force my graphics card driver to force AA & AF to be 'off' I get worse FPS than when I set it to 'application controlled'.
The same model has ~26 FPS when I enforce AA & AF to be 'off' - with application controlled it goes up to 45 FPS. This is both happening under Linux and Windows. Any ideas what that is all about?
Post Reply