Showing highlighted silhouette of mesh ONLY when it is occluded

I don’t think using 4 rays would be better because you could get some false positive: the 4 rays could tell the mesh is occluded but we should still draw it normally (imagine two walls separated by 1m and a character standing between the walls). You could use more rays to improve things, but you could always have some cases where it would not work.

Occlusion queries are not 100% accurate because they are using the bounding box of the mesh to know if it is occluded or not: in the PG, sometimes the mesh is not silhouetted because the bounding box is still visible whereas the mesh inside is not. It’s something that can be mitigated if the bounding box is thin compared to the width/height dimensions, which is normally the case with characters. Also, you could shrink the bounding box a little (but this time you could display the silhouette a bit too early - it’s always a trade off).

1 Like