High VisibleQuery Usage when faced with a high volume of small parts onscreen.


Above is pictured a mix of 75,000 Cylinders and Blocks. This is causing issues with players lagging using our spray painting system in our game. I believe this is related to the occlusion culling system currently in place.

Attached is a simple repro file of this behaviour:
occlusion repro.rbxl (2.6 MB)

Hello There! I hope you’re doing well.
Thank you for taking the time to submit this issue and for reading our message.

To help us move forward, we’d appreciate your support with a few questions:

  • Is this issue still occurring on your device?

  • If so, would it be possible for you to share with us a microprofiler dump File, and your system information?

Don’t worry — we’ve got you covered!
You can find step-by-step instructions on how to generate and send the microprofiler [How to post a Bug Report - Bug Reports - Developer Forum | Roblox]. Following these steps will help us better understand the issue and work on a solution more efficiently.
Thank you again for your cooperation!

Hi! Thanks for the reply, the issue is still occuring.

System Specs:
AMD Ryzen 7 3700x
NVDIA RTX 2070 SUPER
16GB RAM

Microprofiler Dump:
microprofile-20260311-212948.zip (571.0 KB)

1 Like

Hi fireys,

Occlusion Culling should dynamically reduce the amount of work it will try to do over the course of a couple of seconds if it sees that it is extending beyond the end of the frame.

Do you see the VisibleQuery profile reduce over time?

Hi CoastalStarlight,

The VisibleQuery profile does indeed reduce over a few seconds, but it still takes up a considerable amount of frametime.

What is not shown in the microprofiler are the GPU markers. Occlusion Culling will not extend the frame time so long as the GPU time is high enough (in fact, if the GPU time is high, we would like to spend more time in occlusion culling since that has the potential to reduce GPU time via culling draws)

My profiler snapshot below is taken on my debug build, which has access to GPU markers. The blue bar at the top marked “Scene” is the GPU time. The fact that it almost contiguous indicates that this scene is likely GPU bound (which makes sense - it’s just a basic scene with no scripts and a lot of geometry).
On the main render thread, the profiler marker “waitOnGPU” means that the main CPU thread needs to stall to wait for the GPU to finish processing.

Although the occlusion culling thread takes up a big chunk of time, this is happening on an Async thread and should not be stalling the main render thread. Long “waitOnGPU” times like we have here usually indicate that we should be trying to cull as much as possible.

In this case it doesn’t help much since all the geometry is visible. But it still shouldn’t be blocking the main render thread.

The concerning scenario would be when the Visibility query is extending past the end of the frame (marked in the profiler as the end of “Present”). If this happens, occlusion culling should reduce the amount of work it is doing until it doesn’t anymore.

In the repro file you provided, it seems like the occlusion culling threads successfully reduced their work to stop extending the frame after a few seconds. Are you seeing different behavior on your device?

I ran a test on the place provided by the OP, I disabled occlusion culling through a fast flag and I found that in my case it was cutting the frame time in half 8ms → 4ms (My fps went from 120 → 240). I have additionally attached both profiles for you to look at.

In this scenario on my device, disabling occlusion culling significantly improved performance.

The FFlag that was used was DFFlagUseVisBugChecks and was set to false.

In the place the OP provided I disabled character loading as well as streaming enabled, and set the camera to the same CFrame.


Code used to test:

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = CFrame.new(0, 60, 0)*CFrame.Angles(math.rad(-90),0,0)

OcclusionProfiling.zip (2.9 MB)

2 Likes

Thanks for confirming Star_Mades.
If the occlusion culling thread doesn’t scale down it’s work then there is probably a bug. I will continue to investigate.

1 Like

Just to provide a little more info, the occlusion culling did scale down its work over a period of time, in my previous reply I had left it running for a few minutes to see if it were to ever scale down or even just turn off. Whilst It did scale down, it seems that it was just unable to scale down all the way so that it would not extend past the scene.

1 Like