Mesh.Intersect
I was wondering if any knows how DirectX's Mesh.Intersect method works? I'm having some trouble searching for it. I'm trying to figure out how it actually performs the intersection tests and if it's faster than what I could write by hand. I would like to assume the developers of the API did a good job at accelerating the intersection tests and also that the tests are all ray/triangle tests; however, I never settle with just assumptions.
Thanks.
I don't have any hard facts for you, but I assume that they are just looping over all of the triangles in the mesh and doing a ray/tri intersect on it. I assumed this because it is rather slow for a large mesh (I used it for a while on some large terrain meshes). To speed it up, I wrote a KD-tree to divide up the triangles into smaller chunks and traverse that tree with the ray before looping over the tris that are in a small bounding box (leaf of the tree).
I can't think of how they would accelerate the intersect method unless they do some kind of hierarchy or grid to reduce the set of triangles to test with.
I haven't done any timings or tried to look at the code, so I am not absolutely certain, but I know my kd-tree is faster.
I can't think of how they would accelerate the intersect method unless they do some kind of hierarchy or grid to reduce the set of triangles to test with.
I haven't done any timings or tried to look at the code, so I am not absolutely certain, but I know my kd-tree is faster.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement