Replies: 1 comment 9 replies
-
0.2s is pretty low if you are only doing the calculation when you are first loading the model. Are you calculating it often for some reason? Perhaps caching it would help. As a general note, if you have CullNode/CullGroup/LOD/PagedLOD in the scene graph these have bounding spheres that are used by ComputeBounds visitor by default to create the bounding volume of the scene graph, this produces a less tight bound but is faster as you don't have to visit the mesh leaves of the scene graph. Moving these type of computation to the GPU is possible but would require a round trip from the CPU to GPU and back to the CPU, this round trip will likely negate any possible performance improvements. The times when computing bounding volumes on the GPU makes sense would be when you have data that is being computed on the GPU and remains resident on the GPU, and then can be used by shaders in their work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
While examining why bounding box calculation is so slow for large models, e.g. a CAD model I have worked on has 4.5M triangles, which takes about 0.2s to do on the host. I started wondering why the calculation is done in the CPU and not on the GPU. I asked Github Copilot about it, and I got the response that calculating the bounding box is feasible by using a Compute shader and parallel reduction. I will try to implement such a shader for my own application, but I was wondering whether this could not be generalized for the ComputeBounds visitor as well in VSG? Perhaps I'll find out after doing such an implementation, but I was still curious if someone has tried doing this?
Beta Was this translation helpful? Give feedback.
All reactions