forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hardware color blending.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Mon Apr 10, 2006 7:03 am    Post subject: Hardware color blending. Reply with quote

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
View user's profile Send private message
Garak



Joined: 27 Jul 2005
Posts: 46

PostPosted: Tue Apr 11, 2006 4:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Tue Apr 11, 2006 7:18 am    Post subject: Reply with quote

Can anyone confirm garak belevings please?.


HexDump.
Back to top
View user's profile Send private message
cheriff
Regular


Joined: 23 Jun 2004
Posts: 262
Location: Sydney.au

PostPosted: Tue Apr 11, 2006 7:58 am    Post subject: Reply with quote

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
View user's profile Send private message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Tue Apr 11, 2006 5:43 pm    Post subject: Reply with quote

Well, I thought I saw that in some place, perhaps I was slippy :). Thanks to both.


HexDump.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Tue Apr 11, 2006 6:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group