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 

5551 format problems.

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



Joined: 07 Jun 2005
Posts: 70

PostPosted: Tue Aug 02, 2005 2:09 am    Post subject: 5551 format problems. Reply with quote

Hi,

I´m trying to use the 5551 format to draw sprites with alpha test. The PSPSDK doc states that n this format pixels come in a RGBA format, but I have noticed that order must be swaped in order to have correct colors, I mean ABGR, is doc wrong?.

Using this format, I achieved to have correct colors but A channels seemed not work. Any Idea?.


Thanks in advance,

HexDump.
Back to top
View user's profile Send private message
Shito



Joined: 11 May 2005
Posts: 21

PostPosted: Tue Aug 02, 2005 3:40 am    Post subject: Reply with quote

From what I've tried, yeah, 5551 RGBA is indeed 1555 ABGR, but I had no problem getting the alpha channel to work, though.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Tue Aug 02, 2005 4:59 am    Post subject: Re: 5551 format problems. Reply with quote

It all depends on how you look at it. I've used the order of bits that Sony has used in public, and I think they think of it as going from bit 0 to bit 31 in their naming.

HexDump wrote:

Using this format, I achieved to have correct colors but A channels seemed not work. Any Idea?.


Make sure you pass GU_TCC_RGBA to the 2nd parameter of sceGuTexMode(), otherwise it won't read the alpha-component.
_________________
GE Dominator
Back to top
View user's profile Send private message
Shito



Joined: 11 May 2005
Posts: 21

PostPosted: Tue Aug 02, 2005 5:43 am    Post subject: Reply with quote

Kinda makes sense, but why is it reversing again in 32 bits then ??
From what I've seen, 32 bits is 8888 ARGB.
Back to top
View user's profile Send private message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Tue Aug 02, 2005 6:11 am    Post subject: Reply with quote

Thanks for the answerings. A little more question to chp, is it really needed to put this format when no using 3D at all?, I´m only writing short ints to VRAM, it sounds odd to me having to set this flag to only do this and get the alpha chan working.

Thanks in advance,
HexDump.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Tue Aug 02, 2005 3:55 pm    Post subject: Reply with quote

Yes it's required if you want to use anything that uses the alpha-channel of the texture. Without it, texture alpha will not affect the fragment color, and you'll have a hard time using it for alpha-blending or testing.
_________________
GE Dominator
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 -> PSP 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