Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fuqunaga/computeshaderbvhmeshhit
Unity ComputeShader implementation of BVH(Bounding Volume Hierarchy) based mesh hit checking.
https://github.com/fuqunaga/computeshaderbvhmeshhit
bvh collision-detection computeshader mesh unity3d
Last synced: 4 months ago
JSON representation
Unity ComputeShader implementation of BVH(Bounding Volume Hierarchy) based mesh hit checking.
- Host: GitHub
- URL: https://github.com/fuqunaga/computeshaderbvhmeshhit
- Owner: fuqunaga
- License: mit
- Created: 2021-03-02T10:32:31.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-27T08:56:31.000Z (about 1 year ago)
- Last Synced: 2024-06-06T23:39:04.483Z (9 months ago)
- Topics: bvh, collision-detection, computeshader, mesh, unity3d
- Language: C#
- Homepage:
- Size: 52.2 MB
- Stars: 71
- Watchers: 6
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ComputeShaderBVHMeshHit
Unity ComputeShader implementation of [BVH(Bounding Volume Hierarchy)](https://en.wikipedia.org/wiki/Bounding_volume_hierarchy) based mesh hit checking.
# Installation
Add the following address to UnitPackageManager.
```
https://github.com/fuqunaga/ComputeShaderBVHMeshHit.git?path=/Packages/ComputeShaderBVHMeshHit
```# How to use
### Create BVH Asset

1. **Window > BvhBuilder**
1. Set `meshObjectRoot` object.
2. **Build** to create BvhAsset.### C#
1. Put BvhHelperBehaviour to the Hierarchy.
1. Set BvhAsset.
1. Call `BvhHelperBehaviour.SetBuffersToComputeShader()`.### ComputeShader
1. Add the following include statement to your ComputeShader.
`#include "Packages/ga.fuquna.computeshaderbvhmeshhit/Bvh.hlsl"`
1. Call `TraverseBvh()` to detect a mesh hit.# References
* http://raytracey.blogspot.com/2016/01/gpu-path-tracing-tutorial-3-take-your.html
* http://marupeke296.com/COL_3D_No18_LineAndAABB.html
* https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/