Simulation and Rendering of Real Time Breaking Waves

Simulation and Rendering of Real. Time Breaking Waves Adam Lake, David Reagin, John Van Drasek Intel Software Solutions Group (SSG) Modern Game Technologies Project 2/27/2005

“We arrive at the truth, not by the reason only, but also by the heart. ” -- Blaise Pascal Motivation • Great real-time results for deep ocean but what about close to shore? – Sum of Sines [Isidoro 02], [Finch 04] – Tessendorf, etc. [Tessendorf 01] • Little work on breaking waves in computer graphics! – Animation and Control of Breaking Waves [Mihalef 04] • Navier Stokes and store – None emphasize real-time breaking waves

Getting water right requires… • Geometry – Overall shape must be correct • Shading – Lighting and shading • Additional Geometry/Texture – Capillary waves, foam, etc. must be modeled

Goal: • Get the geometric solution to look right • Shading and additional geometry areas of future work – Good candidates for vertex and pixel shaders • If geometry is correct, not as important to interact with shading and lighting values

Basic Algorithm 3 passes over 2 D Grid: I. III. Deep Wave Simulation Shallow Wave Simulation Curling of Wave – – – Classify portions of waveform Modify shape based on this classification Curling breaks ‘height field’

Part I of III: Deep Ocean Simulation
![Deep Ocean Simulation • Based on Sum of Sines approach of [Finch 04], [Isodoro Deep Ocean Simulation • Based on Sum of Sines approach of [Finch 04], [Isodoro](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-7.jpg)
Deep Ocean Simulation • Based on Sum of Sines approach of [Finch 04], [Isodoro 02]: • Summation of N waves to simulate Ocean Surface (N==4 for us) – 4 good candidate for SSE optimization!! • x dependent upon wind direction, velocity, wavelength of wave
![Normal Generation… 2 techniques: 1. 2. Derivates as presented in [Finch 04] • • Normal Generation… 2 techniques: 1. 2. Derivates as presented in [Finch 04] • •](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-8.jpg)
Normal Generation… 2 techniques: 1. 2. Derivates as presented in [Finch 04] • • Good for GPU implementations Possible to make faster with trig lookup tables Compute face normals, then average • • Faster than Option 1 on CPU implementations Must use neighbor list to get performance – Brute force method was painfully slow!
![Wave Speed and Wavelength Relationship for Deep Ocean Waves Eqn. from [Garrison 02] Wave Speed and Wavelength Relationship for Deep Ocean Waves Eqn. from [Garrison 02]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-9.jpg)
Wave Speed and Wavelength Relationship for Deep Ocean Waves Eqn. from [Garrison 02]
![Wavelength to Velocity Relationship for Deep Waves Figure from [Garrison 02] Wavelength to Velocity Relationship for Deep Waves Figure from [Garrison 02]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-10.jpg)
Wavelength to Velocity Relationship for Deep Waves Figure from [Garrison 02]

Deep Ocean Wave Demo…

Nature vs. Your Next Big Hit • Even these functions are ‘on average’, many parameters can effect wavelength, velocity, direction, etc. • While in nature there are observed relationships…the model gives user control over surface parameters • Ignoring these relationships is fine to tune your deep ocean for your environment
![Threading [Lake 05] – Task Level Decomposition • Thread A: Simulated Game Workload • Threading [Lake 05] – Task Level Decomposition • Thread A: Simulated Game Workload •](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-13.jpg)
Threading [Lake 05] – Task Level Decomposition • Thread A: Simulated Game Workload • Thread B: Compute Wave

Performance with threading

Part II of III: Shallow Wave Simulation
![Breaking Waves Image from [Seafriends]. Breaking Waves Image from [Seafriends].](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-16.jpg)
Breaking Waves Image from [Seafriends].

Shallow Wave Observations • Same variables as deep wave – Wavelength, steepness, velocity, … • Wavelength – Decreases as we approach shore – Specifically, at a depth of ½ wavelength • Steepness – Increases as we approach shore • Fix velocity to maintain phase – Recall wavelength and speed are dependent – If you don’t do this waves will be incorrect • Adjust height – Attempt to preserve water column as it collapses

Shallow Wave Algorithm • • • Input: position, wavelength, steepness, position, distance to shore, sealevel, and distance to ocean floor as input: Output: New vertex position in shallow wave simulation For each point, 1. 2. 3. Determine Deep Ocean wave position from Section I. Based on this position: 1. Adjust wavelength 2. Adjust Steepness 3. Fix Velocity to Maintain phase 4. Adjust Height as it attempts to maintain water column 1. Wavelength varies linearly from lamba to ½ lambda in our example 1. In our example steepness varies from x to y in our demo 1. For velocity solve 1. Collapse of water column is what causes break Calculate new position using modified values as input to deep ocean simulation equation!
![Shallow wave speed and wavelength relationship Eqn. from [Garrison 02] Shallow wave speed and wavelength relationship Eqn. from [Garrison 02]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-19.jpg)
Shallow wave speed and wavelength relationship Eqn. from [Garrison 02]
![Shallow Waves demo! Image from [Seafriends 04] Shallow Waves demo! Image from [Seafriends 04]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-20.jpg)
Shallow Waves demo! Image from [Seafriends 04]

Part III of III: Breaking Waves!
![Breaking Waves Image from [Seafriends]. Breaking Waves Image from [Seafriends].](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-22.jpg)
Breaking Waves Image from [Seafriends].
![Types of Breaking Waves Image from [Mead 03] Types of Breaking Waves Image from [Mead 03]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-23.jpg)
Types of Breaking Waves Image from [Mead 03]
![Side view of breaking wave Image from [Miller 76] Side view of breaking wave Image from [Miller 76]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-24.jpg)
Side view of breaking wave Image from [Miller 76]
![Side view of breaking wave after collapse Image from [Miller 76] Side view of breaking wave after collapse Image from [Miller 76]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-25.jpg)
Side view of breaking wave after collapse Image from [Miller 76]

Breaking Waves • When waves reach a point that the wavelength is a factor of ~1/7 of waveheight, the wave breaks [Seafriends]. – Dependent on slope, composition, wind velocity, etc. • In our implementation, user can vary parameters
![The Vortex Image from [Mead 03]. The Vortex Image from [Mead 03].](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-27.jpg)
The Vortex Image from [Mead 03].

Vortex Ratio • Ratio of length to width in practice is often between 1. 73 and 4. 43 [Mead 03].
![Cubic form of vortex • Cubic form of Vortex is expressed as [Longuet-Higgins 82]: Cubic form of vortex • Cubic form of Vortex is expressed as [Longuet-Higgins 82]:](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-29.jpg)
Cubic form of vortex • Cubic form of Vortex is expressed as [Longuet-Higgins 82]: Note: Not actually needed for implementation!

Classification of surfing wave breaking Intensity

Breaking Algorithm • Input is positions from shallow wave simulation • Pass 3 of the algorithm: – Pass 1: deep wave – Pass 2: shallow wave – Pass 3: curling

Breaking Algorithm Overview • For every timestep t: – Move vortex forward as wave moves forward – For each vertex: • Classify based on type • Project point towards vortex based on type, height, and distance to ‘shoreline’
![Wave Breaking Algorithm • Classify vertex state: – [TOP, BACK, FRONT, FLAT] – Floating Wave Breaking Algorithm • Classify vertex state: – [TOP, BACK, FRONT, FLAT] – Floating](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-33.jpg)
Wave Breaking Algorithm • Classify vertex state: – [TOP, BACK, FRONT, FLAT] – Floating point gotchas, especially FLAT! TOP FRONT BACK BOTTOM
![So, how do we approximate this shape? Image from [Mead 03]. So, how do we approximate this shape? Image from [Mead 03].](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-34.jpg)
So, how do we approximate this shape? Image from [Mead 03].

Vortex Approximation • Using 2 D Circle as attractor: – Pulls vertices based on: • Distance from shore • Height from sealevel • Desired vortex shape – Sphere moves towards sealevel as we move into shore – Sphere decreases in size as we move toward shore

Image of Vortex Sizes, etc.

Wave Breaking Algorithm • Switch(vertex_state): – – – TOP or FRONT: 1. Obtain 2 D Circle Position: 2. To simulate Vortex, project towards circle based on vertex height • Midpoint between FRONT of back wave and BACK of front wave BACK: • Interpolate to remove gap • Nothing FLAT:
![Results [1/3] Only showing FRONT and TOP Results [1/3] Only showing FRONT and TOP](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-38.jpg)
Results [1/3] Only showing FRONT and TOP
![Results [2/3] Results [2/3]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-39.jpg)
Results [2/3]
![Results [3/3] Results [3/3]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-40.jpg)
Results [3/3]

Breaking Wave Demo!

Areas of Future Work • Work in Progress • Lighting and shading – Foam • Interaction with outside environment – Modify ocean floor • Ready but not complete • Model is not restricted to waves coming in straight on…demonstrate this • Stage IV: In the surf…

Acknowledgements • Kim Pallister and Pete Baker for giving the resources and time to work on this project. • Jacob Anderson (jwa@beyondordinary. com) at Beyond Ordinary Software Solutions for useful pointers and early discussion. • Discussions with Dean Macri on vortex simulation. • Useful discussions with: Stephen Junkins, Allen Hux, Kim Pallister, William Hachfeld@SGI. • Allison Knowles for title, poster, and acknowledgement photographs.
![References [1 of 2] • • • [Black 98] Black, K. P. , J. References [1 of 2] • • • [Black 98] Black, K. P. , J.](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-44.jpg)
References [1 of 2] • • • [Black 98] Black, K. P. , J. A. Hutt & S. T. Mead, 1998. Narrowneck Reef Report 2: Surfing Aspects. Technical Report prepared for the Gold Coast City Council, June, 1998. [Cohen 98] Aaron Cohen and Mike Woodring. Win 32 Multithreaded Programming. O’Reilly and Associates. 1998. [Gomez 00] Miguel Gomez. Interactive Simulation of Water Surfaces. Game Programming Gems 1. Edited by Mark Deloura. Pages 187 -194. [Finch 04] Mark Finch. Effective Water Simulation from Physical Models. GPU Gems: Programming Techniques, Tips, and Tricks for Real-Time Graphics. Edited by Randima Fernando. Pages 5 -29. 2004. [Garrison 02] Tom Garrison. Oceanography: An Invitation to Marine Science. Wadsworth/Thomson Learning. 2002. http: //www. seafriends. org. nz/oceano/waves. htm [Giancoli 85] Douglas Giancoli. Physics, Principles with Application, 2 nd edition. Prentice Hall, Inc. 1985. [Isidoro 02] John Isidoro, Alex Vlachos, and Chris Brennan. Rendering Ocean Water. Direct 3 D Shader. X: Vertex and Pixel Shader Tips and Tricks. Pages 347 -356. 2002. [IMDB 04] Credits for Titanic. http: //us. imdb. com/title/tt 0120338/. [Lake 05] Adam Lake and David Reagin. Real-Time Deep Ocean Wave Simulation On Multi. Threaded Architectures. Intel developer services: www. intel. com/ids. [Longuet-Higgins 76] M. S. Longuet-Higgins, E. D. Cokelet. The Deformation of Steep Surface Waves on Water. I. A Numerical Method of Computation. Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences, Vol. 350, No. 1660 (Jul 30, 1976), 1 -26.
![References [2 of 2]: • • • [Longuet-Higgins 80] M. S. Longuet-Higgins, A Technique References [2 of 2]: • • • [Longuet-Higgins 80] M. S. Longuet-Higgins, A Technique](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-45.jpg)
References [2 of 2]: • • • [Longuet-Higgins 80] M. S. Longuet-Higgins, A Technique for Time-Dependent Free-Surface Flows. Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences, Vol. 371, No. 1747, Aug. 4, 1980. Pages 441 -451. [Longuet-Higgins 82] M. S. Longuet-Higgins. Parametric Solutions for Breaking Waves. J. Fluid Mechanics, 1982, vol. 121, pp. 403 -424. [Mead 03] Shaw Mead. Keynote Address: Surfing Science. Proceedings of the 3 red International Surfing Reef Symposium, Raglan, New Zealand. June 22 -25, 2003. P. 1 -36. [Mihalef 04] Viorel Mihalef, Dimitris Metaxas, Mark Sussman. Animation and Control of Breaking Waves. Eurographics/ACM SIGGRAPH Symposium on Computer Animation, 2004. [Miller 76] Miller R. L. Role of Vortices in Surf Zone prediction: sedimentation, and wave forces. Beach and Nearshore sedimentation, pp. 92 -114, 1976, Tulsa, Oklahoma. Soc. Of Economic Paleontologists and Mineralogists. [Miller 76] Miller R. L. . [Mead] Shaw Mead and Kerry Black. Predicting the Breaking Intensity of Surfing Waves. Special Issue of the Journal of Coastal Research on Surfing (in press). Pages 103 -130. www. asrltd. co. nz/Paper 4 Web. pdf. [Schneider 01] Jens Schneider and Rudiger Westermann. Towards Real-Time Visual Simulation of Water Surfaces. VMV 2001, Stuttgart, Germany, Nov. 21 -23, 2001. [Tessendorf 01] Simulating Ocean Water. SIGGRAPH 2001 Course Notes. 2001. [Quick. Math 04] http: //www. quickmath. com/. November 4, 2004.

Backup
![• Irribarren Number[cite]: – B is slope – Hb/Linf = ratio of wave • Irribarren Number[cite]: – B is slope – Hb/Linf = ratio of wave](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-47.jpg)
• Irribarren Number[cite]: – B is slope – Hb/Linf = ratio of wave height to wavelength

Wave Energy as a function of Period



• – When each vertex of wave reaches breaking point: Classify vertex as FRONT, BACK, BOTTOM, TOP of waveform • FRONT, BOTTOM and TOP are projected towards virtual sphere to create vortex – • As wave approaches shore: » Sphere decreases in size as wave approaches shore. » Vertices increase their attraction to sphere BACK are projected to create natural arc on back of wave

I. Dee p Wav e Sim ulati II. Shal low Wav e Sim ulati I B a S u

Breaking • Takes as input the shallow wave that reaches the breaking point: – Curl front of waveform to simulate crash – Back follows
![Velocity and wavelength are related Image from [Seafriends] Velocity and wavelength are related Image from [Seafriends]](http://slidetodoc.com/presentation_image/2e2ab5775198b71b1291349a4493739c/image-54.jpg)
Velocity and wavelength are related Image from [Seafriends]
- Slides: 54