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 

light effects on psp

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



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Tue Feb 28, 2006 10:07 pm    Post subject: light effects on psp Reply with quote

image links do not work to qj.net... sorry

how can i create such effects? (semitransparency won't work here)

greets
lumo, who is just back from hospital... :o(
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com


Last edited by LuMo on Tue Feb 28, 2006 11:01 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Tue Feb 28, 2006 10:58 pm    Post subject: Reply with quote

Lighting effects are mostly done by additively blending the light textures over the screen. This is achieved on the GU by calling sceGuTexFunc( GU_TFX_ADD, GU_RGBA ) before you render the light textures.
Note that since the color values are added together, you wouldn't need a alpha channel in the texture to get transparent parts (and thus could also simply use GU_RGB instead of GU_RGBA), since all black areas in the texture will be completely transparent, no matter what the alpha value would be - the basic rule is: the darker the texture, the more "transparent" it will be
However you should also try playing around with setting GU_TFX_DECAL or GU_TFX_BLEND together with different alpha modes like GU_ONE_MINUS_SRC_COLOR/GU_SRC_COLOR etc. as it might produce interesting effects also, but that's more complicated to get the wanted result

Greets,
Raphael

PS: Hope you're well again or at last will get well soon :)
Back to top
View user's profile Send private message Visit poster's website
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Tue Feb 28, 2006 11:10 pm    Post subject: Reply with quote

which means it >should< be possible with semitransparency, but, by now... only full or no transparency was possible here (guess something wrong in my setup....)

greets
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Thu Mar 02, 2006 12:52 am    Post subject: Reply with quote

ok, tried playing...
somehow when i enable blending the whole mesh is no more shown...
i tried
Code:
sceGuEnable(GU_BLEND);
sceGuBlendFunc(GU_ADD, GU_SRC_COLOR, GU_DST_COLOR, 0, 0);

and
Code:
sceGuEnable(GU_BLEND);
sceGuBlendFunc(GU_ADD, GU_ONE_MINUS_SRC_ALPHA, GU_SRC_ALPHA, 0, 0);

both without anything drawn to screen...
same result when i call
Code:
sceGuTexFunc(GU_TFX_ADD,GU_TCC_RGBA);

instead of my current
Code:
sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGBA);


any ideas?

greets
lumo
PS: simple samples available?
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Thu Mar 02, 2006 5:05 am    Post subject: Reply with quote

Either your alpha values from the texture are all zero, due to wrong loading or you supply zero alpha values in the vertice colors for drawing the mesh and didn't turn off the use of the vertice alpha (as it is when using GU_TX_REPLACE, and since the mesh shows with that, I'd say that's the real problem). Take a closer look at the gu header and the sceGuTexFunc's description on how the destination color and alpha values are generated with the different modes, and you'll find the one that doesn't use the vertice alpha.
If you'd show me your drawing code I could probably tell you more exactly what is wrong, but most likely it is one of the above reasons.
Back to top
View user's profile Send private message Visit poster's website
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Thu Mar 02, 2006 7:35 am    Post subject: Reply with quote

i did not save alpha with the png, as i tried it first with RGB...
ok ill check and show you the code too;
its too late here now to do it today, but ill do it when i am back from university tomorrow

thanks in advance
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
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