Hello

Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: CLUTs -- The Batman of the PS2\'s Bane.  (Read 744 times)

Offline IronFist
  • .....
  • Legendary Member
  • ******
  • Posts: 2595
  • Karma: +10/-0
CLUTs -- The Batman of the PS2\'s Bane.
« on: January 20, 2002, 05:29:57 AM »
I hope that title isn\'t too confusing. ;)

Anyways, for the past couple of years, developers have struggled with texturing their games on the PS2.  Up until a few months ago, every developer was using the PS2\'s texturing abilities all wrong.  Jak and Daxter and Baldur\'s Gate: Dark Alliance are the first games (that I know of) on the PS2 to actually stream in the textures instead of trying to store them on the small amount of RAM. (I think FFX might also stream some textures, but I haven\'t heard it out of their mouths so I\'m not sure.)  We saw the results of a good textured PS2 game, but in reality, even that doesn\'t compare to some of the Xbox\'s, NGC\'s, or even Dreamcast\'s texturing.  So all hope is lost, right?  That couldn\'t be farther from the truth.

There is one technique of texture compression that the PS2 is actually able to do.  It is called CLUT, or Color Look Up Table.  What this does is changes a 32 bit, or 24 bit texture into an 8 bit texuture (256 colors); which, in turn, dramatically reduces the size of the file.  It has about a 4:1 compression ratio.  Bowie from thread #2 below explains how this works pretty well:
Quote
Now let\'s look at how a 24-bit texture can be compressed to an 8-bit CLUT.  Each texel is compared with other pixels in the image to find similar copies. The object is to find 256 texels that are similar to the other pixels with minimal differences. Now that you have 256 texels, you give these texels an index value. This will be the lookup table. Each entry in the lookup table consists of 24-bit color values. Take the original image and replace each texel with an index value that matches an entry in the lookup table. So if you had a 24-bit 128x128 texture, the texture now is a 128x128 8-bit index map with a 256 entry lookup table.


So what this does is takes a 24 or 32 bit texture, reduces the size by setting aside 256 colors that are closest to the different colors on the original texture, then uses that CLUT to turn the texture into an 8 bit texture.

The ending result is a smaller file with possibly a lot less colors.  You may be wondering, "What\'s so good about that?  Won\'t the textures look dull?"  Well in reality, most textures don\'t need over 256 colors to look good.  Bricks, Stone, Grass, Metal, road, marble, wood, clothing, etc, all can be done wonderfully in with just 256 colors.  There will be an occasional texture that won\'t be able to use this technique and still look good, but for the most part, CLUTs can really help with the PS2\'s texturing problem.

Here is an example of a 24 bit texture being reduced down to an 8 bit (256 color) texture.  This shows you just how much memory can be saved, and how similar the two textures still look. (thanks to Peltopukki for giving a link that had some uncompressed textures on it so I could give this example.)

This first 24 bit grass texture has 29360 colors and is 193kb:
http://www.geocities.com/serratedangel/grassunc.html

After using Paint Shop Pro to decrease the color depth down to 8 bit color using a similar method to CLUTs, the picture got reduced to 252 colors (and 66.3kb) and looks almost the same:
http://www.geocities.com/serratedangel/grasscom.html

Also note that these pics are 256x256.  The bigger the texture you use, the uglier the compressed texture looks.  So it\'s best if the textures are kept at or under 256x256.

This next quote is from thread #1 below.  It is from MrWibble -- A PS2 developer.  It is a technique that he has thought of but hasn\'t had a chance to test out yet...
Quote
Even if you used only 25% of the GS time to decompress textures, thats 150,000,000 / 60 / 4 cycles per frame - and as it can write 8 32bit pixels per cycle (or 32 bytes) thats almost 20M of texture decompressed in under a quarter of a frame. Plus youve only had to upload one quarter of that, or 5M which is well inside the amount you can get over the bus. Given that the PS2 is rarely saturated with geometry and that people are mostly moaning about textures I think trading off that much would be fine. In fact if you massaged the numbers up to 8M upload (should be possible) then you could get 32M of texture per frame using 40% of the GS draw time. You could still churn out 20M polys with the remaining cycles which is probably more than enough for most engines.

Bear in mind also that the 32M textures there are 8bit clut based - thats enough for 512 256x256 textures!


So as you can see, this technique just might save the PS2\'s butt, but we won\'t know for sure for probably at least another year or so.  In the mean time, we get to watch the improvements that come from having the new dev kits from Sony and Vector C that should be released to the developers within the next few months. :)

Thread #1: http://www.beyond3d.com/messageview.cfm?start=1&catid=5&threadid=1703 //great read.  It starts out as a PS2 VF4 vs Arcade VF4 thread.  The technical stuff starts on page two.

Thread #2: http://www.beyond3d.com/messageview.cfm?start=1&catid=5&threadid=199   //ok read, and a little bit older than thread 1.  It is full of technical stuff and different types of texture compression, but IMO, it is also really "dry" (boring).  Maybe you will find it more interesting than I did. :)
[color=88bbbb]\"How glorious is the future... there never were men who had so great reason to rejoice as we, since the world began.\"[/color]

Offline mm
  • clyde\'s boss
  • Legendary Member
  • ******
  • Posts: 15576
  • Karma: +10/-0
    • http://
CLUTs -- The Batman of the PS2\'s Bane.
« Reply #1 on: January 20, 2002, 06:00:01 AM »
*cough*

can i get an abbreviated version?
\"Leave the gun. Take the cannoli.\" - Clemenza

Offline ooseven
  • The TRUE Scot\'
  • Legendary Member
  • ******
  • Posts: 10105
  • Karma: +10/-0
    • http://
CLUTs -- The Batman of the PS2\'s Bane.
« Reply #2 on: January 20, 2002, 06:54:42 AM »
Quote
Originally posted by mm
*cough*

can i get an abbreviated version?


Don\'t worry its about Vector C and the new devkits old bean ;)
“If you’re talking about sheep or goats, there could be some issues,” [/color]

Offline IronFist
  • .....
  • Legendary Member
  • ******
  • Posts: 2595
  • Karma: +10/-0
CLUTs -- The Batman of the PS2\'s Bane.
« Reply #3 on: January 20, 2002, 11:50:14 AM »
Quote
Don\'t worry its about Vector C and the new devkits old bean

Actually it was about CLUTs.  I only mentioned Vector C and the new PS2 dev kits at the very end because those will also improve the graphics.

MM, here\'s your abbreviated version:  CLUTs is a texture compression method that works on the PS2 that has 4:1 compression.  The only downfall is that the textures can only be up to 256 colors each.  But most textures don\'t need more than that to look good, so it doesn\'t matter.

I think it\'s also worth pointing out that the Xbox can also do CLUTs (it is a very old technique).  But since the Xbox has such good texturing abilities already, there will never be a need to use CLUTs.  Using CLUTs is kind of a last resort to texture compression, and I think the PS2 is at that "last resort" point. ;)
[color=88bbbb]\"How glorious is the future... there never were men who had so great reason to rejoice as we, since the world began.\"[/color]

Offline Knotter8
  • vaporware
  • Legendary Member
  • ******
  • Posts: 2938
  • Karma: +10/-0
    • http://www.artolive.com/artist.php?artist_id=1341
CLUTs -- The Batman of the PS2\'s Bane.
« Reply #4 on: January 20, 2002, 12:16:37 PM »
Rogue Leader on NGC is imo a school example on how it
should be ! Great textures, bump mapping (?) etc. Ppl tend
to stress that alot when comparing PS2 to the other
consoles. But they never question the PS2\'s geometry
performance ; well in some cases they should imo.
Look at the new pics from the new Starfighter game due
on PS2. It\'s a tweaked engine of the 1st Starfighter game.
But I think it sucks. The models still look blocky and choppy
to me whereas Rogue Leader looks like 30 mpps !
What I\'m trying to say is that some devs should work on
the PS2 games\' poly count some more before they worry
about textures.
Knotter8:evil:
\"Enemy show me what you wanna be, I can handle anything even if I can\'t handle you !\"

 

SMF spam blocked by CleanTalk