24-bit texture swizzling?
-
- Posts: 21
- Joined: Sat Nov 28, 2009 10:56 am
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?
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?
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: Select all
.øOº'ºOø.
'ºOo.oOº'
-
- Posts: 21
- Joined: Sat Nov 28, 2009 10:56 am
Right, 32-bit images.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.
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.
-
- Posts: 21
- Joined: Sat Nov 28, 2009 10:56 am
Code: Select all
int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
}
-
- Posts: 21
- Joined: Sat Nov 28, 2009 10:56 am
That should do the trick, also don't forget to tell the GPU that the texture is swizzled when binding it.
Code: Select all
.øOº'ºOø.
'ºOo.oOº'
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.
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
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
-
- Posts: 21
- Joined: Sat Nov 28, 2009 10:56 am
Thanks, guys! Everything's working out, now :DRaphael 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.
-
- Posts: 87
- Joined: Thu Oct 01, 2009 8:43 pm
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
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl