Page 1 of 1

Texture to hardware limits

Posted: Sat Apr 01, 2006 8:59 am
by green.t
Hello! Simple question :

I understand that I can load a texture from jpeg or bmp format. However, when this graphic is loaded what sort of video memory is this taking up - Is it using the natural file size or is it converted to another format before placed within video ram? Just need to know so I know what sort of limitations I'm up for when creating large worlds, maps, etc.

If my concept of how texturing works is completely wrong, please set me in the right direction. :)

Thank you in advance!

Posted: Sat Apr 01, 2006 11:14 am
by Amt0571
I think that it's not compressed in the memory, so it takes up more memory than if the jpg could be stored right away.

Posted: Sat Apr 01, 2006 2:34 pm
by hybrid
Sure, most images are converted to bitmaps, i.e. 2 or 4 byte per pixel. There's a patch available for compressed textures, which could help in these cases.

Posted: Mon May 05, 2008 12:35 pm
by matgaw
Another question regarding this: are all textures stored in graphics card video RAM, or in computer's main RAM, or in both? It seems that loading textures uses a computer's RAM, but I don't know about video RAM...

For example, if I have about 300 MB of bitmap textures to load, then do I have to have a 512 MB graphic card, or just 512 MB of system RAM is sufficient?

Posted: Mon May 05, 2008 12:45 pm
by hybrid
No, you need that amount of gfx memory (and a lot more due to mipmapping). So with 300MB of textures you might need some texture compression or dynamic memory management.

Posted: Mon May 05, 2008 1:44 pm
by twilight17
Or just disable mipmaps. Also save some memory by NOT using bmp's, they are a really bad format and shouldn't be used at all when making a game.

Posted: Mon May 05, 2008 2:28 pm
by rogerborg
twilight17 wrote:Also save some memory by NOT using bmp's, they are a really bad format and shouldn't be used at all when making a game.
:roll: Did you spot the part about textures being uncompressed when they're loaded to RAM / VRAM? A bmp, jpg, or png of the same dimensions will all take up exactly the same size once they're loaded.

However, the file format isn't completely irrelevant. BMP source images will take up more room on disk, but they'll be loaded faster than compressed images. So on a typical modern system with big hard drives and impatient users, they're actually a good choice.

Posted: Mon May 05, 2008 10:10 pm
by Kriolyth
(<name> has joined #directx)
+1 to rogerborg and long live RAID0 :D

Another choice could be DDS textures with DXTn compression (note hybrid saying about patch). These both take less space on disk and in VRAM/RAM, have little impact on performance, but may produce some compression artifacts similar to JPEG and have problems with transparency.

Textures may take up both RAM and VRAM, depending on texture management. However, VRAM is also used for vertex buffers, index buffers, render targets and depth/stencil - and they all take up a bit more than you'd expect them to do. They all may take up RAM as well, but VRAM is more preciousssss these days.

Leaving out VRAM fragmentation nightmares =)
(<name> has left #directx)