270 likes | 627 Views
Fast Hydraulic Erosion Simulation and Visualization on GPU. Xing Mei 1 Philippe Decaudin 2 Bao-Gang Hu 1 1. CASIA (China) 2. INRIA (France) . Pacific Graphics’07. Outline. Introduction Hydraulic Erosion Existing Methods Hydraulic Erosion on GPU Method Overview Simulation Steps
E N D
Fast Hydraulic Erosion Simulation and Visualization on GPU Xing Mei1Philippe Decaudin2Bao-Gang Hu1 1. CASIA (China) 2. INRIA (France) Pacific Graphics’07
Outline • Introduction • Hydraulic Erosion • Existing Methods • Hydraulic Erosion on GPU • Method Overview • Simulation Steps • Multi-pass Implementation on GPU • Results • Conclusion & Future Work
Introduction- Hydraulic Erosion • Process Water flow takes away (dissolves) the soil and relocates (deposits) it somewhere else • Effect Changes terrain appearance Creates interesting geo-morphological structures Eroded landscape on Maui Island Gullies
Introduction- Erosion Simulation (Why?) • Enhance realism • A useful complement to fluid simulation Topographical changes affect the water flow [Chiba’98] [Beneš’06]
Introduction- Existing Methods • Procedural [Kelly’88, Prusinkiewicz’93] • Ad hoc rules with fractal terrain generation • Fast and efficient; No water flow involved Limited control on the erosion results • Physically Based Simulation [Musgrave’89, Chiba’98, Neidhold’05…] • Simulation on already-existing terrains • Controllable Erosion Process, but computationally expensive 4 fps on 256x256 grids [Neidhold’05] 5 fps on 300x300 grids [Beneš’07] Limited for interactive applications
Erosion on GPU- Motivation • A novel hydraulic erosion simulation method • Effective produces the important features in the erosion process Gullies, water catchments, deposited sediment… • Efficient Well mapped to GPU Interactive frame rates for large size terrains
Erosion on GPU- Method Overview • 5 steps in one cycle of the simulation (1) Water Increment (2) Water Movement (flow simulation) water (3) Erosion or Deposition (4) Sediment Transportation Rainfall & River Source (5) Evaporation Water Movement Erosion Evaporation Terrain Sediment Transportation Catchment Deposition Deposited Sediment
Erosion on GPU- Data Structure • Layers of 2D arrays • Each step should update the cell data in parallel No scattering operations on the data array involved cell Suspended Sediment Outflow flux Velocity Water Height - Terrain Height - Arrays cell
Erosion on GPU(1)Water Increment • Two kinds of sources River sources – fixed location, radius, intensity Raindrops – random location, radius, intensity Water increment
Erosion on GPU(2) Water Movement (Flow Simulation) • Possible Models? • GPU friendly Grid-based methods > Lagrangian methods • Efficient Shallow water model > 3D Navier-Stokes Equation • Suitable for Erosion-Deposition Velocity field is necessary • Previous models on shallow water framework • Simplified Newtonian physics model [Neidhold’05] hard to parallelize • Kass&Miller’s implicit method [Beneš’07] many iterations over the grid, not efficient for large size terrain • Our choice The Virtual Pipe model [O’Brien’95]
Erosion on GPU(2) Water Movement (Flow Simulation) • Virtual Pipe Model • Water is exchanged between cells through virtual pipes • How much water exchanged through each pipe? Flux – accelerated by the hydrostatic pressure difference Two-Step Process Update Flux Update Water Height A simple explicit method P0 P0 P1 P2 Cell
Erosion on GPU(2) Water Movement (Flow Simulation) • Two “problems” about the original model Staggered grid water height (d) – cell center flux (F) – cell border 2. Non-negative water update A scaling back process scattering operations are involved Both are not GPU-friendly Cell
Erosion on GPU(2) Water Movement (Flow Simulation) Outflow flux • Adaptation to the original model • the outflow flux for each cell • Flux (F) and outflow flux (f) • Water height update (d) - send away the outflow flux - collect inflow flux from neighbours Inflow flux Cell(x,y)
Erosion on GPU(2) Water Movement (Flow Simulation) Outflow flux • Non-negative water update Inflow flux Cell omitted, strengthened condition a scaling factor K limiting the outflow flux
Erosion on GPU(2) Water Movement (Flow Simulation) • 3-step process • Update outflow flux • Update water height • Update (horizontal) velocity field From Flux (f) to Velocity (V) • No-Slip Boundaries set outflow flux to 0 for boundary cells • Limitation for time step Cell Boundary cell
Erosion on GPU(3) Erosion & Deposition • Sediment transport capacity Current suspended sediment • How to compute for each cell ? We adapt a classic model from soil science [Julien’85] Deposition Erosion
Erosion on GPU(4) Sediment Transportation • Suspended sediment (S) is advected by the velocity field • Many GPU-friendly schemes to solve the equation • Stable semi-Lagrangian method [Stam’99] • Upwind differencing scheme • More mass-conservative methods such as BFECC [Kim’05, Selle’07] (advection dominated, no diffusion considered)
Erosion on GPU- Multi-pass Implementation on GPU • General computation framework on GPU [Harris’03, Owens’07] To update a 2D array in parallel: • Multi-pass process pack datainto textures draw a screen-aligned quad update texture in pixel shader Simulation (1) Water Increment Outflow (2) Flow Simulation Water Height Initialization Visualization Velocity (3)Erosion-Deposition VS: Vertex Texture PS: Phong Lighting (4) Sediment transport (5) Evaporation
Results • Platform: Pentium IV 2.4GHz + 2Gb RAM + Nvidia 8800 GTX 512x512 grids for video demos water suspended sediment in the flow deposited sediment Video “PG scene” in the rain
Results • Deposited sediment in a basin The bottom of the basin is flattened by the deposited sediment Video
Results • River flow in a drained channel Part of the original river bank get eroded Video
Results • Mountain scene eroded by rainfall Video
Results • Final example: the combination of the rainfall and the river source Video
Results • Performance results for the final example at different grid size 1 cycle = 1 simulation + 1 visualization Interactive frame rates for terrain up to 1024x1024!
Results • ST, VT, CT at different grid size ST : Simulation Time VT : Visualization Time CT : Cycle Time = ST+VT 1. ST, VT, CT scales well with grid size ~ linear with # of cells 2. VT takes more time for large size terrain 3. Further Improvements
Conclusion & Future Work • A novel simulation method for hydraulic erosion • Effective – proper model selection and adaptation for each step Produces dynamic erosion process and realistic results • Efficient - well designed for complete GPU implementation Interactive frame rates for large size terrain • Future work • Further improvements on models: Fluid solver - Limitation for time step Erosion Model - Little erosion on flat terrain • Extension to non-height-field scene (general 3D objects, structures with caves) • More erosion process – thermal weathering, wind erosion…
Thanks! More info on http://evasion.imag.fr/Publications/2007/MDH07/