| View previous topic :: View next topic |
| Author |
Message |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Tue Feb 28, 2006 10:07 pm Post subject: light effects on psp |
|
|
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 |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Tue Feb 28, 2006 10:58 pm Post subject: |
|
|
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 |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Tue Feb 28, 2006 11:10 pm Post subject: |
|
|
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 |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Mar 02, 2006 12:52 am Post subject: |
|
|
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 |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Thu Mar 02, 2006 5:05 am Post subject: |
|
|
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 |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Mar 02, 2006 7:35 am Post subject: |
|
|
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 |
|
 |
|