Highlight layer include/exclude mesh question

I was about to open an issue on GitHub about this, but thought I’d ask here first.

We have a relatively complex scene of 300+ meshes with a highlight layer that only has 2 meshes which are added with .addMesh(). However, when I dig into the rendering for that layer, I see it takes a long time (+4ms). I spent some time looking at the internal mesh lists and saw all the other meshes are there (opaqueSubMeshes, alphaTestSubMeshes etc). When I add these other meshes to the excludeMesh list of the Highlight layer, the performance improves.

Is this expected behaviour?

Here is a PG example:

yes, we need to draw even if as a flat color to handle the occlusion of the highlights. Excluding them prevents to draw but obviously the highlights will not get occluded anymore.

Right, so, if the highlights are on top, we can safely add all other meshes in the scene to the exclude list?

Yup, exactly.