this is my PG 111 | Babylon.js Playground (babylonjs.com)
I create a sphere and a box. when highlightLayer addmesh(box),
but highlightLayer.addmesh(sphere),it’s OK.
The incorrect occlusion relationship is related to the order in which the mesh is created.
If any mesh is obstructed, I hope the highlight layer can be displayed normally like the box.
emmm …I hope the highlight layer can be displayed normally like the sphere.
111 | Babylon.js Playground (babylonjs.com)
I try to reload the sphere,and I failed
You can simply not add the sphere/ground in the excluded list of meshes:
1 Like
I hope the complete outline of the occluded mesh can be seen.
if i don’t add the other mesh in excluded list of meshes,just like this
When the mesh is completely occluded, the highlighted layer cannot be seen
That’s a limitation of the highlight layer, unfortunately.
There are a number of threads in the forum regarding hightlighting objects. For eg:
Welcome aboard!
What you could is drawing the object at the end (after all other objects) this way:
draw the object with zTest=Greater / disable z writing / use the shader with the x-ray effect. This pass will draw the parts of the object using the x-ray shader where the object is occluded by some other objects from the scene
draw the object normally with its normal shader. This pass will draw the parts of the object that are not occluded.
In Babylon.js, you will need to clone the object to …
1 Like