-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GPU ray cast #3
Comments
Latest trunk has GPU raycast for sphere and convex shapes. It can be used for picking and for basic raytracing. The App_BasicGpuDemo uses it for picking, and the App_Bullet3* demo includes a basic raytraced test. |
I'm starting to make some effort on accelerating the GPU raycaster in this branch Presently, the branch implements a Linear BVH that runs on the GPU. Using the LBVH for the broadphase is ~1-2 ms slower than the 1-axis GPU SAP broadphase. However, the BVH construction algorithm is of extremely low quality and it has yet to be optimized, so there should be a large amount of room for improvement. |
That is very exciting! So you are building the tree on the GPU, and also the traversal? |
The plbvh_raycast branch is now ready for evaluation. The latest commit includes slides in the /docs folder that explains the LBVH construction. Additionally, both construction and traversal should be functional and reasonably optimized. The raycaster is also acclerated using the BVH. With the acceleration, most of the time in the raycasting demo is spent in ray generation and CPU-GPU data transfer. However, ray-triangle mesh and ray-compound tests are still not implemented. The current method for raycasting is: In my tests, the Linear BVH performs better than the 1-axis SAP for dense scenes, but worse for sparse scenes. Both broadphases are worse than the grid, due to the uniform size of objects. With 27000 AABBs, the break even point where the PLBVH starts to outperform the 1-axis SAP in the PairBench is about scale 76(~5700 overlapping pairs).
Please let me know if there are any issues or places for improvement. |
Thanks a lot, that sounds good! |
update example to use absolute path
GPU accelerated ray casting should be added.
It can be used for picking, line-of-sight queries and graphics related queries (shadow generation, ray tracer etc). There is a basic demo as a starting point. It supports GPU ray cast against spheres. It needs to be extended to support all collision shapes.
The text was updated successfully, but these errors were encountered: