indigo
indigo copied to clipboard
Layer Masking
There might be an issue open for this but just wanted to capture quickly.
I've been putting off masking on the excuse that we need render targets first, and that's sort of true, but I think there's probably a work around:
- Add another field to Layer.Content that is identical to
nodes
, calledmask
. - Render the layer twice:
- First you render the mask, and at the last moment, render it to a new mask buffer
- Render the layer as normal.
- Update the blending process to accept the new mask buffer as a fixed input.
- Use the mask during the blend process to decide how much of each pixel to draw. (Alpha values are ok)
- Clean the mask before the next layer is rendered.