Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
GPU-based Procedural Placement
in Horizon...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Motivation
 Quick iterations
 Large var...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Real-Time Procedural Placement
 Started ...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Results
We use procedural placement for a...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Creating diversity
 Ecotope describes en...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Placing an Ecotope
 Create a believable ...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
WorldData
 Collection of 2D maps
 Strea...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Painted World Data
 Extensively Hand Pai...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
World Data List
Name Res Format
Height_Te...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Generated World Data
Topo_RoadsTopo_Objec...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Mulitple Height Layers
Height_Terrain
Nam...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
WorldData: Baked Maps
Erosion_Flow Erosio...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Density logic
 Artists have full control...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Placement_Trees
Topo_Objects
Topo_Roads
T...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Ecotope Assets
Forest
Trees
Bushes
Underg...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Forest
Trees
Bushes
Undergrowth
Lodgepole...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Production Logic
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Layer Based Placement
 Prepare our asset...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Step1: DENSITYMAP
 Single Layer
 Scalea...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Step2: GENERATE
 Discretizing step
 Dit...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Step2: GENERATE
 Discretizing step
 Res...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Generating the pattern
 Generation Tool
...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Step2: GENERATE
 One pattern per group
...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Step3: PLACEMENT
 Needs pattern idx/id f...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Pipeline overview
 Run pipeline for each...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Solving Collision
 Different footprint?
...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Layered DitheringDensity
1
0
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Layered DitheringDensity
1
0
 Layered de...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Layered Dithering
 DENSITYMAP overhead
...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Pipelining on GPU
 Instantiate pipeline ...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Pipelining on GPU
PIPELINE 0
PIPELINE 1
P...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Conclusion
 Procedural Placement is exte...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
User Screenshots
Proof of success:
Users ...
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
 Questions?
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
 Questions?
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
 Questions?
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
 Questions?
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
Questions?
jaap.vanmuijden@guerrilla-game...
GPU-Based Procedural Placement in Horizon Zero Dawn
GPU-Based Procedural Placement in Horizon Zero Dawn
GPU-Based Procedural Placement in Horizon Zero Dawn
GPU-Based Procedural Placement in Horizon Zero Dawn
Upcoming SlideShare
Loading in …5
×

GPU-Based Procedural Placement in Horizon Zero Dawn

87,867 views

Published on

Download the original PowerPoint presentation here: http://www.guerrilla-games.com/read/gpu-based-procedural-placement-in-horizon-zero-dawn

Jaap van Muijden describes the GPU based procedural placement system that dynamically creates the world of 'Horizon Zero Dawn' around the player. Not limited to just rocks and trees, the procedural system assembles fully-fledged environments while the player walks through them, complete with sounds, effects, wildlife and game-play elements. Van Muijden shows the entire pipeline, from the graph editor where artists can define the procedural placement rules to the GPU algorithms that create a dense world around the player on the fly. He demonstrates the power of this procedural approach by showing how painting in a tree line and redirecting roads can be just as easy as moving mountains and changing a desert into a tropical swamp.

Published in: Software

GPU-Based Procedural Placement in Horizon Zero Dawn

  1. 1. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 GPU-based Procedural Placement in Horizon Zero Dawn Jaap van Muijden Senior Tech Programmer Guerrilla Games jaap.vanmuijden@guerrilla-games.com
  2. 2. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Motivation  Quick iterations  Large variety  Believable look  Art Directable  Data driven  Deterministic  Locally stable
  3. 3. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Real-Time Procedural Placement  Started traditional CPU  Moved to GPU based  Real-Time Placement  Density Based Placement
  4. 4. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Results We use procedural placement for all nature!  500+ asset types  100.000+ objects in scene  ~250µs avg busy load on GPU
  5. 5. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Creating diversity  Ecotope describes environment  Ecotopes determine:  Asset types  Asset distribution  Colorization  Weather  Effects  Sound  Wildlife
  6. 6. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Placing an Ecotope  Create a believable world  Artists have full control  The Placement Data,  The Placement Logic  Hand authored Assets
  7. 7. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 WorldData  Collection of 2D maps  Streamed in sections  All Generated  All Paintable  ~4MB/km2 exclusively
  8. 8. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Painted World Data  Extensively Hand Painted  Decoding Logic Placement_Trees Density Map Value 10 Inner Forest Forest Edge Sparse Trees 1 Inner Trees Edge Trees Density Map Value 10 1
  9. 9. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 World Data List Name Res Format Height_Terrain 0.5 m 16 bit Height_Objects 0.5 m 16 bit Height_Water 0.5 m BC6U Variance_Trees_Bush 2.0 m BC7 Variance_UnderGrowth_Stealth 2.0 m BC7 Variance_RockColor 1.0 m BC7 Variance_Foliage_Color 1.0 m BC7 Variance_Lichen_Density 1.0 m BC7 Erosion_Wear 0.5 m BC7 Erosion_Flow 0.5 m BC7 Erosion_Deposition 0.5 m BC7 Terrain_Cavity 0.5 m BC7 Water_Flow 0.5 m BC7 RGB Water_Vorticity 0.5 m BC7 Name Res Format Placement_Trees 1.0 m BC7 Placement_BlockBush 1.0 m BC7 Placement_Undergrowth 1.0 m BC7 Placement_StealthPlants 1.0 m BC7 Placement_PickUps 2.0 m BC7 Placement_Natural_Resources 2.0 m BC7 Region_Destructibility 2.0 m BC7 Region_Activity_Space 2.0 m BC7 Topo_Roads 0.5 m BC7 Topo_Water 0.5 m BC7 Topo_Objects 0.5 m BC7 Ecotope_Effect 0.5 m BC7 Ecotopes A-H 2.0 m BC7
  10. 10. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Generated World Data Topo_RoadsTopo_Objects
  11. 11. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Mulitple Height Layers Height_Terrain Name Res Format Height_Terrain 0.5 m 16 bit Height_Objects 0.5 m 16 bit Height_Water 0.5 m BC6U
  12. 12. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 WorldData: Baked Maps Erosion_Flow Erosion_Deposition
  13. 13. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Density logic  Artists have full control  Hand authored assets  The Placement Data  The Placement Logic
  14. 14. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Placement_Trees Topo_Objects Topo_Roads Topo_Water Result
  15. 15. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Ecotope Assets Forest Trees Bushes Undergrowth Lodgepole Pine Douglas Fir Grease Wood Carex (Grass) Paysons Sedge Fern 3.0 1.0 1.0 6.0 6.0 1.0
  16. 16. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Forest Trees Bushes Undergrowth Lodgepole Pine Douglas Fir Grease Wood Carex (Grass) Paysons Sedge Fern 3.0 1.0 1.0 6.0 6.0 1.0 Ecotope Assets Placement_Trees Clearing Inverse
  17. 17. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Production Logic
  18. 18. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Layer Based Placement  Prepare our assets 1. Flatten graph into Layers 2. Compile intermediate form 3. Optimize and Merge layers Evaluate Discretize Density Map WORLDDATA OBJECTSLAYER
  19. 19. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Step1: DENSITYMAP  Single Layer  Scaleable granularity  Mipmapped World Data Discretize Density Map Texture WORLDDATA OBJECTSLAYER DENSITYMAP
  20. 20. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Step2: GENERATE  Discretizing step  Dither based  Responsible for collision DENSITYMAP Density Map Texture WORLDDATA LAYER OBJECTSGENERATE
  21. 21. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Step2: GENERATE  Discretizing step  Resonsible for collision  Dither based
  22. 22. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Generating the pattern  Generation Tool  Rules to follow:  Even spread thresholds  Maximize 2D distance  Uniform 2D distance w  Scale to w = footprint
  23. 23. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
  24. 24. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Step2: GENERATE  One pattern per group  One sample per thread 1. Range Test 2. Threshold Test 3. Position generate 4. Normal construction 5. Stage to buffer ~10µs, VGPR: 28, SGPR: 64, Cycles: 342 WaveFront 0 & 1 TCO=34,12 WaveFront 1 & 2 TCO=35,12 WaveFront 5 & 6 TCO=34,13
  25. 25. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Step3: PLACEMENT  Needs pattern idx/id for RNG  Basis generation  Bounding box generation ~7µs, VGPR: 28, SGPR: 40, Cycles: 347 DENSITYMAP GENERATE Density Map Texture WORLDDATA PLACEMENTLAYER OBJECTS PointCloud (normal,pos)
  26. 26. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Pipeline overview  Run pipeline for each layer  Independently discretizing  Collision? DENSITYMAP GENERATE Density Map Texture WORLDDATA Init Copy PointCloud (normal,pos) PLACEMENT PointCloud (Mat3x4) CPU memory
  27. 27. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Solving Collision  Different footprint?  Read-back, dependencies   Same footprint?  Layered Dithering 
  28. 28. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Layered DitheringDensity 1 0
  29. 29. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Layered DitheringDensity 1 0  Layered density maps  Two values in density map  Two-Sided threshold test Density 1 0 Density 1 0 Density 1 0 Density 1 0
  30. 30. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Layered Dithering  DENSITYMAP overhead  Independent eval  Might need DENSITYMAP for non-placing layers  More work, but No Flushes  Sparse placement causes dependency overhead  Use ordering heuristics to reduce DENSITYMAP/GENERATE DENSITYMAP GENERATE Density Map Texture (float2) WORLDDATA Init Copy PointCloud (normal,pos) PLACEMENT PointCloud (Mat3x4) CPU memory DENSITYMAP DENSITYMAP WORLDDATA WORLDDATA
  31. 31. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Pipelining on GPU  Instantiate pipeline 64 times  Each pipeline has multiple DENSITYMAP  Each pipeline emits one layer  Lots of unnecessary flushes within pipeline PIPELINE 0 GENERATE Density Map Texture Init Copy PointCloud (normal,pos) PLACEMENT PointCloud (Mat3x4) CPU N X DENSITYMAP PIPELINE 64 GENERATE Density Map Texture Copy PointCloud (normal,pos) PLACEMENT PointCloud (Mat3x4) CPU N X DENSITYMAP ...
  32. 32. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Pipelining on GPU PIPELINE 0 PIPELINE 1 PIPELINE 16 PIPELINE 2 DENSITYMAP GENERATE PLACEMENT PLACEMENT PLACEMENT SYNC PLACEMENT INIT ALLOC COPY SYNC SYNC GENERATE GENERATE GENERATE DENSITYMAP DENSITYMAP DENSITYMAP ... ... ... ...
  33. 33. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Conclusion  Procedural Placement is extensively used  Good visual quality  Suitable for art direction  Unpolished areas in shippable quality  250µs avg. busy load  Powerful tool in making natural worlds  Nature assets created by 3 people  Ecotopes made by 1 person
  34. 34. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 User Screenshots Proof of success: Users are making screenshots of our output!
  35. 35. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017  Questions?
  36. 36. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017  Questions?
  37. 37. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017  Questions?
  38. 38. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017  Questions?
  39. 39. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017
  40. 40. GPU-based Procedural Placement in Horizon Zero Dawn – Guerrilla Games - GDC 2017 Questions? jaap.vanmuijden@guerrilla-games.com

×