| View previous topic :: View next topic |
| Author |
Message |
gotmilk065
Joined: 28 Nov 2009 Posts: 25
|
Posted: Sat Nov 28, 2009 11:01 am Post subject: 24-bit texture swizzling? |
|
|
Is it even possible to swizzle a 24-bit image?
I think I'm misunderstanding the concept entirely.. In all the examples I see, it's only being done to paletted images.
If you can, does it yield a performance increase? |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Sun Nov 29, 2009 4:04 am Post subject: |
|
|
The psp's gpu does not support 24 bit images. You will need to upsample it to to 32bit or down sample it to 16 or palletted. And yes you can swizzle 32 and 16bit unpalletted. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
gotmilk065
Joined: 28 Nov 2009 Posts: 25
|
Posted: Sun Nov 29, 2009 3:28 pm Post subject: |
|
|
| a_noob wrote: | | The psp's gpu does not support 24 bit images. You will need to upsample it to to 32bit or down sample it to 16 or palletted. And yes you can swizzle 32 and 16bit unpalletted. |
Right, 32-bit images.
Do I use the same function I use for an 8-bit paletted image (GU_PSM_T8) for swizzling it? It doesn't work correctly.. Show's up with weird artifacts all over it, can't even be recognized as the same image. |
|
| Back to top |
|
 |
gotmilk065
Joined: 28 Nov 2009 Posts: 25
|
Posted: Tue Dec 01, 2009 12:47 pm Post subject: |
|
|
| Sorry for any bump, but I'd really like to understand why swizzling works and how to do it with a 32-bit image being rendered with GU_PSM_8888.. |
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Wed Dec 02, 2009 2:13 am Post subject: |
|
|
http://wiki.ps2dev.org/psp:ge_faq _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
gotmilk065
Joined: 28 Nov 2009 Posts: 25
|
Posted: Wed Dec 02, 2009 11:43 am Post subject: |
|
|
From what I gather, I should swizzle it with the width parameter multiplied by four, since it's a 32-bit image..?
Please correct me if I'm wrong; I'm trying to understand this to my fullest. |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Wed Dec 02, 2009 2:37 pm Post subject: |
|
|
That should do the trick, also don't forget to tell the GPU that the texture is swizzled when binding it. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Fri Dec 04, 2009 7:58 pm Post subject: |
|
|
To add up on a_noobs reply (hi there btw :):
the swizzle function doesn't know, nor care about pixelformats. It only works on raw bytes and "swizzles" them around, hence it needs a byte-width as parameter, rather than pixel-width... everything else is cared for by the GU when unswizzling for rendering. _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
gotmilk065
Joined: 28 Nov 2009 Posts: 25
|
Posted: Tue Dec 08, 2009 8:59 am Post subject: |
|
|
| Raphael wrote: | To add up on a_noobs reply (hi there btw :):
the swizzle function doesn't know, nor care about pixelformats. It only works on raw bytes and "swizzles" them around, hence it needs a byte-width as parameter, rather than pixel-width... everything else is cared for by the GU when unswizzling for rendering. |
Thanks, guys! Everything's working out, now :D |
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Thu Dec 10, 2009 1:46 am Post subject: |
|
|
Hi there,
I would like to have swizzled textures as well. How do I do this ? Is there code part of the SDK i was unable to locate or do someone have the code this thread is referring to ?
Thanks for the help.
AnMaBaGiMa |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Thu Dec 10, 2009 6:41 am Post subject: |
|
|
Basically every available graphics engine (OSL, triEngine, JGE, ...) and even a lot of graphics sample codes have a swizzling function included. Doing a search on the forum would have helped too. _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Thu Dec 10, 2009 7:13 am Post subject: |
|
|
Hi,
thanks. I've found what I need ;o) |
|
| Back to top |
|
 |
|