If a transparent mesh is set with occlusion queries, overlapping with Highlighter objects will result in color errors

Create a small example PG please.

1 Like

please help me,thank you

1 Like

No worries, help is on the way. I’ll have a look at it just right after my meeting ends. However @Tricotou could get ahead of me :see_no_evil: :sunglasses:

Add this:

    box.renderingGroupId = 1
    plane.renderingGroupId = 0

And check out the docs what it is used for if you already don’t know :slight_smile: A lil bit of homework :wink:

Why do you use occlusion queries on a plane ? :thinking:
I think it should be used only for heavy meshes to render, as an optimisation process

Because in other services to use occlusion query, to determine whether Mesh is occluded

I do occlusions on simple stuff as well so I can react in a certain way when the mesh becomes visible/hidden.

Did you try my suggestion?

I tried, but it wouldn’t work. The color will be overwritten

This with the renderingGroupId’s set:

this is how it looks without them:

Is there any way to solve the problem of a lot of green

Ok, so let’s try to solve it once again, slowly, step by step:

We have an issue here, the whole box is green, not just it’s edges (https://playground.babylonjs.com/#Z1OGFX#6)

And here is a PG without the issue - lines 45,46 added
(https://playground.babylonjs.com/#Z1OGFX#7)

Got it?

thank you。Sorry, this is not I wanted。I want to overlay a transparent and occlusionType mesh on the highlightLayer without the problem of large green patches

This will make the box look like it’s on top of the plane

Sorry, now I get it.

Is this want you want to achieve?

yes yes, but, After I added the occlusion query, it’s no longer possible。

    highlightLayer.renderingGroupId = 0
    plane.renderingGroupId = 1