Modeling Ocean Waves Gokul Varadhan
Outline What do we want from our model ? Different approaches Fournier-Reeves model Peachey model
What are we looking for ? realistic shape of the waves realistic wave motion range of waves adapt to varying conditions - winds, shallow sea bottoms etc effects of approaching the shore
Simple Wave a sinusoid x = distance from origin C = propagation speed L = wavelength T = L/C is the period Wave number
Previous work Nelson Max modeled wave by a collection of superimposed sinusoidal waves [Max 1981] Ts’o and Barsky model the sea surface as a height field from Stokes model and fit it with -splines [Ts’o & Barsky 1987] Perlin used spherical cycloidal waves [Perlin 1985] Bump mapping approaches Problem with intersection with obstacles Self-shadowing
Height Field Model for each pair (x,y), we have z = f (x,y)
Modeling fluid motion Eulerian method Lagrangian method Consider a point (x,y,z) and properties of the fluid at this point as a function of time Lagrangian method Follow trajectory of a point at reference position (x0,y0,z0) with time We are going to use Lagrangian method. Its more convenient
Fournier-Reeves Model Coordinate system X-Y is the plane of sea at rest Z points up Model Ocean consists of particles which are in motion Motion is along XZ plane All points with equal Y exhibit identical motion
Particles move in circular orbits around the rest position (x0,z0) - Rest position - Wave number - Angular velocity Note this is not a height field.
A wave ! Locus of the particles with same z0 at a time t is a Trochoid which represent a wave in the model
Properties Periodicity in space and time Not a height field No net transport of matter with time Choice of circular orbits is not arbitrary Based on Gerstner or Rankine model in oceanography Gerstner or Rankine model is a model in oceanography.
Parameters in our Model Rest position (x0,z0) Amplitude (r) Wave Number (k) Angular velocity (w) Phase (kx0-wt) Wavelength (2*Π/k) Period (2*Π/w) Propagation speed (w/k) Parameters can be adjusted to give us different shapes of waves
Effects of Wind To model the effects of the wind on top of the crest, make phase angle
Effects of Wind contd … Wind Velocity Wind direction Wind => amplitude ++ amplitude = function (wind velocity) Wind direction Expected behavior - particles move in the direction of the wind Rotate the orbit plane orbit plane = plane (wind velocity, Z)
More Effects Water depth depth ++ => wavelength ++ = function (particle depth) where h is the particle depth
Depth dependence
Depth dependence contd … Phase depends on cumulative depth information at each point which is approximately
Wave Refraction Waves get refracted Obey Snell’s law of refraction are propagation speeds
Breaking of waves on shore Replace circular orbits by ellipses Ellipses align themselves with the shore Complicated equations
Wave/particle motion Distinguish motion of wave from motion of the water particles. orbital speed H – height = 2 * r
Spray and Foam Cause Spray Foam Surface curvature is large diff = Orbital speed – Wave propagation speed if diff >= Threshold => Spray otherwise => Foam Spray rendered using particle systems follows gravity Foam Foam sent sliding along the wave surface
Wave trains Regularity of waves is a problem Wave train - a group of waves with similar properties rectangular box on the surface of sea Shape the train using height envelopes X and Y envelopes Multiply amplitude of the wave by the height envelopes Vary wavelength based on the age of the wave train Removed the constraint that all particles with same Y exhibit the same motion
Rendering Interpolate the data as a set of bi-linear or bi-cubic Catmull-Rom patches Do a ray trace Color and shading: Environmental map - a natural choice
Breaking of waves at shore
Spray and Foam
Spray, Foam and Wind Notice that this is not a height field
Next : Peachey model for ocean waves
Simple Wave x = distance from origin C = propagation speed a sinusoid x = distance from origin C = propagation speed L = wavelength T = L/C is the period Wave number Lets look at the simple sinusoidal wave again. Our model is based on it.
Airy Model Sinusoidal waves of small magnitude Propagation speed, C and wavelength L depend on depth d as follows: Airy model tells us about dependence of C and wavelength on depth where T = period
Basic Model Represent ocean surface as a height field, a single-valued function of three variables Disadvantage: Can’t produce waves whose crests curl forward Advantage: Can superpose numerous waves easily
Basic Model contd … f is the sum of several linear waveforms, Wi is a wave profile is the phase function We have to compute the phase first and the apply the wave profile function.
Phase Computation Phase depends on: time t position x,y depends on depth and is complex Explain how we compute the phase function. Design a beach first Use Airy model to compute Ci as a f(depth) Use Numerical integration
Wave Profiles Linearly blend sinusoid and a steep quadratic wave such as: according to steepness Also depends on the ratio between depth of water and deep water wavelength To simulate breaking of waves near the shore Explain the whole process: First design a beach. That gives us the depth at different points Compute the phase function at each point using numerical integration Apply the wave profile function
Spray Criterion Particle generation where S = H/L is the steepness initial position = crest of the wave initial velocity is Qavg in the direction of wave motion plus a stochastic perturbation trajectory follows gravity Number of particles increase with the difference between Qavg and C where S = H/L is the steepness Wave breaks when Qavg > C i.e. if S exceeds a threshold
Spray contd Similar particle system to simulate spray resulting from striking obstacles
Rendering Raytracing is too expensive, suffers from aliasing A-buffer Why not Z-buffer ? Aliasing, memory consumption Scanline rendering Reduce memory consumption Reduce Virtual Memory page faults Render wave patches as a collection of polygons Split large wave patches into smaller ones Explain A-buffer
Rendering spray Difficult to render particle systems in a scanline order Use sparse Z-buffer Combine with the A-buffer
Breaking waves
Breaking waves with obstacle
Sunset
Late afternoon
References [Fournier & Reeves 1986] Fournier, A., Reeves, W.T., A Simple Model of Ocean Waves, ACM Computer Graphics (SIGGRAPH '86 Proceedings) , pp.75--84, 1986. [Peachey 1986] Peachey, D., "Modeling of Waves and Surf," Proceedings of SIGGRAPH `86, in Computer Graphics, Vol. 20, No. 4, pp. 65-74, 1986. [Max 1981] Max, Nelson L. "Vectorized Procedural Models for Natural Terrain: Waves and Islands in the Sunset." SIGGRAPH '81, p. 317-324.
References contd … [Ts’o & Barsky 1987] Tso, P., and Barsky, B., "Modeling and Rendering Waves: Wave Tracing Using Beta-Splines and Reflective and Refractive Texture Mapping", ACM Transactions on Graphics (6), pp. 191214, 1987. [Perlin 1985] K. Perlin, An Image Synthesizer, Computer Graphics, v19, n3, p287-296, 1985