HighlightLayer bug

Hello everyone, I’ve been facing this problem for a long time: the HighlightLayer starts to overexpose and behave very strangely when it interacts with certain other functions. For example, in this case, I reproduced the moment when objects intersect with each other while two HighlightLayers are enabled simultaneously—one blue and one red.
This also happens with text.

Because of this, in my main project, I have to somehow work around it or completely disable the HighlightLayer (but I really like it and want to use it).

Is there any solution to this problem (other than simply disabling the other color)?

For example, in my project there is a transparency mode, and through it this kind of effect occurs.

Or, for example, when we see text, I had to completely disable the HighlightLayer, otherwise the same bug would happen—the object would start glowing very brightly.

What’s the purpose of the overlap highlight layer? If I disable it and exclude the labels from the layer, it seems to work as expected (?)

Also, have you tried the new selection outline layer?

Perhaps this will be more suitable for your use case.

1 Like

SelectionOutlineLayer

has a compatibility bug with WebGPU — there is a problem with sampler binding at the engine level, and it cannot be worked around.

I tried to run it, but it didn’t work.
Does it only work on WebGL?

The problem is that SelectionOutlineLayer has a compatibility bug with WebGPU — it incorrectly sets up the sampler binding (Filtering sampler incompatible with non-filtering sampler binding), which breaks the entire render pipeline. Neither forceGLSL nor disabling MSAA helps — this is a bug at the Babylon.js engine level.

Can you provide a repro, as it does work in the sample from the documentation:

The problem has been solved, I found your correspondence on the forum 4 days ago, and decided to update the version to the latest, and indeed the problem has been solved.

2 Likes