marcosimonvfx Posted July 24, 2020 Share Posted July 24, 2020 Hi After reading this article on scratchapixel, where they talk about an efficient algorithm for finding intersections of a ray and a box I wanted to see how it compared to the built in intersect function. To my knowledge, the built in intersect function is looping over all the prims given in no particular order - I infer this information from the description of the primfind function, which states that it should be used with intersect, because"primfind uses an underlying tree structure to speed up search" (so I take it intersect does not). My test scene creates boxes on n scattered points in a volume. On one attribute wrangle I use the built in intersect function, on another one I use the one from scratchapixel. I would expect the scratchapixel one to be faster, also because the intersect has to loop over n * 6 prims (6 prims per box) whereas the scratchapixel one only has to iterate over n points. However the intersect is magnitudes (!) faster than the custom one. Does anybody have ideas why? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.