Title: GPUbased Collision Detection for Deformable Parameterized Surfaces
1GPU-based Collision Detection for Deformable
Parameterized Surfaces
- Alexander Greb,
- Michael Guthe,
- Reinhard Klein
Eurographics 2006
2Outline
- Introduction
- Algorithm Overview
- AABB Tree Generation
- Hierarchy Traversal and Collision Test
- Extensions
- Results
3Introduction
- To detect collisions between rigid models,
hierarchy-based methods is most efficient and
accurate - Disadvantages
- For deformable model, the hierarchy must be
rebuild or updated every frame - Hierarchy generation or update process cannot be
used on GPU
4Introduction c.1
- Another solution is GPU-based nonhierarchical
screen-space approaches - Determine colliding or potentially colliding
objects - Disadvantages
- Accuracy is limited by current screen resolution
- Performance is not always superior to CPU-based
approaches
5Introduction c.2
- An efficient GPU-based hierarchical collision
detection for deformable models - A suitable representation for the BVH that can be
computed on GPU must be found - Use dynamic geometry images to represent the
geometry - Generate a quaternary bounding box hierarchy like
mipmap
6Introduction c.3
3D geometry
completely regular sampling
geometry image257 x 257 12 bits/channel
7Algorithm Overview
- AABB tree generation
- Build AABB trees for both geometry images
- Repeat this step every frame for dynamic geometry
images - Hierarchical traversal and collision test
- Visiting only those node pairs whose parent nodes
correspond to an overlapping AABB pair - A bread-first traversal scheme is used
8Algorithm Overview
- If a set of more than two objects has to be
checked for pairwise collision - First determine the pairs with overlapping
bounding box on CPU - Using grid or hash table
- AABB tree generation is only performed for those
objects whose bounding box overlap with any other
object
9AABB Tree Generation
- Represent AABB by two corners
- Min point and max point
- Given a geometry image of size ru x rv
- Store the leaf level of the AABB tree in a min
point and max point geometry image, each of size
(ru 1)x (rv 1)
10AABB Tree Generation c.1
- After setting up the AABB for the leaf level, the
rest of the hierarchy can be generated in a
button up manner - Build two mipmaps using minimum and maximum
filters - Can be implemented by a fragment shader
11Hierarchy Traversal and Collision Test
- Assume that the resolution of geometry images is
based on a common threshold - The AABBs of equal hierarchy levels in both AABB
trees are approximately of the same size - Skip first few levels, until 256 overlap tests
are performed - Hierarchy levels with less than 256 node pairs do
not provide enough parallelism to be productive
on GPU
12Hierarchy Traversal and Collision TestAABB
Overlap test
- Assume that the positions in the geometry images
are given in world space - Then these two AABBs overlap if and only if the
vector has no negative component
13Hierarchy Traversal
- Basic idea to process the AABB trees via a
breadth-first traversal in log2n steps - Only those pairs of AABBs have to be checked
whose parents have overlapping in the previous
step - Some references are required as additional input
14Hierarchy Traversal c.1
15Hierarchy Traversal c.2
- In each step of the traversal, the shader outputs
for every checked AABB pair - If overlap, reference to this AABB pair
- Otherwise a null reference
- We have to remove these null references from the
output stream - Non-uniform stream reduction
16Non-uniform stream reductionFirst Step
- Assume that the base level of this texture has
exactly the same size as the non-compacted stream - We set each entry of the base level to 0 if the
corresponding entry is null reference and to 1
otherwise - The other levels are constructed via standard
mipmap generation - Each node holds the percentage of non-null
elements
17Non-uniform stream reductionFirst Step c.1
18Non-uniform stream reductionSecond Step
- Construct the index list in form of additional
mipmaped 2D texture - Base level has the same size as the non-compacted
stream - For each entry of the non-compacted stream, store
an index of location where it will be stored in
the compacted stream - Define the index to be the number of non-null
elements that would be visited before the
respective entry during a depth-first traversal
of the mipmap hierarchy - Adding the index of the parent node to the number
of non-null elements visited after the parent and
before the current node
19Non-uniform stream reductionSecond Step c.1
20Non-uniform stream reductionSecond Step c.2
- Combine scattering pass with succeeding AABB
overlap test - Use vertex as well as fragment shader to perform
the scattering and overlap test simultaneously - For each point primitive (4x4 point sprite)
- Vertex shader reads an entry from the
non-compacted stream - If a null element, discard it
- Else determine the position of the point
primitive - Pass the stream element to fragment shader
- Perform overlap tests for 16 child AABB pairs of
this stream element
21Extensions
- Stenciled geometry images
- Positions in RGB channel, Stencil value in alpha
channel - Stencil value 1 a texel correspond to an
existing surface element - Self-collision
- Simply test one AABB tree against itself
22ExtensionsStencil geometry images
- Modification of the hierarchy generation
- At leaf level, the stencil value of an AABB is
set to 1 if all four surface vertices have the
stencil value 1 - Calculate the stencil value of an AABB in the
hierarchy as the maximum of the stencil values
from its corresponding child AABBs - Modification of the AABB overlap test
- Let fourth component of boxMin to be ½
23ExtensionsSelf-collision
- Simply test one AABB tree against itself
- Skip the AABB pairs (t0, t1) with t0 gt t1
- Skip t0 t1 at leaf level, at all other levels
we cannot skip these pair - There is possibility to reduce the number of
required AABB overlap tests - A surface can only self-intersect if either the
surface has a sufficiently high curvature - If there exists a vector that has a positive dot
product with the normal of every surface element
in this region -gt no potential self-collision
24ExtensionsSelf-collision c.1
- Modification of the hierarchy generation
- For leaf level, check the dot product of eight
predefined normal vectors - The result of these tests can be propagated to
the upper levels - Use four signed byte to store the results of the
normal test - Only need to calculate four dot products at leaf
level - Store the result (-1, 0, 1) in the corresponding
byte - These sign values are transferred to the higher
levels of the hierarchy as long as they are
identical for all four children and set to 0
otherwise
25ExtensionsSelf-collision c.2
- Modification of the AABB overlap test
- Perform additional test for those pairs of AABBs
(t0, t1) that are adjacent to each other or t0
t1 - For the four sign values, if any of them is not 0
and identical for both AABBs, the corresponding
surface region can have no self-collision and
need not be further traversed - Compare their texture coordinate (t0, t1) to
determine whether two AABBs are adjacent
26Results
- AMD Athlon-64 X2 4200, PCIe 16X with Geforce
7800 GTX - All tests use 32bit floating-point computation
on GPU and 32 bit float texture
27Results c.1