Smulaton and Anmaton of Fre Overvew Presentaton n Semnar on Motvaton Methods for smulaton of fre Physcally-based Methods for 3D-Games and Medcal Applcatons Dens Stenemann partcle-based flud-based flame-based Flame-based smulaton of fre fre propagaton flame anmaton renderng and modellng Results Dscusson Motvaton Methods: Requrements What s fre? Fuel undergong a chemcal reacton and beng converted nto hot gas hot gas moves opposed to gravty and follows external wnd essentally methods model hot gas Why smulate fre? Dangerous, not easy to control n real-world sometmes, t s mpossble to create a real-world model (for example, how does fre propagate n a buldng? adds vsual realsm to 3D-Applcatons Games, moves realstc appearance user should be able to nteract wth fre fre spreads n space scalablty: method should work for small and for large fres controllable, easy to handle user-parameters trade-off: concentraton on realstc vsual behavor, but faster physcally correct, very realstc, but also very slow 3 4
Methods (: partcle-based Model fre usng partcles: Hot gas as partcles n user-defned velocty feld u(x, Methods (: partcle-based Warped-blobs technque: change shape of partcle over tme u(x, Render partcles (just some examples wth polygons: change aspect rato over tme Partcle-based methods: Advantages: qute fast, realstc Dsadvantages: need many partcles; fuzzy outlnes [Perry,Pcard] Demos Stam 5 6 Methods (: flud-based Methods (: flud-based Model fre usng vector/scalar felds descrbed by partal dfferental equatons (PDE Computatonal Flud Dynamcs (CFD: usually three felds: Velocty u( x, for water & smoke, these two suffce Densty ρ(x, Temperature T ( x, felds descrbed by Naver-Stokes equatons: v = ( v v + ν v + f t ρ = (v ρ + κ ρ + S t T = (v T + c T + H t advect dffuson sources (user-defned 7 Naver-Stokes equatons hold for any flud for fre, we also need temperature, because t determnes the color of the fre (wavelength of lght depends on temperature Solve equatons (expensve!; update felds usng Euler, etc. the densty feld s rendered, usng temperature to determne color (yellow fre, blue fre, smoke? Renderng by Raytracng Advantages: physcally correct, very realstc; shows smoke Dsadvantages: very slow (5mn per frame, complex handlng Demos: Fedkw 8
Methods (3: flame-based Overvew sngle flame as fre prmtve represent fre as a set of flames Advantages: faster (avod solvng very costly PDE, scalable, realstc, sharp outlnes Dsadvantages: not physcally correct (concentraton on vsual behavor, not as realstc as wth CFD Motvaton Methods for smulaton of fre partcle-based flud-based flame-based Flame-based smulaton of fre fre propagaton flame anmaton renderng and modellng Results Dscusson [Beaudon,Paquet,Pouln] 9 0 Flame-based smulaton of fre Fre propagaton I wll now explan a flame-based method n detal Paper: Realstc and Controllable Fre Smulaton Phlppe Beaudon, Sébasten Paquet, Perre Pouln Unversté de Montreal Man vsual feature n fre propagaton s growth of burnng zone Growth depends on an few locally defned parameters: Fuel densty Oxygen supply Surface orentaton relatve to gravty Dvde smulaton of fre nto 3 subproblems: Fre propagaton Flame geness and anmaton Renderng and modellng Our goal s to track the boundares between parts of an object that are burnng and those whch have not yet been reached by the fre 3
Fre propagaton Fre propagaton Use closed curve on an object surface very often, surface s a closed trangle-mesh closed curve represented as a broken lne Boundary vertces have Poston x( broken lne wll never leave the surface! Velocty v(x,, depends on local params (fuel, surface orentaton Intal state: many vertces at gnton pont, but each wth a dfferent v nt pontng radally outward n plane of ntal face Gven v of boundary vertex, compute new poston x : two possble cases: x (t+h les on same face as x ( ok x (t+h les outsde of the face adjust x (t+h, usng new velocty v v = η N v N ( x ( t + h = x ( + h v ( v : org. velocty; N : lnearly nterpolated normal at crossng pont η chosen to preserve magntude of velocty N : normal to destnaton face 3 4 Fre propagaton Fre propagaton n all cases, the followng hold: Drecton of velocty does not change when orgn and destnaton faces are coplanar v s nonzero and orented away from the crossed edge contnuty of curve s preserved Burnng zone grows over tme boundary expands wth each tme step -step update:. Move vertex accordng to velocty, changng drecton of v f necessary. Insert new vertces f necessary to force curve to stay on surface compute new vertex by usng bnary search to fnd pont on orgnal lne that s dsplaced drectly onto edge (velocty nterpolated from endpont veloctes 5 6 4
Fre propagaton Fre propagaton Boundary vertces may become sparse/dense nsert/delete vertces f that s the case v s defned by local parameters. Allow only change n magntude of v, not n drecton, so that the burnng zone doesn t shrnk n the next step, we wll also need ponts nsde the burnng regon for a gven lne segment, dsplace random pont on segment just lke boundary vertex, but wth nterpolated velocty and a tme step [0..h] Evoluton of a (fre front: Relatvely complex cow model; 5804 trangles [Beaudon,Paquet,Pouln] Demos: Beaudon 7 8 Overvew Flame Geness and Anmaton Motvaton Methods for smulaton of fre Now that we know how fre propagates on a surface, t s tme to generate and anmate the actual fre: sngle flame as fre prmtve partcle-based flud-based flame-based Flame-based smulaton of fre fre propagaton flame anmaton renderng and modellng Results Dscusson represent fre as a set of flames Flame = stream of gas that follows the ar surroundng t Represent a flame as a chan of connected partcles that moves accordng to some user-defned ar velocty feld. Ths chan s called skeleton. skeletons dancng n the wnd 9 0 5
Flame Geness and Anmaton 5 steps to set up flame skeletons:. defne ar velocty feld. plant flames on surface 3. defne flame skeletons 4. grow/shrnk flames 5. allow for detached flames Flame Geness and Anmaton. Defne an ar velocty feld V(x, User-defned general form: b blendng functon; constant or smoothly n [0..] lets user treat specfc features of anmated fre separately by gvng each V certan characterstcs an example: V( x, b ( x, V ( x, = n = 0 V( x, = kg + V ( x, V ( x, L + S -kg large-scale wnd-feld V L small-scale turbulences V S Flame Geness and Anmaton Flame Geness and Anmaton. Plant flames on surface, nsde burnng zone use extra ponts nsde burnng zone that were addtonally created durng the evoluton of the fre front 3. Defne flame skeleton we have: - root of flame -velocty feldv(x, we want: curve segment s(u, every pont tangent to nstantaneous V(x s(u ds V ( s = du vary ntensty of fre by varyng densty of ponts nsde burnng zone ds s(u s the soluton of the dfferental equaton V ( s =, s(0 = du 3 4 6
Flame Geness and Anmaton n general, s(u s hard to fnd analytcally skeleton s a broken-lne approxmaton of s(u s( u s s 3 s solve numercally usng Euler skeleton vertces: s = s(u l( s = s ( + V s + n s( u s 3 s V( s s n predefned, (n<0; n+ = # of vertces n skeleton l( determnes length of skeleton (see later Flame Geness and Anmaton Problem: skeleton may penetrate object, because V(x, does not consder geometry adjust vector feld locally by addng vector N normal to the surface at root s s s s V( x, N N large enough for s to be outsde of object 5 6 Flame Geness and Anmaton Flame Geness and Anmaton 4. Grow and shrnk flames for realstc behavor, flames are newly created and may dsappear after some tme for ths, use length functon l( length functon depends mostly on fuel ( fuel map on surface examples: l( explosve, fast burnng t l( slow, steady burnng t technque descrbed so far works well for quet flames n hghly turbulent fres, flames can take off nto the ar, drft upwards for some tme and then dsappear 5. Detach flames f at a vertex s of a skeleton, V s > threshold nsert new flame whose root equals s and s free the root then can move wth the velocty feld n tme, updated at every tme step: s0( t + h = s0( + h V( s0(, Use new to create entre flame as before ( vary peak of length functon for dfferent flames to make fre look more realstc ( s V s 7 8 7
Overvew Snce detached flames have short lfe span, adjust ther length functon Skeletons are well-suted for quck prevewng, whch speeds up the teratve process of obtanng the desred effects Demos: Beaudon [Beaudon,Paquet,Pouln] Flame skeletons on a burnng sphere Motvaton Methods for smulaton of fre partcle-based flud-based flame-based Flame-based smulaton of fre fre propagaton flame anmaton renderng and modellng Results Dscusson 9 30 Renderng and Modellng Renderng and Modellng Skeletons are good for prevewng, but they are not suffcent for photorealstc renderng dress up the skeletons 4 steps:. Defne mplct surface whch descrbes the outlne of a sngle flame. use mplct surfaces of sngle flames to model a complete fre 3. model color varatons seen nsde fre 4. render the fnal mage. Defne mplct surface physcal analogy: electrcal potental nduced by a unformly charged rod E (x: potental of x, nduced by segment of the skeleton E = = s s z (x and r (x: cylndrcal coordnates of x relatve to segment for a complete flame, potentals add up: E d d ( p z p= 0 + = snh z snh r = n E = r z d p d r 3 3 8
Renderng and Modellng Problem: E(x does not dstngush between root and top of flame, but flames are thn at the top and bulged at the root transform x to heght-dependent x (x: s x n x (x r(x z(x x z( x x = x + exp r( x d d = sn Renderng and Modellng. Use mplct functons to model complete fre Puttng t all together: Flame: I s ( x = E( x Fre: I = I s I s I s I(x z(x and r(x: cylndrcal coords of x relatve to segment (,s n use E(x (x nstead of E(x near top of flame, x (x s farther away from the skeleton than x E(x (x smaller than E(x so-surface closer to skeleton two so-surfaces I s (x,i s (x=v new so-surface I(x=I s (x+i s (x=v 33 34 Renderng and Modellng Renderng and Modellng we have the shape of flames (and fre now we also want color Color depends on temperature (fre emts radaton of dfferent wavelength. Temperature n flame manly depends on dstance to base and to the center of the flame 3. Compute so-surfaces to model color varaton Compute so-surfaces of I(x we get enclosed surfaces to each of whch we can assgn a color 4. Render fre usng so-surfaces use raytracng (raycastng cast rays toward polygons of so-surfaces calculate length of a ray nsde each layer add up color contrbutons from dfferent layers for each ray omt lght-scatterng nsde fre use marchng-cubes algorthm to obtan a closed (polygon surface 35 36 9
Renderng and Modellng Results That s how t fnally looks: Surfaces wth a few hundred trangles, 400MHz, 56MB RAM Propagaton: 5 fps Skeleton anmaton (00 skeletons: 4 fps Complete wth renderng: 4 frames per mnute Not real-tme, but compared to flud-based methods, flame-based approach s much faster [Beaudon,Paquet,Pouln] Demos: Beaudon 37 38 Dscusson Dscusson Features of ntroduced flame-based method: sleek, smooth outlnes relatvely smple, but nonetheless realstc fast allows for quck prevewng (skeletons easly scalable features ntutve handlng Lmtatons: Fre cannot spread to other, dsconnected objects start new propagatons on other objects Renderng rather smple (no self-lghtng, no llumnaton of other objects by fre no smoke Further Possbltes: Charrng draw a black splat on object surface when flame becomes extnct [Perry,Pcard] 39 40 0
References [] P. Beaudon, S. Paquet, P. Pouln. Realstc and Controllable Fre Smulaton. 00. [] C.H. Perry and R.W. Pcard. Syntheszng flames and ther spreadng. In Ffth Eurographcs Workshop on Anmaton and Smulaton, pages 05-7, September 994. [3] J. Stam and E. Fume. Depctng fre and other gaseous phenomena usng dffuson processes. In SIGGRAPH 995 Conference Proceedngs, pages 9-36, August 995. [4] D.Q. Nguyen, R. Fedkw, and H.W. Jensen. Physcally Based Modellng and Anmaton of Fre. 00 4