5551 format problems.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

5551 format problems.

Post by HexDump »

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.
Shito
Posts: 21
Joined: Wed May 11, 2005 1:38 am

Post by Shito »

From what I've tried, yeah, 5551 RGBA is indeed 1555 ABGR, but I had no problem getting the alpha channel to work, though.
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Re: 5551 format problems.

Post by chp »

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
Shito
Posts: 21
Joined: Wed May 11, 2005 1:38 am

Post by Shito »

Kinda makes sense, but why is it reversing again in 32 bits then ??
From what I've seen, 32 bits is 8888 ARGB.
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Post by HexDump »

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.
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

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
Post Reply