 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Thu Mar 01, 2007 7:45 am Post subject: sceGuColor functionality discussion - suggest SDK patch |
|
|
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. _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Thu Mar 01, 2007 8:33 am Post subject: |
|
|
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. _________________ GE Dominator |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
|
| 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
|