When does using GPU picking make sense?

I don’t understand why GPU picking performs much better than CPU picking in this playground, but is not that much better in this. And when I tried in in my project readPixels is taking a lot of time, making it slower than the CPU picker with some optimization.

GPU is better than CPU when scaling up. If there are many meshes or meshes with many faces, there is a good chance GPU will be faster. If there are 2 meshes with a low numbers of faces, CPU might be faster and not async.
GPU model makes a big difference too. Mobile or desktop as well.

1 Like

This is a scene with a lot of meshes. Is there a way to optimize this? read pixels for a single pixel should be fast, right? for me the CPU picker is a little faster in this unless there’s a lot of background processes active.

This scene has much fewer meshes but the GPU picker is faster, that’s why I’m confused.

it also depends on triangle count. if you increase sphere geometry detail, you should see GPU being faster. GPU picking renders meshes into a render target. That extra rendering step is not free. GPU brings occlusion too that is not available with CPU. Depending on the use case, 1 if more appropriate than the other.

2 Likes