It is sometimes desirable to use a stencil buffer with an EffectLayer, but this isn’t currently supported.
For example: Babylon.js Playground
In this demo, the post-process glow isn’t masked properly by the stencil settings since the underlying texture doesn’t have stenciling enabled.
This can be fixed by allowing EffectLayers to enable stenciling. Here is what that might look like:
That may be true, I didn’t actually test nor have a use case for highlight layer, I just did the same changes as glow layer. I can remove that from my branch.