Alpha channel copy
Alpha channel copy
Hello,
I have an image (drawbuffer) that for example is filled with: 0x00000000.
I want to fill this image with for example: 0xff808080.
The alpha channel seems not to be copied to the destination, even if alpha-blending is turned off, so here I'll have 0x00808080 on the dest buffer if I draw a 0xff808080-colored poly on it or do sceGuClear.
Does anybody know how I could copy alpha channel as well as colors to the destbuffer when drawing?
Thanks in advance
I have an image (drawbuffer) that for example is filled with: 0x00000000.
I want to fill this image with for example: 0xff808080.
The alpha channel seems not to be copied to the destination, even if alpha-blending is turned off, so here I'll have 0x00808080 on the dest buffer if I draw a 0xff808080-colored poly on it or do sceGuClear.
Does anybody know how I could copy alpha channel as well as colors to the destbuffer when drawing?
Thanks in advance
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released
Yes, but it didn't changed anything. Maybe there is something else I missed?
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released
Hm I don't have my code here, sorry, but I took some GU samples for testing (spharm for example) and in all cases, alpha was not stored to the destination.
The problem is that in normal situation, alpha is never stored to the destination buffer. It's just used for blending. So in my case it seems that when blending is disabled, alpha information is just lost (unuseful).
So there might be something else to enable in the GE so that alpha is copied to the dest buffer?
Thank you in advance :)
The problem is that in normal situation, alpha is never stored to the destination buffer. It's just used for blending. So in my case it seems that when blending is disabled, alpha information is just lost (unuseful).
So there might be something else to enable in the GE so that alpha is copied to the dest buffer?
Thank you in advance :)
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released
Yes thanks, this actually works for clearing the destbuffer, but it doesn't if I want to draw images (or I didn't understand stencil doc correctly).
I found a workaround, which is to set the stencil buffer to 0, then every drawn pixel replaces stencil value with 0xff (alpha test -> only nonzero-alpha pixels are drawn). Then drawn pixels will be opaque, the rest will be transparent. But this is not a very satisfying alternative, as it's really limited :(
Is there any alternative for writing alpha to the destbuffer?
Thanks in advance
I found a workaround, which is to set the stencil buffer to 0, then every drawn pixel replaces stencil value with 0xff (alpha test -> only nonzero-alpha pixels are drawn). Then drawn pixels will be opaque, the rest will be transparent. But this is not a very satisfying alternative, as it's really limited :(
Is there any alternative for writing alpha to the destbuffer?
Thanks in advance
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released
I have the very same problem, I need to render to the alphachannel and it seems not to work, it does work for clearing, but I need it during usual rendering.
here: http://forums.ps2dev.org/viewtopic.php? ... ha+channel someone seemed to get it working.
so does anyone know the magic difference to get it work?
here: http://forums.ps2dev.org/viewtopic.php? ... ha+channel someone seemed to get it working.
so does anyone know the magic difference to get it work?
Probably that? At least I can confirm that rendering alpha to destination IS possible, though I didn't specifically test it. It was rather an (unwanted) side-effect that I noticed in my last 32bit TGA screenshot.By the way: the framebuffer's alpha DOES get filled, provided you use GU_TCC_RGBA with sceGuTexFunc.
<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
Raphael wrote:Probably that?By the way: the framebuffer's alpha DOES get filled, provided you use GU_TCC_RGBA with sceGuTexFunc.
so I guess there is something more to set to get it running. when I was running my test, the alpha did not change at all during rendering (so not even just "black" alphavalues were set).Brunni wrote:Yes, but it didn't changed anything. Maybe there is something else I missed?
would be nice if someone could post some source, this would help a lot to find that difference.At least I can confirm that rendering alpha to destination IS possible, though I didn't specifically test it. It was rather an (unwanted) side-effect that I noticed in my last 32bit TGA screenshot.
Note that the alpha byte in the framebuffer gets filled with random values since firmware 2.5, as a countermeasure against exploits that use code loaded in the framebuffer.
(Actually, it might not be random, it might just be 0 - I don't remember exactly.)
(Actually, it might not be random, it might just be 0 - I don't remember exactly.)
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
The PSP Homebrew Database needs you!
But only in VSH I suppose? Because in games etc. the framebuffer alpha is supposed to hold the stencil bits if stenciling is enabled, so it would be bad if they just wrote over those bits in any unpredictable (to the game app) way.
<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
True, I would imagine this only applies to wallpaper in VSH.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
The PSP Homebrew Database needs you!
Same as rapso: impossible to get it working (and I created this topic 1 year ago: you can imagine I've tried a LOT of things since this).Raphael wrote:Probably that? At least I can confirm that rendering alpha to destination IS possible, though I didn't specifically test it. It was rather an (unwanted) side-effect that I noticed in my last 32bit TGA screenshot.By the way: the framebuffer's alpha DOES get filled, provided you use GU_TCC_RGBA with sceGuTexFunc.
I tried GU_TCC_RGBA, but it doesn't work. I've tried a lot of things, but alpha NEVER gets filled :(
You say that you got it working, but can you please post a sample with source code? Please (I'm getting crazy)...
Sorry for my bad english
Oldschool library for PSP - PC version released
Oldschool library for PSP - PC version released