Octree generation: oconv -n and -r options

Hey everyone,

I’ve been experimenting with the oconv settings to try and cut down the time it takes to generate an octree. It seems like two settings, -n and -r, are key factors here.

1) With default settings - 60s: When I leave -n and -r at their default (which I believe are 6 and 16384, respectively), it takes a minute to create the octree.

2) Adjusted for my scene - 79s: Based on the maximum distance and minimum spacing in my scene, I calculated that -r should be around 566. Surprisingly, this actually led to an increase in octree generation time.

3) Trying different values - 77s: I then tried setting -n to 1000 and -r to 16, thinking this might speed things up. However, the generation time was still longer than with the default settings.

I was under the impression that increasing -n and decreasing -r would make the octree generation faster. What am I overlooking here?

Cheers,
Alex

P.S. I’m aware that changes in octree resolution can affect rtrace’s runtime and precision, but that’s not my focus at the moment.

It’s difficult to know what is going on without looking closely at the geometry of your scene, but in general, increasing the -n setting and decreasing the -r setting should have a similar effect, which is to make the set of tested objects in each voxel larger. Besides the potential cost of doing so during rendering, it actually takes longer to manipulate large sets than it does to manage smaller ones, and it’s possible this cost overshadows the cost of object-cube intersection tests in your case.

This is really just speculation, since I know nothing about the octrees being generated in your tests. Digging into them would also require some coding, since oconv doesn’t really gather statistics, which might be useful.

Cheers,
-Greg