Files
speckle-server/packages/viewer/src/modules/queries
Alexandru Popovici 6a09866535 Top Level Acceleration Structure (#1553)
* Started implementing the TAS by using the same BVH library and  solid bounding boxes as dummy geometry. It works great so far, we're almost at 10X faster than without it. Still needs a bit more work put int the details

* Implemented shapecasting with the TAS in a fairly efficient way. This means that our current application for shapecasting, the section outlines, are much faster to generate now.

* Implemented TAS refiting whenever batch objects change their position/rotation/scale. It's sufficiently fast. The refiting process itself is very very fast on the TAS, the thing that slows it down a bit is all the matrix multiplications. We can speed those up via micro optimisations

* Replaced default three.js box geometry construction with a bare bones one since that's all required for our TAS

* Used buffers in the occlusion query solve to avoid pointless vector creation

* Some small changes and renames

* Changed the section box helper to use Box3Helper instead of BoxHelper beacuse Box3Helper always uses vertex positions relative to world origin and stores the transformation in it's world matrix which it never uses inside the vertex program, hence no floating point imprecision. The worldView matrix which it does use, has as a result small values essentially working like RTE. It will only work for relatively small objects, though and if we have large box helpers far away from origin it, we will begin to see jitter. However, this is just a visual helper, so I'm fine with that caveat

* Reported bounding box the the TAS is it's own BVH bounds now, not te cummulated BAS bounds like before. It's much faster this way

* Limited object explode transform calculation to exclusevely 1 per frame, since UI events coming from sliders and such tend to create multiple events per frame, leading to us computing millions of transformations pointlessly.

* The TAS leafs now only have the minimum possible of 8 vertices and 12 triangles. This sped up BVH operations a bit

* Considerable speedup for ray-TAS intersection by eliminating the need to iterate over all contained batch objects to determine the intersected one by comparing the intersection result vertex index. We can simply compute the intersected one since they are built in order with a constant stride between them inside the vertex array
2023-05-02 13:34:05 +03:00
..
2023-01-26 12:12:09 +02:00
2023-01-26 12:12:09 +02:00