A Simple, Efficient Method for Realistic Animation of Clouds

33
A Simple, Efficient A Simple, Efficient Method for Realistic Method for Realistic Animation of Clouds Animation of Clouds Yoshinori Dobashi Kazufumi Yoshinori Dobashi Kazufumi Kaneda Kaneda Hideo Yamashita Tsuyoshi Hideo Yamashita Tsuyoshi Okita Tomoyuki Nishita Okita Tomoyuki Nishita SIGGRAPH SIGGRAPH 2000 2000

description

A Simple, Efficient Method for Realistic Animation of Clouds. Yoshinori Dobashi Kazufumi Kaneda Hideo Yamashita Tsuyoshi Okita Tomoyuki Nishita SIGGRAPH 2000. Main Idea. Simulation method - PowerPoint PPT Presentation

Transcript of A Simple, Efficient Method for Realistic Animation of Clouds

Page 1: A Simple, Efficient Method for Realistic Animation of Clouds

A Simple, Efficient Method A Simple, Efficient Method for Realistic Animation of for Realistic Animation of

CloudsCloudsYoshinori Dobashi Kazufumi Yoshinori Dobashi Kazufumi

KanedaKanedaHideo Yamashita Tsuyoshi Okita Hideo Yamashita Tsuyoshi Okita

Tomoyuki NishitaTomoyuki Nishita

SIGGRAPH SIGGRAPH 20002000

Page 2: A Simple, Efficient Method for Realistic Animation of Clouds

Main IdeaMain Idea

• Simulation methodSimulation method The cloud evolution is simulated using The cloud evolution is simulated using

cellular automation cellular automation whichwhich can simulate the can simulate the motionmotion by simple Boolean operations. by simple Boolean operations.

• Rendering methodRendering method

Hardware-accelerated rendering method Hardware-accelerated rendering method based on OpenGL, thus quickly calculate based on OpenGL, thus quickly calculate shadowsshadows and and shafts of lightshafts of light through through clouds, as well as cloud color.clouds, as well as cloud color.

Page 3: A Simple, Efficient Method for Realistic Animation of Clouds

IntroductionIntroduction

• The density distribution of clouds can be The density distribution of clouds can be defined in 3D space to create realistic defined in 3D space to create realistic images.images.

• Static cloudsStatic clouds• Cloud animation in movies.Cloud animation in movies.• Nagel use Nagel use cellular automationcellular automation to simulate to simulate

by transition rules.by transition rules.• Based on Nagel’s work, we generate cloud Based on Nagel’s work, we generate cloud

shadows, light shafts shadows, light shafts using graphics API using graphics API and OpenGL.and OpenGL.

Page 4: A Simple, Efficient Method for Realistic Animation of Clouds

IntroductionIntroduction

• Our method display the following effects:Our method display the following effects:

1)1) cloud color considering the cloud color considering the single single scattering of lightscattering of light

2)2) shadows of the cloudsshadows of the clouds cast on the cast on the groundground

3)3) shafts of lightshafts of light through light. through light.

• Not for the physically exact cloud motion.Not for the physically exact cloud motion.

Page 5: A Simple, Efficient Method for Realistic Animation of Clouds

Previous workPrevious work

• SimulationSimulation Two categories to simulate the gaseous Two categories to simulate the gaseous

motion like cloud.motion like cloud. 1) 1) simulate the physical process of field simulate the physical process of field

dynamicsdynamics – time consuming – time consuming 2) 2) heuristic approachheuristic approach – search parameters – search parameters

by trial and errorby trial and error• Our method reflect the physical formation Our method reflect the physical formation

process of cloud and is easy to control the process of cloud and is easy to control the shape and motion.shape and motion.

Page 6: A Simple, Efficient Method for Realistic Animation of Clouds

Previous workPrevious work• RenderingRendering 11. To. To display photo-realistic images, display photo-realistic images,

scattering/absorptionscattering/absorption (due to particles) should (due to particles) should be considered.be considered.

22. Multiple scattering the skylight are important . Multiple scattering the skylight are important for realistic image synthesis but is time-for realistic image synthesis but is time-consuming. Our method use it as consuming. Our method use it as ambientambient term. term.

33. Use 3D texture to render volume density, yet . Use 3D texture to render volume density, yet the 3D texture mapping hardware is expensive. the 3D texture mapping hardware is expensive. So, we use So, we use 2D texture.2D texture.

44. Ray-tracing is time-consuming. We use . Ray-tracing is time-consuming. We use hardware color blending and texture mapping hardware color blending and texture mapping functions.functions.

Page 7: A Simple, Efficient Method for Realistic Animation of Clouds

Basic Basic IdeaIdea

Page 8: A Simple, Efficient Method for Realistic Animation of Clouds

Basic ideaBasic idea

• Each variable can be stored in Each variable can be stored in one bitone bit to to save the memory cost and the simulation save the memory cost and the simulation process is accelerated by using process is accelerated by using bit field bit field manipulation functionmanipulation function..

• From the simulation process, what we get From the simulation process, what we get is no more than whether there is cloud is no more than whether there is cloud (cld=1/0). So a density at each point is (cld=1/0). So a density at each point is calculated by smoothing the binary calculated by smoothing the binary distribulation.distribulation.

Page 9: A Simple, Efficient Method for Realistic Animation of Clouds

Basic ideaBasic idea

• Use Use volume rendering algorithmvolume rendering algorithm 1. calculate the intensity of light reaching the 1. calculate the intensity of light reaching the

center of each voxel. Also calculate the cloud center of each voxel. Also calculate the cloud shadows which are got as texture.shadows which are got as texture.

2. generate.2. generate.• CloudsClouds are rendered with a splatting method. are rendered with a splatting method.• Shafts of lightShafts of light are rendered with multi spherical are rendered with multi spherical

shells with their center at the viewpoint. shells with their center at the viewpoint. ShellShell then are drawn from back to front using the then are drawn from back to front using the

hardware alpha-blending function.hardware alpha-blending function. Shafts of lightShafts of light are rendered by mapping the are rendered by mapping the

shadow texture on the shells. shadow texture on the shells.

Page 10: A Simple, Efficient Method for Realistic Animation of Clouds

Simulation methodSimulation method

• We extend the following four points We extend the following four points to Nagels methods:to Nagels methods:

• Extinction of cloudsExtinction of clouds

• Wind effectsWind effects

• Speeding up of the simulationSpeeding up of the simulation

• Controlling cloud motionControlling cloud motion

Page 11: A Simple, Efficient Method for Realistic Animation of Clouds

Physical process of cloud Physical process of cloud formationformation

• CloudsClouds are formed as a bubble of air is are formed as a bubble of air is heated by underlying terrain heat, causing heated by underlying terrain heat, causing the bubble to become less dense, and to rise the bubble to become less dense, and to rise into regions of lower pressure in which the into regions of lower pressure in which the bubble expands. Expansion cools the bubble expands. Expansion cools the bubble, increasing the relative humidity bubble, increasing the relative humidity inside the bubble.inside the bubble.

• Phase transition then occurs ( water vapor in Phase transition then occurs ( water vapor in the bubble becomes water droplets, or the bubble becomes water droplets, or clouds).clouds).

Page 12: A Simple, Efficient Method for Realistic Animation of Clouds

Nagel’s methodNagel’s method• Use the cellular automation to simulate.Use the cellular automation to simulate.

• Three logical variables: hum, act, cld. Three logical variables: hum, act, cld.

),2,,(),,2,(),,,2(

),1,,(),,1,(),,,1(

),1,,(),,1,(),,,1(),,(

),,(),,,(),,,(),,,(

),,,(),,,(),,,(

),,,(),,,(),,,(

1

1

1

iii

iii

iiiact

actiii

iii

iii

tkjiacttkjiacttkjiact

tkjiacttkjiacttkjiact

tkjiacttkjiacttkjiactkjif

kjiftkjihumtkjiacttkjiact

tkjiacttkjicldtkjicld

tkjiacttkjihumtkjihum

Page 13: A Simple, Efficient Method for Realistic Animation of Clouds
Page 14: A Simple, Efficient Method for Realistic Animation of Clouds

Cloud extinctionCloud extinction

• One disadvantages of Nagel’s method is that One disadvantages of Nagel’s method is that cloud extinction never occurs once it cloud extinction never occurs once it become 1.become 1.

• In reality, cloud extinction is caused by In reality, cloud extinction is caused by gradual transition of water droplets to vapor.gradual transition of water droplets to vapor.

• Our method:Our method:

cloud extinction probability Pcloud extinction probability Pext, ext, at each cell at each cell whose cld=1, generate a rand( 0<=rnd<=1)whose cld=1, generate a rand( 0<=rnd<=1)

),,,(),,,(),,,( 1 iii tkjiacttkjicldtkjicld

exp

exp

,0

,1{

Prnd

Prndcld

Page 15: A Simple, Efficient Method for Realistic Animation of Clouds

Cloud ExtinctionCloud Extinction• Another problem, clouds are never Another problem, clouds are never

generated after the extinction at the cell.generated after the extinction at the cell.

• With the help of vapor (hum) and phase With the help of vapor (hum) and phase transition factors (act) which are supplied transition factors (act) which are supplied at specified time intervals.at specified time intervals.

)),,,((),,,(),,,(

)),,,((),,,(),,,(

)),,,((),,,(),,,(

1

1

1

iactii

ihumii

iextii

tkjiPrndIStkjiacttkjiact

tkjiPrndIStkjihumtkjihum

tkjiPrndIStkjicldtkjicld

Page 16: A Simple, Efficient Method for Realistic Animation of Clouds

Advection by windAdvection by wind

• Clouds move in one direction blown by windClouds move in one direction blown by wind

--shift all the variables towards the wind shift all the variables towards the wind effect.effect.

• Wind velocity depends on the height from Wind velocity depends on the height from the ground - specify it is the function of z.the ground - specify it is the function of z.

otherwise

zvitkjzviacttkjiact

otherwise

zvitkjzvicldtkjicld

otherwise

zvitkjzvihumtkjihum

kiki

kiki

kiki

,0

0)(),,,),(({),,,(

,0

0)(),,,),(({),,,(

,0

0)(),,,),(({),,,(

1

1

1

Page 17: A Simple, Efficient Method for Realistic Animation of Clouds

Fast Simulation Using Bit Field Fast Simulation Using Bit Field Manipulation FunctionsManipulation Functions

• Each variable can be stored in 1 bit since its Each variable can be stored in 1 bit since its state is 0/1. Thus simulation with large state is 0/1. Thus simulation with large numbers of cells can be executed in a small numbers of cells can be executed in a small amount of memory –store the variables in amount of memory –store the variables in an array of unsigned integers. Let m be the an array of unsigned integers. Let m be the bit length of the unsigned integer variable, bit length of the unsigned integer variable, transitions of m cells can be computed at transitions of m cells can be computed at the same timethe same time..

• Yet random numbers generation at each cell Yet random numbers generation at each cell (in cloud extinction) cost large computation (in cloud extinction) cost large computation time—use time—use look-up table!look-up table!

Page 18: A Simple, Efficient Method for Realistic Animation of Clouds

Controlling cloud motion using Controlling cloud motion using ellipsoidsellipsoids

• Cloud motion can be controlled by Cloud motion can be controlled by PPhumhum, P, Pact act and Pand Pcld.cld.

• When wet air parcels move upwards When wet air parcels move upwards and reach the height of the dew and reach the height of the dew point, clouds are gradually formed. point, clouds are gradually formed. Ellipsoids-air parcelsEllipsoids-air parcels! !

• By controlling ellipsoid parameters By controlling ellipsoid parameters (size and position) different kinds of (size and position) different kinds of clouds can be simulated.clouds can be simulated.

Page 19: A Simple, Efficient Method for Realistic Animation of Clouds

RenderingRendering

• The density distribution of cloudsThe density distribution of clouds is is obtained from simulation.obtained from simulation.

• Images Images are then rendering with are then rendering with OpenGL.OpenGL.

Page 20: A Simple, Efficient Method for Realistic Animation of Clouds

Continuous Density Continuous Density Distribution CalculationDistribution Calculation

• The density distribution of clouds in real The density distribution of clouds in real world is continuous from 0 to 1. Yet the world is continuous from 0 to 1. Yet the simulated one only has two values 0/1.simulated one only has two values 0/1.

----calculate continuous distribution by calculate continuous distribution by smoothing smoothing the binary distribution.the binary distribution.

0

0'

0

0'

0

0'

0

0'

),,,(),,,(

)12)(12)(12)(12(

1),,,(

''''''''

0000

t

tt

k

kk

j

jj

i

ii

i

ttkkjjiicldtkjiw

ijkttkjiq

Page 21: A Simple, Efficient Method for Realistic Animation of Clouds

Hardware-accelerated Hardware-accelerated Rendering Using OpenGLRendering Using OpenGL

• Light reaching the viewpoint Light reaching the viewpoint == the sum of the scattered the sum of the scattered light reaching from the sun on the viewing ray light reaching from the sun on the viewing ray ++ the the attenuated light reaching from behind the cloudsattenuated light reaching from behind the clouds

• The voxel’s color depends on the scattered color of the The voxel’s color depends on the scattered color of the sun, the transmitted color of the sky, and the attenuated sun, the transmitted color of the sky, and the attenuated due to cloud particles. due to cloud particles.

Page 22: A Simple, Efficient Method for Realistic Animation of Clouds

Rendering cloudsRendering clouds

•Textures for billboards are precalculated. Since the attenuation is not proportional to it, the texture has to be prepared for all metaballs when their center densities are different.—memory-consuming!—discretize the density into nq level and prepare nq textures. Here, nq=64.

•The texture corresponding to the nearest density of each metaball is mapped onto the corresponding billboard.

•An image is calculated in two steps: 1.calcualte the intensity of light from the sun at each metaball; the clouds’ shadow are also calculated. 2. the image viewed from the viewpoint is generated.

Page 23: A Simple, Efficient Method for Realistic Animation of Clouds

Rendering cloudsRendering clouds

Calculate the image viewed from the sun direction to obtain the intensity of light reaching the metaball.

Page 24: A Simple, Efficient Method for Realistic Animation of Clouds

• Generate the image using the color of the metaball obtained in first Generate the image using the color of the metaball obtained in first step.step.

• Colors in the frame buffer are multiplied by the attenuation radio of Colors in the frame buffer are multiplied by the attenuation radio of the billboard texture and then the colors in the texture are added.the billboard texture and then the colors in the texture are added.

Page 25: A Simple, Efficient Method for Realistic Animation of Clouds

Rendering shafts of LightRendering shafts of Light

Page 26: A Simple, Efficient Method for Realistic Animation of Clouds

Rendering Shafts of LightRendering Shafts of Light

• Shafts of lightShafts of light are caused by particles in the are caused by particles in the atmosphere. The sunlight passing through the gaps atmosphere. The sunlight passing through the gaps in clouds is scattered by the particles at P. The in clouds is scattered by the particles at P. The scattered light, Is, reaching the viewpoint is scattered light, Is, reaching the viewpoint is recognized as shafts of light. So the recognized as shafts of light. So the scattering/absorption due to the atmospheric scattering/absorption due to the atmospheric particles must be taken into account.particles must be taken into account.

T

sc dsssIsTII0

)()()()( Ic is the cloud color. B(s) is the attenuation ratio due to atmospheric part, r(s) is the attenuation radio due to cloud particles from the sun to P, and Is(s) is the intensity of the light scattered at P due to atmospheric particles.

Page 27: A Simple, Efficient Method for Realistic Animation of Clouds

Rendering shafts of light Rendering shafts of light together with cloudstogether with clouds

sn

ksc sskskIskTII

0

)()()()(

Both the billboard and the shells are transparent objects, they have to be rendered in back-to-front order.

• Calculate the colors of vertices of the polygons of the shells in the viewing pyramid.

• Repeat the following steps for k=ns, ns-1, ….,1

2.1 Render the shell k with additive blending function. Map the shadow texture for polygons under the cloud bottom.

2.2 Render billboards for displaying clouds between the shell k-1 and the shell k.

Page 28: A Simple, Efficient Method for Realistic Animation of Clouds

ResultsResults

Page 29: A Simple, Efficient Method for Realistic Animation of Clouds
Page 30: A Simple, Efficient Method for Realistic Animation of Clouds
Page 32: A Simple, Efficient Method for Realistic Animation of Clouds

ConclusionConclusion• A realistic animation method for cloudsA realistic animation method for clouds

– Cloud motion is simulated using the Cloud motion is simulated using the cellular automationcellular automation. . Shadows and shafts of light are generated by Shadows and shafts of light are generated by OpenGLOpenGL..

– Advantages:Advantages: Simulation of the cloud evolution requires Simulation of the cloud evolution requires smallsmall amount of amount of

computationcomputation--executed by Boolean operations.--executed by Boolean operations. TheThe memory memory requirement of the simulation is small. requirement of the simulation is small. Images can be Images can be rendered quicklyrendered quickly with graphics hardware. with graphics hardware. shadows of clouds and shafts of lightshadows of clouds and shafts of light rendered. rendered.-- Further work-- Further work Considered the effect of terrain under clouds—multiple wind Considered the effect of terrain under clouds—multiple wind

directions/velocity fields;directions/velocity fields; Level of details—hierarchical voxels & coarser voxels faraway-Level of details—hierarchical voxels & coarser voxels faraway-

>less metaballs ->less computation time>less metaballs ->less computation time

Page 33: A Simple, Efficient Method for Realistic Animation of Clouds

Thank you!Thank you!