Which texture format uses least video memory?

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Which texture format uses least video memory?

Post by ACE247 »

Which of Irrlichts texture formats uses least video memory?

Yes that's what I want to know, since my game uses thousands of textures.
So I want as little as possible video memory, ram and disk space consumption.

I also once heard that all textures are 'uncompressed' to a kind of bitmap in video memory, thus using as much memory as a normal bitmap file.
The format should also support alpha channels, since I use those to define transparency.
I already did some experimenting and .png and .dds are smallest, however png has no alpha channel support in Photoshop and dds isnt really supported by Irrlicht.


I appreciate any help.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Which texture format uses least video memory?

Post by ent1ty »

ACE247 wrote:png has no alpha channel support in Photoshop
Wow :shock:

And they want to sell that stuff?


Get GIMP!
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Ok. So i tried gimp, cant correctly export alpha channel either.

[edit] it turns out even worse, instead of ignoring alpha, gimp mashes the alpha channel into the rgb values, and in the processes makes everything half the color value it's supposed to be.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Huh? The textures i did in gimp and saved as png, work perfectly for me in irrlicht. Are you using a good material in your game? Or maybe you have your own screwed-up shaders?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

The adobe photoshop versions I own had always alpha support in png!

Are the material settings correct? Do you use EMT_TRANSPARENT_ALPHA_CHANNEL?
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

To answer your first question:
They all take the same amount of video memory since they are uncompressed in video memory.

DDS can be stored compressed in video memory but so far there is no support for compressed dds textures in irrlicht.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

PNG can be saved with transparency in Photoshop if the image has transparent parts.

For example, a single layer wich has some parts half transparent saves correctly the transparent parts in the PNG. Photoshop "kindly" started to ignore the alpha channel for the PNG's since Photoshop 6 or 7.

On the other hand, TGA's work as always. If you need an alpha channel, use a TGA. It is much simpler to handle it in the program, It doesn't mess the image because of the transparent parts as photoshop does with the PNG, and in my opinion, they are kind of straight when it comes to memory measurements. TGA is uncompressed, so, you get no "odd" surprises. The PNG is meant for graphics interchange through a network so, the useless information of the image is to be discarded, and the full transparent parts of an image are parts wich, in theory, won't contain any relevant information. Unless the alpha channel is only for plain transparency, it is more useful a TGA.

Else, as suggested, get gimp :D

You must take into account also another facts. A 1024x1024 32bit TGA texture uses 4 megabytes in disk, but in memory it uses 5592404 bytes because also generates the mipmap levels. Keep in mind that, if you don't need extra mipmap levels, i think there is a way to generate less levels, or no levels at all, but the final image quality will resent of this, and the performance may also be hit.

Other option: i don't know if the paleted textures still work, or if they are still stored as paleted textures, but if they are stored as paletted, they may use 4x less memory, give them a shot.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

OK to explain I use the alpha channel of the texture to determine were transparency applies on a mesh and no I am not using my own "screwed up" sharers as entity kindly said. I use this approach in order to have alpha blended transparents such as dirt stained see through windows. And that indexed pallete approach is a real nice idea except the colors don't look half as good.

But sofar its now tga for me.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

1. As Sylence said above, once on the video card, all textures are uncompressed. The type of image file you load them from doesn't affect the size.

2. Both Photoshop and GIMP can handle alpha perfectly well if you export to a format with alpha.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Also is it maybe better to have large uncompressed textures? Will I 'really' save much load time not spent on uncompressing them? Things load real slowly, and I guess It wont make a big difference.But what do you think?
This is on a Q6600 CPU, 4Gb DDR2 and a GTX260, so its not the PC slowing the loading. :)
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

Uncompressing data in RAM is faster than loading it already uncompressed from harddrive; same thing with compressed executable files (UPX, PEComapct and the like).
Never take advice from someone who likes to give advice, so take my advice and don't take it.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

OK thanks guys. :D
But I guess I'm still kinda stuck on optimizing this. I load like 300mb of textures into vidmem sometimes. :lol:
Any other optimization suggestions other than dds?
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

How about not loading 1000s of textures at once? You probably don't need all of them to be loaded immediately, do you?
Never take advice from someone who likes to give advice, so take my advice and don't take it.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

a) scale down the textures to 256x256,128x128,64x64 ect. (Don't forget your textures should be POT)
b) as Bate said, only load the textures you need at the moment
Working on game: Marrbles (Currently stopped).
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Don't load thousands of textures at once.... easier said than done. :)
I need somekinda streaming system I think. I use .irr levels with huge heightmap.(2048x2048) plus 8 texture 'splatts' then there's the level geometry plus vegetation etc. All use textures. 1024x1024 for vehicles and trees/characters. Buildings mostly use higher. Obviously mip's help. But the ram is still used. Maybe I should kinda splitt my level into zones like they did in the first stalker by splitting the map into tiles and only loading high Res textures and geometry for the current tile the player is in. Also could texture Atlases maybe help?
Post Reply