 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Tinnus
Joined: 29 Jul 2006 Posts: 67
|
Posted: Tue Aug 15, 2006 11:21 am Post subject: Blending... |
|
|
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 |
|
 |
memon
Joined: 03 Oct 2005 Posts: 63
|
Posted: Wed Aug 16, 2006 8:19 am Post subject: |
|
|
| 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 |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Wed Aug 16, 2006 3:51 pm Post subject: |
|
|
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 |
|
 |
Tinnus
Joined: 29 Jul 2006 Posts: 67
|
Posted: Thu Aug 17, 2006 7:39 am Post subject: |
|
|
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 |
|
 |
|
|
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
|