4.6. WATER, FLUID DYNAMICS AND CLOTHExploration of liquids and cloth effects
FLUID DYNAMICSIntroductory
overview of fluid dynamics
Video not available in on-line slides
Video not available in on-line slides
Fluid Dynamics (faking it and the real thing)
Fluid dynamics can be faked using techniques such as:• particle systems• video textures• procedural effects (e.g.
Perlin noise for fire)• pre-computed effects
However, faked approaches may not be highly realistic and tend not to offer much interaction.
A simulation region (grid based) is defined, with fluid state variables introduced for each grid location.
State variables can include:•Fluid velocity and pressure•Fluid density (for smoke and fire)•Surface level (for water and levels)
Pressure Density, Temperature, or Level setVelocity
Fluid Dynamics (the real thing)
The variables are evolved over time to simulation the evolution of the fluid.
Fluid Dynamics (the real thing)Details of how the fluid is evolved can be found within the directed reading.
In a nutshell, evolution is determined using the Navier-Stokes equation which requires the conservation of momentum and mass.
Initialize
Advect Advect
AddDensity
AddVelocity Projec
t
Density
Velocity
iterate
Pressure
Density DensityVelocity Velocity Velocity
Pressure
Simulation: Iterate
Advect
Particle Based Simulation
Other than using the Navier-Stokes equations, particle-based methods can also be employed to model flow (modelled using a collection of particles that move under the influence of hydrodynamic and gravitational forces).
Video not available in on-line slides
CLOTHExploration of cloth effects
ClothA cloth object is modelled as a set of connected particles. Each particle is subject to external forces, such as gravity, wind, etc. and various constraints (maintaining the overall shape of the object). To prevent interpenetration with the environment collision constraints are also introduced.
ClothSpring constraints between neighbouring particles are used. The particle’s equation of motion resulting from applying the external forces is found using Verlet integration.
The various constraints create a system of equations linking the particles’ positions together. This system is solved at each simulation time step by relaxation; that is by enforcing the constraints one after the other for a given number of iterations.
Cloth
A collision constraint between a particle and a collision object is enforced by checking whether the particle is inside the object or not, and if it is inside, by moving the particle to a position at the surface of the object.
Step 1: For every particle that is an anchor point:Apply force through equation of motion
Step 2: For every particle that is not an anchor point:Update position
Step 3: For every relaxation step:Step 3a: For every spring
constraint:Enforce spring constraintStep 3b: For every particle: For every collision object: Enforce collision constraint
WATERExploration of water modelling
Video not available in on-line slides
Water
Evidently water animation is more accurately modelled using accurate fluid dynamics, however, this is a very computationally expensive process.
The most simple approach towards modelling water is to use a moving normal map to create the appearance of moving water across a flat plane using a Fresnel factor to control the degree of reflectance.
WaterA slightly more complex approach is to employ normal maps to provide fine detail and dynamically displace the vertices of an underlying (flat) mesh to provide wave-like motion.
The water mesh might be perturb using a combination of several sinusoidal waves to produce a more complex wave, or the superposition of several height maps.
DIRECTED READINGDirected reading water, fluid dynamics and cloth
Directed
reading
Directed reading: Fluid DynamicsDirected
reading
• Read GPU Gems 3 - Real-Time Simulation and Rendering of 3D Fluids – for details of rendering 3d fluids.
• Read nVidia’s Real-Time Volumetric Smoke, Fire and Water with Fluid Dynamics – for a related presentation to the GPU Gems chapter.
• Read Interactive Fluid Dynamics and Rendering on the GPU for more information on GPU fluid rendering
• Read Realistic and Interactive Simulation of Rivers - for more information on flow modelling using particles
Directed reading: Cloth Directed
reading
• Read nVidia’s Cloth Simulation – for an overview of rendering cloth on the GPU
• Read Asynchronous Cloth Simulation for more information on more advanced cloth rendering
Directed reading: Water Directed
reading
• Read GPU Gems 2- Using Vertex Texture Displacement for Realistic Water Rendering – for the use of displacement mapping to simulate a water surface.
• Read Real-Time Synthesis and Rendering of Ocean Water – for information on rendering ocean surfaces
• Read Realistic Water Volumes in Real-Time – for more information on rendering water volumes
Summary
To do:Read the directed
readingThink if you would like
to implement either type of modelling.
Today we explored:
Overview of fluid dynamics approaches
Overview of modelling cloth
Overview of water rendering