Blending revisited.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Blending revisited.

Post by HexDump »

Hi,

After playing about 1 hour (1 more) with the sceBlendingFunction without getting the results I like, I have decided to post again about blending.

What I would like to get is something like Cs * Alfa + Cd * (1-Alfa), easy....

My Pixel Buffer is 565, and the image I want to blend with the pixel buffer 565 too now. I have thing about converting de 565 to 4444 and use alfa in my vertexes, Is this what everyone would do in this case?.

P.D. With the srcfix and dstfix parameters of blend function I got some kind of blending but colors where screwed, so this is not enough for me.

Thanks in advance,
HexDump.
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

Here's what I do, don't know if this will help you or not:

On init:

Code: Select all

   sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
   sceGuEnable(GU_BLEND);
When I set the texture, I set my modulation accordingly:

Code: Select all

if (pMaterial->has_alpha)
   sceGuTexFunc(GU_TFX_MODULATE,GU_TCC_RGBA);
else
   sceGuTexFunc(GU_TFX_MODULATE,GU_TCC_RGB);
For vertices: alpha value of 0==completly translucent, and 255==completly opaque[/code]
Post Reply