postprocessing icon indicating copy to clipboard operation
postprocessing copied to clipboard

Implement MaskPass

Open valentinradu opened this issue 1 year ago • 2 comments

Is your feature request related to a problem?

MaskPass seems to be missing from v7. Not sure if by design or not. Didn't find any relevant info in the roadmap.

Describe the solution you'd like

MaskPass should be in v7, I feel like the design was very clear in v6.

Describe alternatives you've considered

I'm considering implementing it myself based on the v6 example, but unsure if there's a different way to achieve the same thing (using the stencil buffer).

valentinradu avatar Aug 27 '24 14:08 valentinradu

I've left out MaskPass because I wasn't sure whether it was worth porting to v7 since I haven't seen any real use cases for it in v6. I'm open to the idea of bringing it to v7 though. However, I think the implementation would need to be adapted to the I/O chaining system in v7. I'll need to give this some thought when I get a chance.

Also, any concrete use cases for stencil-based masking would be appreciated.

vanruesc avatar Aug 28 '24 13:08 vanruesc

I would say the most common use case I can think of is helping with composition when some the resulting edges of some effects are not clamped. For example, blur, bloom etc. I know that theoretically they could be clamped in the shaders, but that's not always desirable or available.

Also, some really nice transition animations can be achieved with masking that's really difficult otherwise. For example, blurring objects that are far and then bringing them into focus.

Please note that I'm still a novice with webgl and there might be other ways to achieve the above, but I can't think of any.

valentinradu avatar Aug 29 '24 14:08 valentinradu