项目作者: fuqunaga

项目描述 :
Unity ComputeShader implementation of BVH(Bounding Volume Hierarchy) based mesh hit checking.
高级语言: C#
项目地址: git://github.com/fuqunaga/ComputeShaderBVHMeshHit.git
创建时间: 2021-03-02T10:32:31Z
项目社区:https://github.com/fuqunaga/ComputeShaderBVHMeshHit

开源协议:MIT License

下载


ComputeShaderBVHMeshHit

Unity ComputeShader implementation of BVH(Bounding Volume Hierarchy) based mesh hit checking.

meshhit
bvh

Installation

Add the following address to UnitPackageManager.

  1. https://github.com/fuqunaga/ComputeShaderBVHMeshHit.git?path=/Packages/ComputeShaderBVHMeshHit

How to use

Create BVH Asset

BuilderWindow

  1. Window > BvhBuilder
  2. Set meshObjectRoot object.
  3. Build to create BvhAsset.

C

  1. Put BvhHelperBehaviour to the Hierarchy.
  2. Set BvhAsset.
  3. Call BvhHelperBehaviour.SetBuffersToComputeShader().

ComputeShader

  1. Add the following include statement to your ComputeShader.
    #include "Packages/ga.fuquna.computeshaderbvhmeshhit/Bvh.hlsl"
  2. Call TraverseBvh() to detect a mesh hit.

References