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 

sceGuClear and alpha

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
willow :--)



Joined: 13 Jan 2007
Posts: 126

PostPosted: Wed Dec 02, 2009 3:47 pm    Post subject: sceGuClear and alpha Reply with quote

This is probably a weird question, but...

is there a difference between:

sceGuClearColor(0xff000000);

sceGuClearColor(0xaa000000);

and

sceGuClearColor(0x00000000);

Assuming we call sceGuClear(); after that of course...

In other words, can we use an alpha value in the "clear" color so that a call to sceGuClear doesn't actually erase the screen (but instead creates a semi transparent effect), or is the alpha value entirely useless in there?

My tests seem to show that the alpha value is not used but I am wondering if it is another issue in my code so I just want a confirmation.

I would for example expect sceGuClearColor(0x00000000); followed by sceGuClear to have no visual effect at all, but apparently it does clear the screen to black (0xff000000).
_________________
Wagic. Play that card game against an AI on your PSP
Back to top
View user's profile Send private message
a_noob



Joined: 17 Sep 2006
Posts: 97
Location: _start: jr 0xDEADBEEF

PostPosted: Thu Dec 03, 2009 2:42 pm    Post subject: Reply with quote

To be short, alpha is not ignored, but it is also not factored in.

ClearColor is basically just fills the current buffer with what ever color you specify, no blending or math is done, just a fill. Which is why it will never only partially clear. So the difference between 0x00000000 and 0xaa000000 is that the buffer will have one or the other value, and unless you are blending alpha channels it will never effect you.

To achieve a partial clear do sceGuClear as normal but remove the color bit from the argument, then for the first call in your render loop/thread/pipeline render your self a quad the size of the screen with alpha and the proper blending modes of course.
_________________
Code:
.øOº'ºOø.
'ºOo.oOº'
Back to top
View user's profile Send private message AIM Address MSN Messenger
willow :--)



Joined: 13 Jan 2007
Posts: 126

PostPosted: Thu Dec 03, 2009 3:06 pm    Post subject: Reply with quote

Thanks!
_________________
Wagic. Play that card game against an AI on your PSP
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