|
Post by bezdomniy on Jul 1, 2020 22:54:56 GMT
Hi guys,
I've recently implemented bounding volume hierarchies in order to speed up rendering 3D models with many triangles and I've been pretty blown away by the results.
I looked up some algorithms to construct the BVHs but at first I just decided to take a simple approach and just recursively break the model down into equal groups of triangles. So essentially making a binary tree of groups with the leaves containing the triangles. Just this simple approach gave be an enormous boost in rendering speed. It can render a 400x400 scene with 5 stanford dragons in a couple of seconds, whereas before that would have taken minutes.
The below image is the armadillo model, containing about 50,000 triangles (it's 2 separate images side by side) takes about 3.5 seconds to render on pretty old 4-core Intel i5.
I wanted to see what it could do with a really large image, so I found this one called lucy. It contains about 450,000 triangles and renders in about a minute.
Next I'm going to have a go at implementing a better construction algorithm for BVHs - I will try SAH. I wonder how much faster I can make this thing!
I'm keen to hear if any of you have done anything cool to speed up rendering scenes with lots of shapes.
Cheers,
Ilia.
|
|
|
Post by Jamis on Jul 6, 2020 15:21:42 GMT
Beautiful results! I wish I'd had the space in the book to discuss optimizations like this---it really does make a world of difference. I don't know you saw my bonus chapter on the topic or not: raytracerchallenge.com/bonus/bounding-boxes.html --- it doesn't really add to what you've already done, but maybe it'll be helpful to others who haven't stumbled on it yet. Thanks for sharing! - Jamis
|
|