Post on 05-Jan-2016
description
transcript
a Ph.D. Defense byQizhi Yu
Under the Advisements of Dr. Fabrice Neyret
Dr. Eric Bruneton
November 17, 2008
Grenoble Institute of Technology (INPG)
1
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions
ConclusionConclusion
2
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions
ConclusionConclusion
3
4
5
ObjectiveObjective Synthesize visually convincing rivers
Study contentStudy content Modeling▪ River shape & surface details
Animating▪ Water motion in rivers.
6
Many applications, need more Many applications, need more studiesstudies
EA: Crysis Google Earth 7
Multi-scaleMulti-scale Geometry ▪ Kilometer-scale length
millimeter-scale waves Water motion▪ Kilometer-scale mean flow
millimeter-scale fluctuation
Complicated physicsComplicated physics Turbulence Surface phenomena
8
Modeling and animating rivers Modeling and animating rivers
ConstraintsConstraints Real-timeReal-time Scalability Controllability Realism
25 fps or more25 fps or more
9
Modeling and animating rivers Modeling and animating rivers
ConstraintsConstraints Real-time ScalabilityScalability Controllability Realism
Very long or unbounded rivers Camera moves arbitrarily
Very long or unbounded rivers Camera moves arbitrarily
10
Modeling and animating riversModeling and animating rivers
ConstraintsConstraints Real-time Scalability ControllabilityControllability Realism Intuitive handles for
controlling appearance and behavior of rivers
Intuitive handles for controlling appearance and behavior of rivers
11
Modeling and animating rivers Modeling and animating rivers
ConstraintsConstraints Real-time Scalability Controllability RealismRealism
Animated surface details with temporal and spatial continuity
Animated surface details with temporal and spatial continuity
12
Modeling and animating rivers Modeling and animating rivers
ConstraintsConstraints Real-time Scalability Controllability Realism
13
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions
ConclusionConclusion
14
3D Navier-Stokes simulation3D Navier-Stokes simulation
2D depth-averaged simulation2D depth-averaged simulation
2D simulation 2D simulation
Surface wave models (2D) Surface wave models (2D)
15
3D Navier-Stokes simulation3D Navier-Stokes simulation
2D depth-averaged simulation 2D depth-averaged simulation
2D simulation2D simulation
Surface wave models (2D) Surface wave models (2D)
16
Incompressible Navier-Stokes equations Incompressible Navier-Stokes equations Momentum conservation
Volume conservation
Boundary conditions
Computational Fluid Dynamics (CFD)Computational Fluid Dynamics (CFD) Numerical methods
17
CFD CFD CG fluid animation CG fluid animation Stable solver [stam99]
Two approachesTwo approaches Eulerian : defines quantities at fixed
point Lagrangian: defines quantities at
particles
18
Water animation Water animation [EMF02] [EMF02] Solve NSE numerically on a grid to get
velocities Use level-set to track water-air
interface
19
Pouring water in a Pouring water in a glass [EMF02]glass [EMF02]
15 minutes per 15 minutes per frameframe
55 x 120 x55 55 x 120 x55 gridsgridsComputationally
expensive! 20
Poorly scalable Poorly scalable CG (stable solver): O(N^3)
Difficult to control for artistsDifficult to control for artists Water Behavior Initial values, boundary
conditions No intuitive relation
21
Smoothed Particle Hydrodynamics Smoothed Particle Hydrodynamics (SPH) (SPH) [MCG03][MCG03] Solve NSE in the “Lagrangian formalism”
Compared with Eulerian approachCompared with Eulerian approach Easier adaptive to complex domain Difficult to reconstruct
a smooth surface
For our purposeFor our purpose Similar problems
as Eulerian approach22
2200 particles5 fps
3D Navier-Stokes simulation3D Navier-Stokes simulation
2D depth-averaged simulation 2D depth-averaged simulation
2D simulation2D simulation
Surface wave models (2D) Surface wave models (2D)
23
2D Shallow Water model [Mol95]2D Shallow Water model [Mol95] Commonly used in Hydraulics for simulating rivers Assumptions▪ Hydrostatic approximation
▪ No vertical water motion Integrate the NS equations along vertical direction Unknowns: depth-averaged velocity & elevation of water surface
24
PropertiesProperties A lot faster than 3D N-S simulation Loss some 3D surface features (e.g.
overturning ) Shallow waves ( wavelength >> depth)
For our purposeFor our purpose Still too expensive, especially for large
rivers Bounded domain (like other simulation).
25
Linear wave equation [KM90]Linear wave equation [KM90] Simplified from shallow water model Assumptions ▪ constant water depth, no advection term
Properties▪ Fast, can’t simulate river flow
26
[Irving et al. 06][Irving et al. 06]
20 processors20 processors
25 minutes per 25 minutes per frameframe
27
3D Navier-Stokes simulation3D Navier-Stokes simulation
2D depth-averaged simulation2D depth-averaged simulation
2D simulation
Surface wave models (2D) Surface wave models (2D)
28
Simulate 2D velocity by solving Simulate 2D velocity by solving 2D N-S2D N-S no surface elevation simulated
Use tricks for surface elevationUse tricks for surface elevation Pressure [CdVL95] Noise [TG01]
29
3D Navier-Stokes simulation3D Navier-Stokes simulation
2D depth-averaged simulation2D depth-averaged simulation
2D simulation2D simulation
Surface wave models (2D) Surface wave models (2D)
30
AssumptionAssumption Deep water: wave length depth Surface (heighfield) = sine waves
MethodMethod Wave spectrum FFT surface elevation
PropertiesProperties Fast, nice ocean waves No water flow, no boundary
We use it as texture examples.We use it as texture examples. 31
AssumptionAssumption Height field
A procedural methodA procedural method Particles on surfaces, advected with a fixed
speed Each carries a wave shape function Superpose all particles height field
PropertiesProperties Imitate object-water interaction No water flow
32
Superpose sine waves [FR86, Pea86]Superpose sine waves [FR86, Pea86] Dynamic wave tracing [GS00]Dynamic wave tracing [GS00] Ship wave [Gla02]Ship wave [Gla02]
33
[Gla02]
[GS00]
[Pea86]
Not for river flow
Many work on water or wave Many work on water or wave animation (CG), river simulation animation (CG), river simulation (Hydraulics)(Hydraulics)
None for river animation under None for river animation under our constrains: our constrains: Real-time Scalability Controllability
34
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions
ConclusionConclusion
35
Model river aspects in three Model river aspects in three scales, from coarse to finescales, from coarse to fine
36
Model river aspects in three Model river aspects in three scalesscales Macro-scale: river shape & mean Macro-scale: river shape & mean
water surface water surface
37
Model river aspects in three Model river aspects in three scalesscales Macro-scale: river shape & mean water
surface Meso-scale: individual & structured Meso-scale: individual & structured
waves waves
38
Model river aspects in three Model river aspects in three scalesscales Macro-scale: river shape & mean water
surface Meso-scale: individual & structured
waves Micro-scale: continuous field of Micro-scale: continuous field of
small wavessmall waves
39
We need river velocityWe need river velocity Cause of many meso-scale phenomena Advect surface features
Model water motion in three Model water motion in three scalesscales Macro-scale: mean flow Meso-scale: individual perturbations Micro-scale: continuous irregular
fluctuations40
We need river velocityWe need river velocity Cause of many meso-scale phenomena Advect surface features
Model water motion in three Model water motion in three scalesscales Macro-scale: mean flow Meso-scale: individual perturbations Micro-scale: continuous irregular
fluctuationsWe won’t solve ALL phenomena in this thesis . 41
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions 1: Macro-scale1: Macro-scale 2: Meso-scale 3: Micro-scale
ConclusionConclusion42
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions 1: Macro-scale1: Macro-scale 2: Meso-scale 3: Micro-scale
ConclusionConclusion43
GoalGoal Shape of rivers Mean flow of rivers
44
GoalGoal Shape of riversShape of rivers Mean flow of rivers
GIS or previous work [KMM88]GIS or previous work [KMM88]
45
Input Input river shape (described as a network)
46
AssumptionAssumption a 2D steady flow
Visually convincing velocityVisually convincing velocity Divergence free Incompressible Boundary-conforming Flowing from source to sink (given flow rate
Q) Continuous
Requirements of algorithmsRequirements of algorithms Fast, scalable and controllable
47
Some existing work Some existing work [BHN07] [BHN07]
suggest suggest using stream function to get
divergence-free vector field
48
Stream function is defined Stream function is defined such that such that
IncompressibilityIncompressibility
49
Properties of stream functionProperties of stream function Const along boundaries Relates to the volume flow rate
Extend to a river networkExtend to a river network Given flow rates and a river network all
boundary values50
Given flow rates, and boundary Given flow rates, and boundary valuesvalues How to determine the internal field ?
51
Assumption Assumption Irrotational (potential) flow
52
Observe a numerical solution of Observe a numerical solution of a Laplace equation a Laplace equation
Streamlines (isocurve of stream function)
53
[GW78][GW78] Interpolant of the Inverse-Distance
Weighted interpolation (IDW) [She68] similar to the harmonic functions.
We adapt IDWWe adapt IDW local for the performance reasons provide parameters for controlling
velocity profile
54
55
d distance to boundariesf smooth functions search radiusp parameters
Our result Our result Numerical solutionNumerical solution
56
Finite differenceFinite difference
57
Interpolation relies heavily on Interpolation relies heavily on distance querydistance query Acceleration needed
Combine with tile-based terrain Combine with tile-based terrain [BN07][BN07] Generate an acceleration data structure in
each newly created terrain on-the-fly
Please see the thesis for more details.58
59
Procedural river flowProcedural river flow Fast Scalable▪ Calculate at needed▪ Velocity locally dependent
Controllable ▪ Control velocity: flow rates, interpolation
parameters▪ Edit shape of river on-the-fly
60
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions 1: Macro-scale 2: Meso-scale2: Meso-scale 3: Micro-scale
ConclusionConclusion61
GoalGoal Modeling individual & structured wave
features on river surfaces, with our constraints.▪ Real-time▪ Scalability▪ Controllability▪ Quality
62
63Real sceneReal scene
High-resolution required for High-resolution required for simulation and renderingsimulation and rendering
64
Construct the vector features Construct the vector features from a given velocity field from a given velocity field without numerical simulationwithout numerical simulation
Shockwave
Shockwave
RipplesRipples
65
ProblemsProblems Need to be improved ▪ robustness & efficiency
No solution for surface reconstruction and rendering
66
Improve on existing model [NP01]Improve on existing model [NP01] Result▪ Mean flow shockwave curves (wave crests) ▪ Animated by adding perturbationperturbation to the mean
flow
67
Improve on existing model [NP01]Improve on existing model [NP01] Result▪ Mean flow Mean flow shockwave curves (wave crests) ▪ Animated by adding perturbationperturbation to the mean
flow
Macro-scale
Macro-scale
Meso-scale, [WH91]
Meso-scale, [WH91]
68
Improve on existing model [NP01]Improve on existing model [NP01] Result▪ Mean flow shockwave curves (wave crests) ▪ Animated by adding perturbation perturbation to the mean
flow▪ Very efficientVery efficient
69
Improve on existing model Improve on existing model [NP01][NP01]
Construct appropriate Construct appropriate representation from wave representation from wave features for high-quality features for high-quality renderingrendering
70
lo-res base water surface + hi-res wave lo-res base water surface + hi-res wave surfacesurface
71
lo-res base water surface lo-res base water surface + hi-res wave + hi-res wave surfacesurface
Macro-scale
Macro-scale
72
lo-res base water surface + lo-res base water surface + hi-res wave hi-res wave surfacesurface
Meso-scaleMeso-scale
73
Feature-aligned mesh reducesFeature-aligned mesh reduces geometric aliasing ( geometric aliasing (
normal-noise)normal-noise)
Not feature-aligned
Feature-aligned 74
Define wave surface as sweeping Define wave surface as sweeping a wave profile along the wave a wave profile along the wave curvecurve
User defined Wave profile
Wave curveWave curve
75
Water surface mesh
Water surface mesh
Sample by a quad meshSample by a quad meshaligned the wave curvealigned the wave curve
v 76
Wave curveWave curve
Accurate normals from the wave Accurate normals from the wave profileprofile
u
v
B
NT
P(u,v)
v 77
Mesh stitching ?Mesh stitching ? Re-mesh base surface at each frame, too
expensive
We solve it in the rendering We solve it in the rendering stage stage
Please refer to the thesis for more details
78
79
Simply draw two wave strips Simply draw two wave strips with Z-bufferwith Z-buffer
80
Generate a dedicated mesh at Generate a dedicated mesh at crossingcrossing
81
Final resultFinal result
82
83
Approach: feature-based vector Approach: feature-based vector simulationsimulation Simulation: construct & animate vector
features Rendering: featured-based
representation
84
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions 1: Macro-scale 2: Meso-scale 3: Micro-scale3: Micro-scale
ConclusionConclusion85
GoalGoal Modeling small scale animated surface
features
ApproachApproach dynamic textures
Two workTwo work Wave sprites▪ Focus on performance
Lagrangian texture advection▪ Focus on quality
86
IntroductionIntroduction Previous workPrevious work Strategy overviewStrategy overview ContributionsContributions
1. Macro-scale 2. Meso-scale 3. Micro-scale▪ Wave spritesWave sprites▪ Lagrangian texture advection
ConclusionConclusion87
• Sprite: a small textured elementSprite: a small textured element
• Sprites in texture world Sprites in texture world [LN03,LHN05] [LN03,LHN05] • to get large high-resolution texture , low
memory
• Idea: Idea: combine animation + combine animation + texture spritestexture sprites• to get very large river with animated
details, efficiently.88
89
Dynamic adaptive samplingDynamic adaptive sampling A set of particles in world space advected by
flow Keep Poisson-disk distribution in screen
space.
Attach a textured sprite to each Attach a textured sprite to each particleparticle
90
Dynamic adaptive samplingDynamic adaptive sampling A set of particles in world space advected by
flow Keep Poisson-disk distribution Poisson-disk distribution in screen
space.
Attach a textured sprite to each Attach a textured sprite to each particleparticle
Why ?Why ?
91
Uniform densityUniform density Overlapping as little as possible
Easy to ensure spatial continuityEasy to ensure spatial continuity Superimposing sprites (with r=d) ensures
no-holesr
r = d diameter of poisson-disk
92
Dynamic adaptive samplingDynamic adaptive sampling A set of particles in world space
advected by flow Keep Poisson-disk distribution in screen screen
spacespace
Attach a sprite to each particleAttach a sprite to each particleAuto-adapt to
distanceAuto-adapt to
distance
93
AlgorithmAlgorithm Advect particles with the flow in world
space Delete particles out of the view frustum Delete particles violating the minimum
distance required by the Poisson-disk distribution (in screen space)
Insert particles to keep Poisson-disk distribution
94
AlgorithmAlgorithm Advect paticles with the flow Delete particles out of the view frustum Delete particles violating the minimum
distance required by the Poisson-disk distribution (in screen space)
Insert particles to keep Poisson-disk distribution Boundary-sampling algorithm [DH06]
95
Spatial continuitySpatial continuity Smooth kernel Constrained sampling issues near
boundary
Temporal continuityTemporal continuity Fading in/out
Please refer the thesis.Please refer the thesis.96
A set of sprites well distributedA set of sprites well distributed Each sprite ▪ Live in texture space▪ maps to a portion of a reference texture
Reconstruct the global textureReconstruct the global texture Sprite has circular kernel in screen space
, but ellipse in object space▪ So we superimpose them in screen space
97
98
99
Efficient GPU. Inspired from [LN05]
100
Wave-spritesWave-sprites Texture flow surface with scene-
independent performance (in real-time)
LimitationLimitation No sprite deformation considered Sliding of texture between sprites▪ bad especially in place where velocity
gradient is high101
IntroductionIntroduction Previous workPrevious work Strategy overviewStrategy overview ContributionsContributions
1. Macro-scale 2. Meso-scale 3. Micro-scale▪ Wave spritesWave sprites▪ Lagrangian texture advectionLagrangian texture advection
ConclusionConclusion102
A technique of dynamic textureA technique of dynamic texture Conform to the input flow Conserve texture properties (e.g.
spectrum)
PurposePurpose Augment coarse simulation with small
scale appearance
103
Advect texture coordinatesAdvect texture coordinates Texture follow flow and deform But, over stretching destroy texture
properties
Regenerate a textureRegenerate a texture After a delay: “latency”
Blend two de-phased texturesBlend two de-phased textures Illusion of advection
104
How to choose a reasonable How to choose a reasonable latency ? latency ? high bad conservation of spectrum low bad conformation to flow Good one: adapt to local flow condition
(deformation)
In [MB95], only one global In [MB95], only one global valuevalue
105
Idea: adaptive local latencyIdea: adaptive local latency
Local deformation metrics Local deformation metrics
““MIPmap”-like approach:MIPmap”-like approach: Multiple layers of textures Each layer = Eulerian advection method Assign different “latency” to each layer For each pixel, interpolate two
“nearest” layers according to local 106
““latency” of all layers are latency” of all layers are bounded in a rangebounded in a range e.g. For zero-velocity , the ideal latency
should be infinity close to still area, we can’t choose a good latency value
Interpolation : not accurateInterpolation : not accurate
Eulerian formalism Eulerian formalism not optimal in large sparse domain
(clouds, fire)107
IdeaIdea Lagrangian formalism as in “wave
sprites” work Attach to each particle a deformabledeformable
textured patches mapping to a reference texture
Reconstruct a global texture by blending all patches
108
Advected by flowAdvected by flow
Dynamic Poisson-Dynamic Poisson-disk distributiondisk distribution
d
109
Init: regular gridInit: regular grid
Kernel radius = dKernel radius = d Ensure full coverage
Patch size > 2d Patch size > 2d Allow deformation
2d
d
size
Poisson-disk
110
Init: regular gridInit: regular grid
Kernel radius = dKernel radius = d
Patch size > 2dPatch size > 2d
Map to a random portionMap to a random portion Store (u, v) at nodes
U
V
111
Nodes advected by Nodes advected by flow flow
112
Nodes advected by Nodes advected by flow flow
Delete a patch Delete a patch Exceed some
deformation metric
113
Nodes advected by Nodes advected by flow flow
Delete a patch Delete a patch Exceed some
deformation metric Patch boundary
intersects with kernelA new patch would be generated nearby automatically by Poisson-disk distribution mechanism
114
Temporal & spatialTemporal & spatial Insert / delete temporal Smooth kernel spatial
Define various temporal and Define various temporal and spatial spatial weightsweights on grid nodes on grid nodes
Please see details in the thesis
115
Encode all patches into one Encode all patches into one texture Ttexture Tpatchpatch
Texcoords (u, v) Weights w(x, t)
Accessing the advected textureAccessing the advected texture For each pixel▪ Determine the patches covering current pixel▪ Access reference texture via Tpatch
▪ Blending with weights (only kernel parts!) 116
117
Compare against Eulerian Compare against Eulerian advectionadvection FFT▪ To evaluate the appearant spectrum
Optical flow▪ To evaluate the appearant motion
Input reference textureInput reference texture 3-octave Perlin noise
118
Various input flowVarious input flow
Please see my webpage for more Please see my webpage for more video resultsvideo results
119
Rotation
Shear Free Boundary
120
121
We target textures specified by We target textures specified by global properties, e.g. spectrumglobal properties, e.g. spectrum Useful for natural flow
For non-noise texturesFor non-noise textures Many of them work well High-structured ones▪ Suffer from “ghosting” effects▪ Future work: choose best match portion
from reference texture
122
123
124
A new texture advection methodA new texture advection method Lagrangian formalism▪ Brings decorrelation of texture mapping and
regeneration events Local patches▪ Ensure continuous texture animation ▪ Provide accurate distortion metric
126
IntroductionIntroduction
Previous workPrevious work
Strategy overviewStrategy overview
ContributionsContributions
ConclusionConclusion
127
By using our modelsBy using our models One can achieve real-time, scalable, and
controllable river animation with temporally and spatially continuous details on current desktop
128
Macro-scaleMacro-scale Velocity: more studies on parameters Influence of slope of river bed
129
Meso-scaleMeso-scale Hydraulic jumps, ship waves and
wakes ...
130
Micro-scale I: wave spritesMicro-scale I: wave sprites Various reference textures: domain wise
control Sprites density: adaptive to flow
condition
131
Micro-scale II: Lagrangian texture Micro-scale II: Lagrangian texture advectionadvection Extend to 3D volume Improve: for high-structured texture
132[RNGF03]
Put models togetherPut models together
Integrate with existing systemsIntegrate with existing systems Google Earth, Proland [BN08], video
games …
133EA: Crysis
Google Earth
Proland
134
a Ph.D. Defense by
Qizhi Yu
Under the Advisements of
Dr. Fabrice Neyret
Dr. Eric Bruneton
November 17, 2008
Grenoble Institute of Technology
135