Check If Points Are Visually Occluded In Scene?

Hello,

I have 1,000s of points I need to check for occlusion in my scene and will eventually need to scale larger than that.

I’m trying to add text dots to any points that are not occluded by objects.

I also need this to be done on viewport update, so as the camera moves around dynamically… For this I use the change counter to update my logic when the viewport is modified.

Here’s a test example where you can see points on either side of this piece of geometry(wireframe):

Here’s the points in this camera frame I should be testing against(rendered/shaded views).

Currently I’m able to get good performance sub 500 points but start bottlenecking around 1500 points in the scene because my algorithm is working with ALL points in the scene even if they are obscured behind geometry.

You can see here my text dots are still being calculated for groups of points that aren’t visible to the current viewport (in rendered mode at least…)

I know GetPoint has pick context like “wireframe” vs “shaded” is there something like that for point depth testing?

A simple “is visible” boolean would be perfect.

I did find this method which helps as it culls any points “off screen” that aren’t in the current frustrum, but I still need the functionality of culling anything on screen that is “behind” objects to not be calculated as well.

I thought I could use something like GetDepth but can’t seem to find a simple method to check for the point occlusions.

Thanks for any tips!

1 Like

I once did something similar where I checked if a line from the camera to a point collides with any of the objects but I guess that’s not very efficient.

You could perhaps build up an RTree Class of the model and see if you can set up a set of queries that would meet your requirements.