glowLayer behaviour of "Included Only" Meshes

Hi,
I’m curious how to handle following scenario:

  • have a glowLayer
  • add mesh A via addIncludedOnlyMesh(meshA)
  • add mesh B via addIncludedOnlyMesh(meshB)
  • remove mesh A via removeIncludedOnlyMesh(meshA)

interim result:

  • only mesh B is glowing, since it’s still included in the layer glowLayer._thinEffectLayer._includedOnlyMeshes

  • remove mesh B via removeIncludedOnlyMesh(meshB)

current result:

  • all viable meshes in the scene are glowing, as glowLayer._thinEffectLayer._includedOnlyMeshes is now empty (I assume that’s the reason)

expected result:

  • no meshes would be glowing, since I wanted the layer to work only with explicitly added items, and when these are removed, none of them should be glowing.

current result:
since the is now empty, the glowLayer is considering all items in the scene should be included in the glowLayer because (again, I just assume) checking glowLayer._thinEffectLayer._includedOnlyMeshes says there should be no exception what to highlight

This makes it tricky because I want to dynamically add and remove items from the glowLayer, but when removing the last one, the behaviour becomes opposite what I would expect (ie. no items glowing vs. all items glowing). Here’s PG example for illustration. Uncommenting gl.addIncludedOnlyMesh(clonedTube) on line 24 changes the behaviour of what will end up glowing.

My current workaround is to add a dummy object which will be never removed from _includedOnlyMeshes (lines 17-18 in the PG). Is there any cleaner solution than this?

You are tottaly right we do not have a mecanism forcing a includeOnlyMode when no meshes are present.

Your workaround is totally fine and I wonder if a new mode would not introduce even more confusion.