What's everyone working on this week (38/2017)?

Last week I published a blog post about the Conference Room: First Results for Rust version of PBRT. I'm quiet happy with the current state of the renderer and also the parser (using the beta version of pest 1.0) is fast and reliable now. A real bottleneck for more complex scenes seems to be building the acceleration structure called Bounding Volume Hierarchies (BVH). This happens after the parser finished, and before rendering (and therefore multi-threading) starts. This week I already fixed the bug mentioned in the blog post. I'm not sure if I can attack the BVH problem this week because I will be on holiday until October, but I might release another version and update the Wiki and Readme file before leaving.

If anybody is interested in figuring out where the bottleneck comes from let me know. Basically you would compile the crate and all examples files via 'cargo test --release' and try to render one of the more complex scenes (after 'gunzipping' it):

> ./target/release/examples/pest_test -i assets/scenes/conference_room.pbrt
...
WorldEnd
DEBUG: rr_threshold = 1
...

Once you see the lines above the BVH gets build (single threaded), and once the mutli-threading starts (watch the CPUs e.g. with htop) the BVH is done and rendering starts. This takes several minutes, whereas the C++ version is pretty fast. I assume it's because it's doing this recursively and the C++ version manages memory itself via a class 'MemoryArena':

> rg -tcpp "BVHBuildNode \*recursiveBuild" -A 3
accelerators/bvh.h
71:    BVHBuildNode *recursiveBuild(
72-        MemoryArena &arena, std::vector<BVHPrimitiveInfo> &primitiveInfo,
73-        int start, int end, int *totalNodes,
74-        std::vector<std::shared_ptr<Primitive>> &orderedPrims);

I will probably create an (issue) ticket for this problem.

1 Like