Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

RLE Compression for textures

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> SH3 Mods Workshop
View previous topic :: View next topic  
Author Message
Captain America



Joined: 20 Apr 2004
Posts: 144
Location: The Good Ole Red White & Blue

PostPosted: Fri Feb 17, 2006 12:24 pm    Post subject: RLE Compression for textures Reply with quote

In photoshop there is an option to save .tga files with RLE compression. RLE is a loss less compression meaning visually the image quality is the same just a smaller size.

I noticed when using this I can significantly reduce the size of many of the game images, which in theory should reduce memory usage. Take for instance the Periscope.tga file, by default it's 4mb but when saved with RLE compression its 2.64mb. Thats a significant difference. I was thinking if I changed every .tga texture in the game I should notice improved performance.

Before I go ahead with this task I was hoping someone who knows about textures and RLE compression would advise me if this is a good idea. I don't want this to make my performance worse. I was thinking...if the texture is now compressed I am saving memory but will it require more GPU/CPU power to display the image in the game because its compressed? Should RLE be used for graphic intensive games? The devs didn't use it so it makes me wonder if this is worth it.

Any info is appreciated.

-CA
Back to top
View user's profile Send private message
sergbuto



Joined: 14 Sep 2002
Posts: 2530
Location: Sweden

PostPosted: Fri Feb 17, 2006 12:53 pm    Post subject: Reply with quote

I think in case of compressed textures, the game will anyway decompress them before loading and therefore no saved operational memory but increased loading times. I tried it once before but did not notice any improvement although I will not bet on that since I did not do proper tests.
Back to top
View user's profile Send private message Send e-mail
Marhkimov



Joined: 22 May 2005
Posts: 2392
Location: Bay Area, California, USA

PostPosted: Fri Feb 17, 2006 2:10 pm    Post subject: Reply with quote

I use RLE compression all the time and it does not affect anything in-game.

It's nice because all of the images are noticeably smaller in size, as you have already noticed.
Back to top
View user's profile Send private message
JonZ



Joined: 06 Feb 2006
Posts: 702
Location: Montreal, Canada

PostPosted: Fri Feb 17, 2006 8:05 pm    Post subject: Reply with quote

I wish we could have an unified answer about this.


I've searched about RLE not long ago and most of the post said to never do RLE compression and always save in 24 bits. Most of the reasons was for performance and stability issues.

I don't know how Ubi make their standards, but they have surely have one about tga files.
Back to top
View user's profile Send private message
ref



Joined: 21 Nov 2005
Posts: 252
Location: Mar del Plata, Argentina

PostPosted: Mon Feb 20, 2006 8:10 am    Post subject: Reply with quote

JonZ wrote:
I wish we could have an unified answer about this.


I've searched about RLE not long ago and most of the post said to never do RLE compression and always save in 24 bits. Most of the reasons was for performance and stability issues.

I don't know how Ubi make their standards, but they have surely have one about tga files.


All games must decompress all textures that it loads in order to display them, all terrain files in sh3 are rle compressed, advantage small size on disk, less load time, disadvantage has to be decompressed in memory.
Back to top
View user's profile Send private message Send e-mail
JonZ



Joined: 06 Feb 2006
Posts: 702
Location: Montreal, Canada

PostPosted: Mon Feb 20, 2006 8:46 am    Post subject: Reply with quote

ref wrote:
JonZ wrote:
I wish we could have an unified answer about this.


I've searched about RLE not long ago and most of the post said to never do RLE compression and always save in 24 bits. Most of the reasons was for performance and stability issues.

I don't know how Ubi make their standards, but they have surely have one about tga files.


All games must decompress all textures that it loads in order to display them, all terrain files in sh3 are rle compressed, advantage small size on disk, less load time, disadvantage has to be decompressed in memory.


What about the TGA files with the usage of Alpha channels?

They have to be save in 32 bits, a must. But I don't know if RLE can be also checked.
Back to top
View user's profile Send private message
ref



Joined: 21 Nov 2005
Posts: 252
Location: Mar del Plata, Argentina

PostPosted: Mon Feb 20, 2006 10:25 am    Post subject: Reply with quote

I haven't tried in the game, but I use 32 bits+alpha tga rle compresed all the tima at work, I don't think it would be a problem as the rle compression is a standard tga feature.
Back to top
View user's profile Send private message Send e-mail
Captain America



Joined: 20 Apr 2004
Posts: 144
Location: The Good Ole Red White & Blue

PostPosted: Mon Feb 20, 2006 2:28 pm    Post subject: Reply with quote

Thanks for responding...

You can RLE compress 32bit .tga's. I use photoshop, I tested it and it does preserve the alpha channel.

ref wrote:

All games must decompress all textures that it loads in order to display them, all terrain files in sh3 are rle compressed, advantage small size on disk, less load time, disadvantage has to be decompressed in memory.


So I take it that it could hurt performance if I were to RLE compress every texture? Bummer. I am still doing research on this but there's not a lot of info on the web regarding the performance gains/losses with graphic intensive games.
Back to top
View user's profile Send private message
ref



Joined: 21 Nov 2005
Posts: 252
Location: Mar del Plata, Argentina

PostPosted: Mon Feb 20, 2006 3:00 pm    Post subject: Reply with quote

Captain America wrote:

So I take it that it could hurt performance if I were to RLE compress every texture? Bummer. I am still doing research on this but there's not a lot of info on the web regarding the performance gains/losses with graphic intensive games.


I don't think it would be a great performance lost, the decompression is made at the moment the texture is read from disk, then it's stored decompressed in memory, and the process is very quick, I've wrote a program to decompress the terrain, and in the process of decripting the compression scheme used in SH3 I've made tests with the files in the map directory, (the .rl ones) wich are 1200x1200 pixels, and with a not very optimized routine in delphi it only takes about 1.5 seconds to decompres when they are in memory, with an optimized routine you should se no noticeable diference in loading a compressed and a decompressed file, as I said the most time consuming part is loading them from disk, so you compensate with the compressed file being smaller.

Also there are rle decompressio routines embedded in direct x wich are writen in assembler and they are extremely fast, they are used for dib rle compressed files.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> SH3 Mods Workshop All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group