Voxel DAGs and Multiresolution Hierarchies From LargeScale Scenes
- Slides: 65
Voxel DAGs and Multiresolution Hierarchies From Large-Scale Scenes to Pre-computed Shadows Implementation: Ray-Tracing DAGs Markus Billeter 1 1 Delft University of Technology, The Netherlands
Previously. • Have a DAG • Now: ray-cast against it Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 2
Goals • Given a ray r(t) = x + t*d • Find (first) intersection with a voxel • Position of intersection • Identity of intersected voxel Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 3
Review: the DAG • Each node has up to 2^3 = 8 children Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 4
Review: the DAG • Each node has up to 2^3 = 8 children • Not a complete/balanced/… tree • Use pointers internally Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 5
Review: the DAG • Each node has up to 2^3 = 8 children • Not a complete/balanced/… tree • Use pointers internally • Looks a lot like a Sparse Voxel Octree • Except: can’t store backward links in the DAG • Sub-trees can be reached from different parents Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 6
Review: the DAG, II • DAG stored in an array • Consecutive list of nodes Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 7
Review: the DAG, II • DAG stored in an array • Consecutive list of nodes • Each node contains • 8 bits: present children (the “child mask”) • One or more pointers to child nodes Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 8
Review: the DAG, II • DAG stored in an array • Consecutive list of nodes • Each node contains • 8 bits: present children (the “child mask”) • One or more pointers to child nodes • Pointers are just indices into this array Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 9
Voxels & Paths • Identify a voxel by the path through the DAG to it. • Binary DAG: left = 0, right = 1 • Extend to octree by treating each axis separately Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 10
Voxels & Paths • Identify a voxel by the path through the DAG to it. • Binary DAG: left = 0, right = 1 • Extend to octree by treating each axis separately Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 11
Voxels & Paths • Identify a voxel by the path through the DAG to it. • Binary DAG: left = 0, right = 1 • Extend to octree by treating each axis separately Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 12
Voxels & Paths • Identify a voxel by the path through the DAG to it. • Binary DAG: left = 0, right = 1 • Extend to octree by treating each axis separately Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 13
Voxels & Paths, II • End up with three bit strings • One for each axis • This path uniquely identifies a voxel • It’s also a position • The path bit-string is the integer coordinate of the voxel • Convert to position in e. g. world space via the DAGs bounding volume Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 14
Voxels & Paths, II • End up with three bit strings • One for each axis • This path uniquely identifies a voxel • It’s also a position • The path bit-string is the integer coordinate of the voxel • Convert to position in e. g. world space via the DAGs bounding volume Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 15
Voxels & Paths, II • End up with three bit strings • One for each axis • This path uniquely identifies a voxel • It’s also a position • The path bit-string is the integer coordinate of the voxel • Convert to position in e. g. world space via the DAGs bounding volume Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 16
Voxels & Paths, II • End up with three bit strings • One for each axis • This path uniquely identifies a voxel • It’s also a position • The path bit-string is the integer coordinate of the voxel • Convert to position in e. g. world space via the DAGs bounding volume Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 17
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 18
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 19
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 20
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 21
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 22
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 23
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 24
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 25
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 26
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 27
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 28
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 29
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 30
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 31
Traversal • Start at the root • Visit the children that (a) exist (b) are intersected by the ray • Repeat until intersect a leaf • Or until we leave the root node 1. 2. • Depth first • First intersection: visit children in order along the ray Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 32
Traversal, II • At each node • Check each child, possibly descend • Or if no children left, ascend Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 33
Traversal, III • When descending • Figure out which child (number) • Fetch and follow corresponding pointer • Record this decision to build up the path Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 34
Traversal, III • When descending • Figure out which child (number) • Fetch and follow corresponding pointer • Record this decision to build up the path Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 35
Traversal, III • When descending • Figure out which child (number) • Fetch and follow corresponding pointer • Record this decision to build up the path • When ascending • Need to figure out where we came from earlier • Either having stored that somewhere • Or by repeating the steps taken so far (replay the path) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 36
Traversal, III • When descending • Figure out which child (number) • Fetch and follow corresponding pointer • Record this decision to build up the path • When ascending • Need to figure out where we came from earlier • Either having stored that somewhere • Or by repeating the steps taken so far (replay the path) • Need to know which children were visited already Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 37
Implementation • Now that we’ve gone over the general things • Let’s look at one particular implementation • • Method used at Chalmers Built up over a few years now Credit goes to the people there A few minor changes for this presentation. : -) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 38
Implementation • Now that we’ve gone over the general things • Let’s look at one particular implementation • • Method used at Chalmers Built up over a few years now Credit goes to the people there A few minor changes for this presentation. : -) • GPU method, implemented in CUDA • Avoid standard recursion • Should be portable to GLSL etc. Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 39
Implementation, II • Uses an array to store a per-thread stack • Each entry on the stack contains two 32 -bit values • The node’s base index • Intersection mask indicating remaining children (+ cached child mask) • Records path in uint 3 (3 x 32 bits) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 40
Implementation, II • Uses an array to store a per-thread stack • Each entry on the stack contains two 32 -bit values • The node’s base index • Intersection mask indicating remaining children (+ cached child mask) • Records path in uint 3 (3 x 32 bits) • Last two levels of the DAG are special • Single 64 -bit mask containing the 4^3 voxel geometry Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 41
Descending • When descending into a node • Push parent index + intersection & child masks to the stack • Fetch the child mask of the node • Compute intersection mask • If the intersection mask is non-zero • • Identify closest child along the ray Zero out bit representing this child in the intersection mask Compute index of and fetch the child’s pointer Follow the pointer to descend further Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 42
Descending – Intersection Mask • Which children does the ray intersect? Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 43
Descending – Intersection Mask • Which children does the ray intersect? • Compute a bit mask • Combine (and) with the child mask Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 44
Descending – Intersection Mask • Which children does the ray intersect? • Compute a bit mask • Combine (and) with the child mask Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 45
Descending – Intersection Mask • Which children does the ray intersect? • Compute a bit mask • Combine (and) with the child mask Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 46
Descending – Intersection Mask • Which children does the ray intersect? • Compute a bit mask • Combine (and) with the child mask • Constructed from • Intersection points with the current node Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 47
Descending – Intersection Mask • Which children does the ray intersect? • Compute a bit mask • Combine (and) with the child mask • Constructed from • Intersection points with the current node • Intersections with axis aligned planes bisecting the current node. (tz not shown) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 48
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 49
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 50
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 51
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 52
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 53
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 54
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes • Problematic case (bottom) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 55
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes • Problematic case (bottom) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 56
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes • Problematic case (bottom) • Compute mid point Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 57
Descending – Intersection Mask, II • If tx is in the range [tmin, tmax] • Add children to the intersection mask which are located in the same half as ty and in the same half as tz. • Repeat for other axes • Problematic case (bottom) • Compute mid point • Add voxel in octant of midpoint to intersection mask Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 58
Descending – Child Order • Depends on the ray’s direction • 8 different possibilities • Signs of the components of the ray’s direction vector Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 59
Descending – Child Order • Depends on the ray’s direction • 8 different possibilities • Signs of the components of the ray’s direction vector • Precompute table (direction, intersection mask) • Contains the next child’s number • Based on direction and remaining children • 8*256 entries Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 60
Descending – Fetch pointer • Figure out which pointer belongs to a certain child • Right side: fourth child (from right) • Depends on the number of present children preceding it Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 61
Descending – Fetch pointer • Figure out which pointer belongs to a certain child • Right side: fourth child (from right) • Depends on the number of present children preceding it • Mask with lower bits: lower = (1 << child. Number) - 1 • And with child mask: preceding = (child. Mask & lower) • Count set bits: pointer. Number = __popc(preceding) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 62
Ascending • If the intersection mask is zero, ascend • To ascend • Retrieve intersection mask from parent node on stack • If zero: continue ascending • If non-zero: continue to next child in the mask (Restore current node’s base index from the stack) Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 63
Last two levels • Upon descending to the second-to-last level • Fetch 2 x 32 bits leaf geometry bit masks • Reconstruct the 8 bit child mask for the current level • Compute intersection mask and “descend” into last-level child nodes • Last level • Extract the correct 8 bits of geometry • Compute intersection mask • If the mask is non-zero, the first child in the ray order is the intersection Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 64
Summary • DAGs behave a lot like trees when ray casting • Can’t have backwards links encoded into the structure • But otherwise don’t need to special case merged sub-trees • Many existing methods should work • Presented one option • Fairly well tested at this point • Code will be made available Voxel DAGs and Multiresolution Hierarchies: From Large-Scale Scenes to Pre-computed Shadows 65
- Dags chen
- Efficient sparse voxel octrees
- Efficient sparse voxel octrees
- Voxel-based morphometry for dummies
- Tc mpr
- Sparse voxel dag
- Mcd voxel
- Multiresolution image processing
- Multiresolution analysis in image processing
- Multiresolution
- Issues for goal hierarchies
- Issues for goal hierarchies
- Rich feature hierarchies
- Explicit memory psychology example
- Network software protocol hierarchies
- Preying mantra wangechi mutu
- Protocol hierarchies
- Why does juliet note that romeo’s lips are warm?
- Processing crime and incident scenes
- Goldilocks and the three bears chairs
- Sketch all serious crime and crash scenes
- Doctor faustus act 3
- Of mice and men scenes
- Scenes-and-frames semantics fillmore
- Romeo and juliet fate theme
- Romeo and juliet key scenes
- Romeo and juliet balcony scene summary
- Sketch of locality in crime scene
- How to paint underwater scene watercolor
- Macbeth act 1 scene 4-7 summary
- Passion of the christ deleted scenes
- Preface behind the scenes
- How does this scene prepare the reader for future scenes?
- Macbeth act 4 scene 1 themes
- Macbeth act 1 and 2 summary
- Hamlet key scenes
- Boyhood scenes from provincial life
- Act 3 macbeth translation
- Othello act summary
- Macbeth act 1 summary scenes 1-7
- Dense aspp
- What is laertes dying request of hamlet
- Son of god behind the scenes
- Gl scenes
- The abyss behind the scenes
- Sex scenes
- The man in the storm close reader answers
- One eyed assef
- Macbeth act 3, scene 1 summary
- Nigeria behind the scenes
- Doryphoros
- Christopher marlowe background
- Baptism scenes in literature
- Lord of the flies important scenes
- Red orange yellow green light blue blue purple pink
- And because i am happy and dance and sing
- West side story, romeo and juliet comparison chart
- Taller and younger shorter and older
- How to write 1 centavo
- Red orange yellow green blue purple pink
- Gabby and sydney bought some pens and pencils
- Young and dyslexic language and structure
- Us prior to brown map key
- West yorkshire health and care partnership
- Compression and rarefaction
- Compare and contrast spring and neap tides.