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(
light effects on psp
light effects on psp
Last edited by LuMo on Tue Feb 28, 2006 11:01 pm, edited 1 time in total.
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 :)
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 :)
ok, tried playing...
somehow when i enable blending the whole mesh is no more shown...
i tried
and
both without anything drawn to screen...
same result when i call
instead of my current
any ideas?
greets
lumo
PS: simple samples available?
somehow when i enable blending the whole mesh is no more shown...
i tried
Code: Select all
sceGuEnable(GU_BLEND);
sceGuBlendFunc(GU_ADD, GU_SRC_COLOR, GU_DST_COLOR, 0, 0);
Code: Select all
sceGuEnable(GU_BLEND);
sceGuBlendFunc(GU_ADD, GU_ONE_MINUS_SRC_ALPHA, GU_SRC_ALPHA, 0, 0);
same result when i call
Code: Select all
sceGuTexFunc(GU_TFX_ADD,GU_TCC_RGBA);
Code: Select all
sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGBA);
greets
lumo
PS: simple samples available?
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.
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.