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 

Blending...

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



Joined: 29 Jul 2006
Posts: 67

PostPosted: Tue Aug 15, 2006 11:21 am    Post subject: Blending... Reply with quote

So, I don't think I understood the sceGuBlendFunc function. How would I go about setting the following modes?

- (Source + Dest) / 2
- Source / 4 + Dest

Basically I want to know how to multiply one or both of the colors by some value. Currently I can only do 1A + 1B or 1A - 1B :P
_________________
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
Back to top
View user's profile Send private message
memon



Joined: 03 Oct 2005
Posts: 63

PostPosted: Wed Aug 16, 2006 8:19 am    Post subject: Reply with quote

You use alpha. In the first case you should use: GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA and source alpha value of 128. In the second case use GU_SRC_ALPHA, GU_ONE and source alpha of 64. If you are using texture as source color you may want to modulate the color coming from texture with a white color with alpha set to the value you want.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Wed Aug 16, 2006 3:51 pm    Post subject: Reply with quote

If it's a fixed value, you don't need to use alpha, you can use GU_FIX constants. Example:

Code:

// (Source+Dest)/2 or Source * 0.5 + Dest * 0.5
sceGuBlendFunc(GU_ADD,GU_FIX,GU_FIX,GU_COLOR(0.5f,0.5f,0.5f,0),GU_COLOR(0.5f,0.5f,0.5f,0));


Code:

// Source / 4 + Dest or Source * 0.25 + Dest
sceGuBlendFunc(GU_ADD,GU_FIX,GU_FIX,GU_COLOR(0.25f,0.25f,0.25f,0),GU_COLOR(1,1,1,0));

_________________
GE Dominator
Back to top
View user's profile Send private message
Tinnus



Joined: 29 Jul 2006
Posts: 67

PostPosted: Thu Aug 17, 2006 7:39 am    Post subject: Reply with quote

Ah, I knew the FIX thing was for something like that. Thanks a lot :)
_________________
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
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