I have HTML overlay elements tied to world coordinates. I need to find an easy, performant way to determine if those coordinates are viewable from the camera position. I can easily test if they are in the view, but what I need is to determine if the point in occluded by objects. I found an example that uses the depth buffer to do a z test but this does not perform very well at all. FPS gets cut in half. Here is the example:
Here is a similar example:
I was considering creating meshes at the world locations to perform occlusion testing on. Are there any good examples of occlusion tests that I could adapt to my scenario? How can either of those examples be modified to test for occlusion without using the slow calculations using the z buffer?