Status of Masking?

Monkey Forums/Monkey Programming/Status of Masking?

zoqfotpik(Posted 2013) [#1]
What is the status of bitmap masks?

I want an effect to occur in certain places that are masked off, eg. replacing parts in bitmaps that are a certain color. Is the simplest way to do this simply to use transparent color in a PNG and be done with it? I can certainly do that. But it would be nice to be able to do other sorts of effect similar to those possible using masks in Blitzmax.


Shinkiro1(Posted 2013) [#2]
It also seems not that hard to implement:
http://stackoverflow.com/questions/5097145/opengl-mask-with-multiple-textures


zoqfotpik(Posted 2013) [#3]
Am I wrong that this is sort of important to have? Presumably it has been considered and judged less important than other things.

What do?

Shinkiro, do you think this is something that the community could produce? What would need to be done?


muddy_shoes(Posted 2013) [#4]
Having Porter-Duff compositing and chroma-keying would be useful but there are normally other ways to achieve the same effect. Creating an API to do it that will be consistent in behaviour across targets isn't simple.


grovey(Posted 2013) [#5]
Can't you use the GL module(s) to produce masking?


Nobuyuki(Posted 2013) [#6]
nDrawExts has access to the stencil buffer, which you can use for masking:

http://www.monkeycoder.co.nz/Community/posts.php?topic=4749

All operations are treated as a 1-bit threshold. The buffer's availability seems to depend on the target implementation, since Mojo doesn't set stencil bits.


zoqfotpik(Posted 2013) [#7]
That's awesome.