Page 1 of 1
How can I do a "mask" or blendmode union ?
Posted: Sun Oct 19, 2008 12:21 pm
by TsT
Hello,
I'm searching to know (if it's possible) how draw multiple form with semi-transparent color without additive at all.
- at left what I have ; at right what I want
- iwanna.png (3.63 KiB) Viewed 4537 times
.
I tried with
setColorMode() and
setBlendMode() but without success as you can see at this sample :
Somebody has a idea ?
Re: How can I do a "mask" or blendmode union ?
Posted: Sun Oct 19, 2008 12:35 pm
by rude
I also totally want that, so if someone knows how to do it, I'll include it in the next version.
Re: How can I do a "mask" or blendmode union ?
Posted: Sun Oct 19, 2008 1:57 pm
by Damnae
You could draw two circles on a render target without additive mode, and then draw a square with that texture and additive mode on the backbuffer ...
(I think a render target is called a framebuffer in opengl)
Re: How can I do a "mask" or blendmode union ?
Posted: Sun Oct 19, 2008 2:55 pm
by rude
Clever, but will have to wait a while for that. 8-)
Re: How can I do a "mask" or blendmode union ?
Posted: Sun Oct 19, 2008 6:05 pm
by muku
Stencil buffers could also be used for that: every render operation would write into a stencil buffer, and new fragments only get rendered where the stencil buffer has not been set yet.