yes i know it's not documented yet but for my particle engine i really need it...
i need a little help..
for what I understood:
normal blending is:
setBlendFunc(BlendFactor.ZERO, BlendFactor.ZERO) |
Additive Alpha Blending
setBlendFunc(BlendFactor.SRC_ALPHA, BlendFactor.ONE) |
Solid Alpha Blending
setBlendFunc(BlendFactor.SRC_ALPHA, BlendFactor.ZERO) |
but i can't find right combination of
screen alpha blending and multiply alpha blending
(and i don't know if the above are really correct ;;) )
any help?
Comments
You can use this (for example add to init.lua):
cheers,
www.tntengine.com
but
screen blending works much like noAlpha :-S
the "screen" blending that i want to do is (like in game*alad particles)
like self:setBlendFunc(BlendFactor.SRC_ALPHA, BlendFactor.ONE_MINUS_DST_ALPHA)
but is not perfect...
@-)
www.tntengine.com
alfa is:
(BlendFactor.SRC_ALPHA, BlendFactor.ONE_MINUS_SRC_ALPHA)
what i tried is:
(BlendFactor.SRC_ALPHA, BlendFactor.ONE_MINUS_DST_ALPHA)
SCREEN blending used with an another game engine .. it's a middle way between ALPHA and ADD...
i don't know if IT'S the correct way... but...
www.tntengine.com
I've done some tests at http://www.andersriggelsen.dk/glblendfunc.php
I think the most similar result to screen blend is (BlendFactor.SRC_ALPHA, BlendFactor.ONE_MINUS_SRC_COLOR)
What do you think?
1st. thank for your time on this.
yes the effect are very similar but there are visible black box around the sprites...
if you want i could send to you the sources of particle engine and a litte test program...
www.tntengine.com
I start to think, there may be no exact way to do screen blending.
www.tntengine.com
add and mul blending may be enough for very many effects!
thanks again for looking at this!. :P
www.tntengine.com
With the introduction of premultipled alpha, now the screen blending mode works perfectly. I've added this to the setBlendMode function.
Dislikes: Apollo14
www.tntengine.com