Upload
element3260
View
217
Download
0
Embed Size (px)
Citation preview
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 1/105
Simulation and Rendering MassiveSimulation and Rendering Massive
Creatures on GPU
Creatures on GPU
Christopher Oat
Natal a Tatarchuk
AMD Graphics Products Group
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 2/105
•o va on
• Crowd movement simulation on GPU
– Global and local navigation and avoidance
•
• Crowd rendering and scene management on
• Conclusions
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 3/105
• ur as s o pus e enve ope
for interactive visual experience
“ –
interactive experiences?”
• Be ond ust the rett face
– We know we can do that… We’ve
done it!
– Can we make them think?
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 4/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 5/105
• a ng e gamep ay more un: game s a
series of choices...
– It helps when choices are interesting!
• Artificial intelligence is ubiquitous in currentgames
– Non- la er and la er characters re uire a form of AI
– Path finding, obstacle avoidance, decisions, etc.
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 6/105
• can spen > me on pa n ng
computations alone in games
– Limits possible decision complexity
– Thus we frequently see “zombie-like” NPCs
– Gameplay suffers
• many characters
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
–
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 7/105
• oa : mu a e an ren er mass ve crow s omu a e an ren er mass ve crow s o
characters on GPU at a scale that's bothcharacters on GPU at a scale that's both
rea a ng an c a eng ngrea a ng an c a eng ng
• Direct3D® 10.1
• Tessellation
• HD resolution and HDR rendering
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 8/105
• ynam c pa n ng compu a ons on
• Massive crowd rendering with LOD management
• Tessellation for high quality close-ups and stable performance
• HDR lighting and post-processing effects with-
• Terrain system
-
• Advanced global illumination system
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 9/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 10/105
• o va on
• Crowd movement simulation on GPU
– Global and local navigation and avoidance
•
• Crowd rendering and scene management on
• Conclusions
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 11/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 12/105
D namic and En a in WorldD namic and En a in WorldThrough AIThrough AI
• om ne g o a pa n ng w
local avoidance and individual
• Crowd movement is more stable
and realistic solved on a lobal scale
– Crowd dynamics similar to fluids
– A ents “flow” towards the closest oal
along the path of least resistance
– Froblins follow correct paths and do not “get stuck”
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 13/105
• Based on Continuum Crowds [TCP06]• Convert motion lannin into an o timization
problem
–
– Computational algorithms from optics
• Smooth flow-like crowd movement
– Con estion avoidance and emer ent behavior
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 14/105
ndnd
aa computational iterative approach (eikonalcomputational iterative approach (eikonalsolver solver))
– – RepresentRepresent environment as a costenvironment as a cost fieldfield
– – rougroug scre za on o e e ona equa onscre za on o e e ona equa on
•• A licable A licable to man eneral al orithms andto man eneral al orithms and
areasareas
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 15/105
Example PathsExample Paths
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 16/105
• o ve or trave t me as a unct on o potent a• Potential = inte rated cost F alon shortest
path to goal
= – o ow nega ve gra en
• Set potential = 0 at goal, eikonal equation
elsewhere
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 17/105
Eikonal Solver via Fast MarchinEikonal Solver via Fast MarchinMethodMethod
• mu a es s ra s s or es pa a gor m
• A finite difference approximation to the continuous
eikonal equation
– Start from known otential =0 at oal and ro a ate to
neighbors until convergence
– Compute potential for neighbor cells based on known cells
• Serial algorithm; requires an ordered data structure
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 18/105
• s ng as era ve e o
• Use upwind finite difference approximation but no ordered
a a s ruc ures
• We use small grid resolutions (1282
-2562
)• Solve for four goals at once
– Taking advantage of vectorization – use RGBA FP16 texture
• Convergence determined empirically
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 19/105
• on nuum o e mo e s env ronmen as a
positive cost function
– Can’t be zero otherwise agents would move at infinite
speed; add some small base amount• Incorporate information about terrain and
obstacles (static and dynamic)
– Splat dynamic obstacles, including agents into the cost
function
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 20/105
=+ +
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 21/105
•
– Performance & No need to avoid agent far away
• p ate ve oc ty ase on pos t ons an ve oc t es
of nearby agents/obstacles – Based on Velocity Obstacle formulation [Fiorini and
Shiller 1998]
– See course notes for more details & Jeremy Shopf’stalk on in Beyond Programmable Shading: In Action
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 22/105
• Evaluate a fixed set of possible directions
relative to global navigation direction
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 23/105
• Need to query nearby agent positions and
velocities
• Spatial data structure
“ ”
– Bin Counter : Color buffer
– Bin Array : Depth Buffer Array
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 24/105
Agent Positions Bin Counter Bin Array
2
3
51
0 1 0 0
1 0 0 1
0 0 0 1
3
1 5
26
4 0 0 0 26
4
• or space pos t on mappe to n ex
• Bin Counter: color buffer, tracks bin loads
• ID Array: depth array, binned agent IDs
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 25/105
Agent Positions Bin Counter Bin Array
0 1 0 0
1 0 0 1
0 0 0 1
3
1 5
2
0 0 0 26
4
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 26/105
Agent Positions Bin Counter Bin Array
0 1 0 0
1 0 0 1
0 0 0 1
3
1 5
2
•
0 0 0 26
4
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 27/105
Agent Positions Bin Counter Bin Array
0 1 0 0
1 0 0 1
0 0 0 1
3
1 5
2
•
0 0 0 26
4
• Fetch load from Bin Counter (color buffer)
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 28/105
Agent Positions Bin Counter Bin Array
0 1 0 0
1 0 0 1
0 0 0 1
3
1 5
2
•
0 0 0 26
4
• Fetch load from Bin Counter (color buffer)
• Fetch agent IDs from Bin Array (depth array)
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
–
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 29/105
3 0 1 0 0 3
64
2
51 1 0 0 1
0 0 0 10 0 0 2
6
1 5
24
• Binning is a multi-pass algorithm
– Once binned, agents removed from working set
– Algorithm repeats until working set is empty
– Overflow is ossible & detectable
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 30/105
• Initialize data structure –
– Clear bin array (depth array) to MAX_DEPTH
– Working set is array of all agent IDs
• No VB necessar
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 31/105
• n n coun er rs s ce o n array
• Draw working set as point primitives
• Vertex shader:
–
– Set point’s depth to normalized agent ID
• Pixel shader: output “1”
• Depth test: LESS_THAN
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 32/105
……
• ex s ce o n array oun as ep u er
• VS: Sample ID from previous slice of bin array
– Reject points less than or equal to previous
• -
• PS: write pass number
• Depth test: LESS_THAN
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 33/105
....
• ’
been binned get streamed-out and rasterized
• ept test ensures t e po nt w t owest
gets binned• Results in points binned in sorted order
–
• Stream-out buffer becomes new working set
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 34/105
• We want to halt the algorithm once all points
are binned
– Do not query size of stream out buffer each pass
–
• Would like to hand the whole thing off to the
o con ro execu on
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 35/105
– Number of bin array slices
• Make all the draw calls for the max number
of iterations – Use cascading predicated draw calls
“ ” – raw u o
– Predicate on number of stream-out elements
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 36/105
• GPU terminates algorithm once all agents
are binned
– Once working set (stream out buffer) goes to 0
–
• The algorithm either terminates or overflows
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 37/105
•
– Efficient queries
• Early-out on empty bins, known bin load, sorted order
– Overflow detection – Stream-out reduction of working set
–
• Many applications beyond local avoidance
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 38/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 39/105
d
– Dominant directional light color: Lc
• Left over residual lighting environment: Le
• s
• Surface normal: N
( ) ),SH_Eval(**0,max escd L N V L L N +⋅
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 40/105
• Dynamic characters cast shadows on terrain
– Shadow map shadows mingle with SHLM shadows
–
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 41/105
• Results in double shadows…
– Characters in shadow still cast shadows
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 42/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 43/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 44/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 45/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 46/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 47/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 48/105
Detectin Direct Sun Li ht
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 49/105
• Shadow map only used on non-occluded
regions of terrain
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 50/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission. All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 51/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 52/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 53/105
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 54/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 55/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 56/105
• o va on
• Crowd movement simulation on GPU
– Global and local navigation and avoidance
•
• Crowd rendering and scene management on
• Conclusions
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 57/105
• Don’t want to render thousands million-poly
c arac ers
– Wasteful if details are unseen
• CPU side character management is impractical
when doing GPU simulation
– Requires a read-back
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
–
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 58/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission. All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 59/105
• e use rec . ea ures or scene
management and level of detail management
• Render froblins as an army of instanced
characters• 3 discrete LODs
• Use tessellation to get maximum amount of details with stable performance for close-ups
All slides © 2008 Advanced Micro Devices, Inc. Used with permission. All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 60/105
• Act on instances
• A set of oint rimitives instance data as
input
-
– Discard the rest
– Use DrawAuto for multiple tests or combine into asingle GS invocation for efficiency
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 61/105
. en er e occ u er geome ry
2. Construct the Hi-Z map
3. Run all characters through the view frustum
cullin filter
4. Results are run through the occlusion culling
. Run through a series of LOD selection filters6. Render each LOD
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 62/105
• s ng e er ng per orm v ew rus um
culling
– Using standard methods
• VS checks for intersection between character bounding volume and the view frustum
– Re ular methods a l
• If the test passes, the character is visible: emit it
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
– erw se s cu e
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 63/105
• Render all occluders prior to rendering
characters
• Determine which characters are occluded by
– Use resulting depth buffer
–Cull against arbitrary, dynamic occluders
• Novel formulation: Hi-Z map
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 64/105
--
• A hierarchical depth image
– Uses the Z buffer information
• A mip-mapped, screen-resolution image
– ac exe a eve = max a exe s a eve -
• Does not require a separate depth pass
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 65/105
--
-
• Examine the depth information for pixels covered
by the object’s projected bounding sphere
– Compare the max fetch depth to the projected depth of
the point on the sphere closest to the camera
• Conservative culling
– Does not result in false culling
•
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 66/105
--
–
– DepthStencil view (with MS DB in Direct3D® 10.1)
• Generate the mip chain levels with reduction
– Mind the dimensions – screen-space images don’t
– Use integer operations to avoid incorrect indexing
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 67/105
--
• Render into one mip level while sampling the
previous level
– Rendering into smaller mip reducing the larger one
• value
• Fetch additional texels on the odd-sizedboundary
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 68/105
• Use a discrete LOD scheme
– Each LOD is selected by character’s distance to
camera
• – Separate the characters into three disjoint sets
– LOD parameters easily specified for each set
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 69/105
• ompu e se ec on pos cu ng
– Only process visible characters
– Culling results are only computed once and re-used
• Render closest LOD usin tessellation and displacement
• Simplified geometry and shaders for furthest LOD
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 70/105
• ee ns ance coun or ssu ng e raw ca or
each LOD
• This requires a stream out stats query
– Can cause significant stall when results are used in thesame frame issuing the query
• Re-or anize the draw-calls to fill the a between
issuing the query and using the results –
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 71/105
• ra ona y ma r x pa e es are compu e on e
CPU per character
– Loaded into constant store
• Limitations on the number of characters handled inone draw-call with this approach
– Lar e crowds of characters re uire numerous draw calls
• GPU character management makes this tricky
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 72/105
• Agents have a set number of actions with
associated animation sequence
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 73/105
• t preprocess ng t me, a e an mat on ata
into texture arrays
– Slice number = animation sequence
–
• At rendering time, determine per-instance
animation sequence index and time offset – Durin simulation in our case
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 74/105
• amp e an nterpo ate an mat on ata
when rendering the character
– Sample the animation textures
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 75/105
• preprocess ng, a en e rans orm erarc y
• Compute bone transforms for each key frame
transforming that bone into object space
• Durin simulation assi n an animation se uenceto each character
–
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 76/105
…
→…
Matrix Row 0Bone 1
Matrix Row 2
Matrix Row 0
Matrix Row 1
Matrix Row 2
Bone 2
↓
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 77/105
• ur ng ren er ng e c es, n erpo a es, an
blends the key frames for each bone
– Using per-character information
• skinning in object space
• Transforms the result using its positionand orientation
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 78/105
• om ne w rec ns anc ng suppor
• Render using interpolative planar tessellation
– Fast evaluation
– -
• Control tessellation level per-draw call
– Use character location
• The same art assets as conventional rendering
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 79/105
• esse a on re uces memory oo pr n an
bandwidth
– Only store low resolution mesh
– Polygons Total Memory
Low resolution 5160 polygons VB/IB: 100K
Froblin model 2K x 2K 16 bit displacement map: 10MB
ZBrush High res
Froblin model
>15M polygons ~270MB VB and 180MB IB storage
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 80/105
• Scalability
• Stable and redictable erformance
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
Tessellation Performance AnalysisTessellation Performance Analysis
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 81/105
Fa ra w a yv iew
Close-u p
v iew
Render ing
Mode
Num faces :
ATIATI ATIATI ATIATI ATIATIRadeonRadeonHD 4870HD 4870
RadeonRadeonHD 2900 XTHD 2900 XT
RadeonRadeonHD 4870HD 4870
RadeonRadeonHD 2900 XTHD 2900 XT
Original l o w r e s 4,050852 fps852 fps 359 fps359 fps 850 fps850 fps 275275
NT = 411 x NL
Con t inuous lytesse l la tedmesh N
1.6 M triangles 232 fps232 fps 143 fps143 fps 213 fps213 fps 101101
Adap t i ve lytesse l la ted
mesh NA
Dynamic,1.6M > NA >4K triangles
845 fps845 fps 356 fps356 fps 574574 fpsfps 207207
*Configuration: AMD reference platform with AMD Athlon™ 64 X2 Dual-Core Processor 4600+, 2.40GHz, 2GB RAM.
Motherboard: ASUSTek M2R32-MVP. Memory: DDR2-800 400 MHz.
Operating System: Windows Vista® SP1.” All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
Tessellation Pre Direct3D® 11Tessellation Pre Direct3D® 11
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 82/105
•
– Supported on XboxTM
360 – a eon er es an eyon : suppor e
on all models
• Subset of Direct3D® 11 tessellation features
• Contact AMD ATI developer relations for detailson accessing tessellation
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
Preview and Prepare for Preview and Prepare for
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 83/105
Direct3D® 11Direct3D® 11•
for this feature
– Su ort on Microsoft® Windows® XP as well as Microsoft®
Windows® Vista
– PC versions can use XboxTM 360 native features
– Reach more players
• Developing artwork takes time
– Integrating tessellation early gives you and your artists time todesign and polish
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 84/105
Tessellator
Evaluatesurface
AddSuper Super--primprim
MeshMeshTessellated andDisplaced Mesh
TessellatedTessellated
MeshMesh
displacement
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
DisplacementDisplacement
MapMap
Combinin Normal Ma s andCombinin Normal Ma s and
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 85/105
Displacement MapsDisplacement Maps
• As we displace, we change the actual
displayed normal
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 86/105
se norma maps even w
displacement
• Generate displacement and normal maps
usin the same tan ent s ace – The same TS computations for preprocessing
– e norma enco e n norma map w ma c
the normal from displacement
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
Regularly drawn Froblin
N t ll ti d
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 87/105
No tessellation used
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
High Detail Froblin with
Di l t M i
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 88/105
Displacement Mapping
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
Froblin Close-up:
No tessellation
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 89/105
No tessellation
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
Froblin With Tessellation
Close up
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 90/105
Close-up
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 91/105
• ynam c num er o e a e c arac ers n v ew
– Simulation changes interactively, no a priori control
• Need stable frame rate in dense crowd
simulations
• Compute tessellation level as a function of
– Avoid polygonal count explosion
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 92/105
l = c amp max , , max
• N characters rendered with tessellation
• Bound the number of amplified triangles
• r m ve coun never excee s an e cosof M fully tessellated characters
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 93/105
transformation on control cage
Pass 1: Control
cage animation
n a pre-pass
– Allows for more complex per-
Stream Out Buffer Stream Out Buffer
vertex operations
• Pass 2:
(de)compression for reducingTessellate the
control cage
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 94/105
• Shader-based vertex compression /
decom ression
• Reduce stream out memory footprint
e ween e pre-pass an esse a epass
• Reduce fetch bandwidth for tessellated
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 95/105
• Pack transformed vertex positions into
128 bit format
–Lets us load each vertex with one fetch
–Gives as much as 30% speedup
–
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 96/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission. All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 97/105
**
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 98/105
– From 900 polygons -> 6K -> 1.6M at the closest tessellated level of details
– Up to 18M triangles per frame at fast interactive rates
– 6M-8M triangles on average at 20-25 fps
• – Rendering all objects into multiple shadow maps more than doubles
polygon count per frame
• en er ng an s mu a ng g qua y e a e ro ns
at 21 fps on average
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
*Configuration: AMD reference platform with AMD Athlon™ 64 X2 Dual-Core Processor 4600+, 2.40GHz, 2GB RAM.
GPU: ATI Radeon™ HD 4870 Grahpics. Motherboard: ASUSTekM2R32-MVP. Memory: DDR2-800 400 MHz.
Operating System: Windows Vista® SP1.”
**
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 99/105
• mo es ren er w an pos -
processing• mu a e e av or an ren er agen s a ps
• AI simulation for 65K agents alone – 45 fps
• Rendering and simulating 65K agents – 31 fps
• Rendering 9,800,000 polygons each frame
• AI simulation executes with high efficiency resulting in~1 teraflops!
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
*Configuration: AMD reference platform with AMD Athlon™ 64 X2 Dual-Core Processor 4600+, 2.40GHz, 2GB RAM.
GPU: ATI Radeon™ HD 4870 Grahpics. Motherboard: ASUSTekM2R32-MVP. Memory: DDR2-800 400 MHz.
Operating System: Windows Vista® SP1.”
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 100/105
• rac ca an e c en s mu a on an ren er ng o
large crowds of characters on GPU• New GPU algorithms for
– Global and local navigation and spatial data structures
– Scene management
–
• And a number of other advanced techniques!
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 101/105
• All shaders are included in the course notes
• Course notes are available for download:
– ACM Digital Library: http://portal.acm.org/dl.cfm
– rap cs ec n ca u ca ons we page:http://ati.amd.com/developer/techreports.html
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 102/105
Chain unChain unx genx gen
StudiosStudiosegor m cegor m c
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 103/105
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 104/105
• REUILLE, ., OOPER, ., AND OPOVI , . . on nuum
Crowds. ACM Trans. Graph. 25, 3 (Jul. 2006), pp. 1160-1168, Boston,
MA.
• [JEONGWHITAKER07B] JEONG, W.-K, AND WHITAKER, R.T. 2007. A Fast
Iterative Method for a Class of Hamilton-Jacobi Equations on Parallel
S stems. Universit of Utah School of Com utin Technical Re ort
UUCS-07-010.
• [T ATARCHUK08] T ATARCHUK, N. 2008. Advanced Topics in GPU
Tessellation: Algorithms and Lessons Learned. Presentation.
Gamefest 2008, Seattle, WA, July 2008.
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
8/2/2019 Oat Tatarchuk Froblins(Siggraph2008)
http://slidepdf.com/reader/full/oat-tatarchuk-froblinssiggraph2008 105/105
Tradem ark A t t r i bu t i on
AMD, the AMD Arrow logo, AMD Opteron, AMD Athlon, AMD Turion, AMD Phenom, ATI, the ATI, , , ,
Inc. Microsoft, Windows, and Windows Vista are registered trademarks of Microsoft Corporation
in the United States and/or other jurisdictions. Other names are for identification purposesonly and may be trademarks of their respective owners.
All slides © 2008 Advanced Micro Devices, Inc. Used with permission.
©2008 Advanced Micro Devices, Inc. All rights reserved.