forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use DXT1 texture in PS2?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
jeffcai



Joined: 23 Oct 2006
Posts: 5

PostPosted: Thu May 24, 2007 7:58 pm    Post subject: How to use DXT1 texture in PS2? Reply with quote

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?
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Thu May 24, 2007 8:59 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Thu May 24, 2007 9:14 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
jeffcai



Joined: 23 Oct 2006
Posts: 5

PostPosted: Thu May 24, 2007 10:02 pm    Post subject: Reply with quote

thanks for your advice
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 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