How to use DXT1 texture in PS2?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
jeffcai
Posts: 5
Joined: Mon Oct 23, 2006 12:56 pm

How to use DXT1 texture in PS2?

Post by jeffcai »

I am porting a game from PSP to PS2. But in the game, there are some image files whose format is DXT1.PSP supports DXT1,but PS2 can't. Now I converted DXT1 to INDEX8 with tools, however INDEX8 will spend more memory than DXT1 in PS2. Can I decompress DXT1 by PS2? And how?
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Decoding DXT is a bit too much for the GS. It can do it, but you will need to derive it yourself (it's a lot of passes since there is no hardware functionality), and in the end the cost of decoding is not worth it.

There are alternatives though:

* Use 4-bit CLUT whenever you can, then you get the cost down to half of 8-bit CLUT.

* VQ texture compression is a good alternative if you need a better ratio. It gives you 2 bits per pixel and the result can be very good, but is heavily dependant on the quality of the encoder. My recommendation is: Get a proper palette quantizer (don't use the VQ algorithm for this) and rasterize the image to 256 colors with floyd-steinberg before running the vector quantizer over the image.

Decompression is done by setting the VQ codebook as palette, and rendering the compressed image to a 4x larger buffer on the GS, which is very cheap.
GE Dominator
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Do note that because of the way the PS2 works you need to swizzle the data before compressing it (since you'll be rendering 8-bit into 32-bit but then read the resulting data as 8-bit).
GE Dominator
jeffcai
Posts: 5
Joined: Mon Oct 23, 2006 12:56 pm

Post by jeffcai »

thanks for your advice
Post Reply