I stumbled upon something when trying to give images constant alpha without specifying it in vertex colors. The obvious idea was to use sceGuColor to set the fragment color, then use sceGuTexFunc(GU_TFX_DECAL, GU_RGB) to let texture color be taken together with fragment alpha.
The result was that the image wasn't blended at all. And if it was, it was always completely invisible. So I started so dig into the functionality of sceGuColor and found that it is currently just a wrapper for sceGuMaterial(7, *), so it just sets the models ambient, diffuse and specular color at once.
However, it doesn't take the colors alpha into account, even though alpha can be supplied with the ambient model color - see sceGuAmbientColor.
So the current solution for getting constant alpha is calling sceGuAmbientColor instead of sceGuColor, but if one wants diffuse/specular lighting to take the same color, you'd need to call sceGuColor AND sceGuAmbientColor.
Now I wonder why that wasn't done - was it a mistake by forgetting about the ambient alpha, or is that on purpose?
My suggestion would be to patch the sceGuColor.c file to also apply the ambient alpha component.
sceGuColor functionality discussion - suggest SDK patch
sceGuColor functionality discussion - suggest SDK patch
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
I looked at the original function and you're right, for the ambient component it also sets the alpha register (88), my bad. Good catch there, I'll patch right away.
EDIT: Patch is now in svn.
EDIT2: Also committed another patch adding sceGuFinishId(), that has been missing since the start.
EDIT: Patch is now in svn.
EDIT2: Also committed another patch adding sceGuFinishId(), that has been missing since the start.
GE Dominator
That was quick :) Thanks chp
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl