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 

Help with srcfix and dstfix parameters in Blending function.

 
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: Sat Apr 15, 2006 9:08 am    Post subject: Help with srcfix and dstfix parameters in Blending function. Reply with quote

Hi,

I just figure out how to do color blending (well, someone point me out that sceCopyImage was only a blit and bypasses the 3D pipeline :) ).

The problem now is that I haven´t found a "MODULATE" blending mode for the color blend function, so I used "ADDITIVE". But this, shows things too much bright. Now I´m using ADD but fixing values with the 2 parameters that the blend function has, but I run into another problem, when I put things this way, colors seems to be not the same that the original image, I mean, I´m drawing a keyboard image over a white background and the colors of the image are not the same when blending, I know that they should be more bright becase of the additive blend, but the problem is that they are totally different.

I use this code to build de both fix parameters:

u8 Byte=(u8)(fTrans*0xFF);
u32 KeybFix=Byte<<24 | Byte<<16 | Byte << 8;
u32 BGFix=(255-Byte)<<24 | (255-Byte)<<16 | (255-Byte)<< 8;
sceGuBlendFunc(GU_ADD, GU_FIX, GU_FIX, KeybFix,BGFix);
sceGuEnable(GU_BLEND);

what this does is given a transparency it calculates the fix value for the dst and the source, it blends ok, but I have the colors problem.

If anyone knows how to set the "MODULATE" mode this will fix all my problems :).

Thanks in advance, and sorry for the long post,
HexDump.
Back to top
View user's profile Send private message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Sat Apr 15, 2006 1:33 pm    Post subject: Reply with quote

Don't know if this is what you are looking for but:
Code:
sceGuTexFunc(GU_TFX_MODULATE,GU_TCC_RGBA);

Is something I use.

Keep in mind that Texture Modulation and Blending via vertex colors/lighting are two different but related operations.
Back to top
View user's profile Send private message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Sun Apr 16, 2006 10:53 pm    Post subject: Reply with quote

Hi starman2049,

If I´m not wrong the sceGuTexFunc is used to blend texture stages, I mean, for multitexturing, etc... If it works like dx or ogl.

So, it won´t have any effect on the final blending -> fragment buffer + frament comming from multitexturing, and this final blending (blending function) does not have MODULATE.

Thanks in advance,
HexDUmp.
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