| View previous topic :: View next topic |
| Author |
Message |
HexDump
Joined: 07 Jun 2005 Posts: 70
|
Posted: Mon Apr 10, 2006 7:03 am Post subject: Hardware color blending. |
|
|
Hi,
First of all, I have been looking through the forums about hardware color blending (in pspsdk samples too, with no luck).
What I want to do is simple, I have a texture , and I want to render it with color blending onto the back buffer.
I use sceCopyImage to transfer the image to the backbuffer, but I allways get the final image without blend, I mean, the image that is supposed to be blended with the background overlaps the background. I use this code to set up the blending:
1)Context initialization
3)Image copy to back buffer
2)Blending function setup and enable blending state
sceGuBlendFunc(GU_ADD,GU_SRC_COLOR,ONE_MINUS_DST_COLOR,0,0)
sceGuEnable(GU_BLEND);
3) call to sceGuCopyImage() -> to copy texture over the BG Image with colorblend.
4) Disable blending
sceGuEnable(GU_BLEND);
I´m using 5650 color space.
Thanks in advance,
HexDump. |
|
| Back to top |
|
 |
Garak
Joined: 27 Jul 2005 Posts: 46
|
Posted: Tue Apr 11, 2006 4:08 am Post subject: |
|
|
Hello,
I believe sceGuCopyImage() can only be used to copy the RGB data of an image to VRAM. It will not allow you to use any type of alpha blending or transperancy features.
Garak |
|
| Back to top |
|
 |
HexDump
Joined: 07 Jun 2005 Posts: 70
|
Posted: Tue Apr 11, 2006 7:18 am Post subject: |
|
|
Can anyone confirm garak belevings please?.
HexDump. |
|
| Back to top |
|
 |
cheriff Regular
Joined: 23 Jun 2004 Posts: 262 Location: Sydney.au
|
Posted: Tue Apr 11, 2006 7:58 am Post subject: |
|
|
Whilst I can't say for sure, but it sounds like he is correct (and this is indeed how it works on ps2)..
I would imagine a function sceGuCopyImage() would only copy an image.. ie blit it straight into vram. If you choose to copy it into a screen buffer then it's not suprising that there's no blending - it is a straight 'copy' operation and would bypass the actual pipeline that does blending and other effects.
I guess what you want it to sceGuCopyImage() it somwhere offscreen, then use a sprite (or some other primitive) to actually render it onto the display. That way you can get blending and things like that. _________________ Damn, I need a decent signature! |
|
| Back to top |
|
 |
HexDump
Joined: 07 Jun 2005 Posts: 70
|
Posted: Tue Apr 11, 2006 5:43 pm Post subject: |
|
|
Well, I thought I saw that in some place, perhaps I was slippy :). Thanks to both.
HexDump. |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Tue Apr 11, 2006 6:27 pm Post subject: |
|
|
Indeed, sceGuCopyImage() is a simple bitblock-transfer, use the normal rendering pipeline if you want to do anything else than a blit. _________________ GE Dominator |
|
| Back to top |
|
 |
|