1 / 19

Concurrent Non-blocking BVH Creation

Concurrent Non-blocking BVH Creation. Adam Kavanaugh Kris K. Rivera. Introduction to Ray Tracing. Graphics technique for rendering objects in 3D space Used by movie industry to create exceptionally realistic movies. Introduction to Ray Tracing. 30-50hrs to render a frame

questa
Download Presentation

Concurrent Non-blocking BVH Creation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Concurrent Non-blocking BVH Creation Adam Kavanaugh Kris K. Rivera

  2. Introduction to Ray Tracing • Graphics technique for rendering objects in 3D space • Used by movie industry to create exceptionally realistic movies.

  3. Introduction to Ray Tracing • 30-50hrs to render a frame • 3D frames about 100hrs

  4. Acceleration Structures • Axis Aligned Bounding Box (AABB) • Uniform Spatial Subdivision (USS) • k-d Tree • Oct Tree • Bounding Volume Hierarchy (BVH)

  5. Bounding Volume Hierarchy • Binary Tree of bounding volumes • Boxes which encapsulate a collection of primitives • Entire scene of triangles surrounded in large bounding volume • Each level is split along a given axis • “Longest” axis usually chosen to split upon • Location of split is determined by a heuristic • Triangles are “sorted” into respective child bounding volumes by their medians • Process recurs for left and right children until one triangle exists as leaf node in its own volume

  6. Bounding Volume Hierarchy

  7. Non-Blocking BVH Construction • Tree construction is done in a pseudo-breadth first manner • Pseudo-Breadth First because the current build horizon expands independently as threads progress • Each thread acts as producer and consumer of tree nodes • Implemented using Java’s ConcurrentLinkedQueue class • Uses a wait-free algorithm for the class internals • Uses Java’s Atomic variable classes for CAS based counters.

  8. Non-Blocking bvh construction • Main Algorithm • Dispatch n (or more) threads • Each thread spins on the task queue until the tree is completed • When a thread gets a node from the queue, build the node, increment the number of built nodes and place any children nodes onto the task queue • Store the built node • Generate the BVH tree structure • Shared resources • Task Queue • BVH Tree structure • Counters • Number of nodes, threads, etc.

  9. Non-blocking bvh version differences • Version 1 • Child nodes are added to the tree as they are built • Requires size checks for each add to get the index • Spawn threads on-demand until build completes • Version 2 • Child nodes are stored in each parent, and then flattened into the tree once construction is completed • Only spawn required number of threads

  10. Experiment Setup • 7 builders tested • 2 single threaded, 5 concurrent • Using Depth-Firsth and Breadth-First build strategies • 17 models tested • 1010 triangles (Legoman) to 134K (Halo 3 Scene) • All times averaged over 3 trials • Experiment System • Windows 7 • Intel Core i7 Processor • 4GB RAM

  11. Results • For all builders, we see a general trend towards exponential build times in the number of triangles in the scene. • Non-blocking builder is generally as fast as the other blocking methods, except for the blocking BFS builder, which produces the fastest build times. • Additional threads do not linearly decrease built time.

  12. results

  13. results

  14. results

  15. Results

  16. results

  17. BfS Builder Comparison • The Blocking BFS Builder is faster than the Non-Blocking Builder. • Average 11.8% faster for 2 threads • Average 8.4% faster for 4 threads

  18. conclusion • Demonstrate the use of lock-free and wait-free data structures for use in BVH tree construction • Lock-free implementation is slower, but not by a lot. • Still gains benefits of being lock-free, and using wait-free data structures. • Implementation details matter!

  19. Questions?

More Related