vkoskiv / c-ray

c-ray is a small, simple path tracer written in C
MIT License
797 stars 44 forks source link

Implement a top-level BVH. #69

Closed vkoskiv closed 4 years ago

vkoskiv commented 4 years ago

I want to implement a BVH accelerator anyway, so we could start out by implementing one for the object level, and still use k-d trees for primitive acceleration. Especially when instancing is fully implemented, we absolutely need a good BVH if we are to render millions of objects.

madmann91 commented 4 years ago

Note that your "kd-tree" implementation is in fact a BVH already, not a kd-tree. Are you looking for pull requests?

vkoskiv commented 4 years ago

Thanks for the comment @madmann91!

I guess I was a bit confused about the terminology when I made it a few years ago. My thinking with this issue was that, say I have 10,000 instances of an object, each object has their own kd-tree, but the overall set of objects still needs to be iterated with an exponential time complexity.

And yes, I'm more than happy to accept issues and pull requests, just let me know what you'd be interested in working on! Thanks again for taking a look.

madmann91 commented 4 years ago

I'd be interested to provide a simple BVH drop-in replacement for the kd-tree impl. I'll create a pull request when it's in a good state.

vkoskiv commented 4 years ago

@madmann91 Sounds awesome, let's do it!

vkoskiv commented 4 years ago

@madmann91 Oh, and be sure to check out the contributing section on the Wiki, just so we're on the same page. Thanks!

vkoskiv commented 4 years ago

Resolved by 76b3843c354b7830b637de47024c090acc3ab6b1