SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 02-17-06, 12:24 PM   #1
Captain America
Planesman
 
Join Date: Apr 2004
Location: The Good Ole Red White & Blue
Posts: 193
Downloads: 167
Uploads: 0
Default RLE Compression for textures

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
Captain America is offline   Reply With Quote
Old 02-17-06, 12:53 PM   #2
sergbuto
Pacific Aces Dev Team
 
Join Date: Sep 2002
Location: Sweden
Posts: 1,331
Downloads: 15
Uploads: 0


Default

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.
__________________
Serg's SH4 and SH3 pages
sergbuto is offline   Reply With Quote
Old 02-17-06, 02:10 PM   #3
Marhkimov
Admiral
 
Join Date: May 2005
Location: Bay Area, California, USA
Posts: 2,377
Downloads: 0
Uploads: 0
Default

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.
__________________
It takes two to tango
Marhkimov is offline   Reply With Quote
Old 02-17-06, 08:05 PM   #4
JonZ
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

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.
  Reply With Quote
Old 02-20-06, 08:10 AM   #5
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by JonZ
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.
ref is offline   Reply With Quote
Old 02-20-06, 08:46 AM   #6
JonZ
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by ref
Quote:
Originally Posted by JonZ
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.
  Reply With Quote
Old 02-20-06, 10:25 AM   #7
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

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.
ref is offline   Reply With Quote
Old 02-20-06, 02:28 PM   #8
Captain America
Planesman
 
Join Date: Apr 2004
Location: The Good Ole Red White & Blue
Posts: 193
Downloads: 167
Uploads: 0
Default

Thanks for responding...

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

Quote:
Originally Posted by ref
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.
Captain America is offline   Reply With Quote
Old 02-20-06, 03:00 PM   #9
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Captain America
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.
ref is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.