280 likes | 304 Views
By Jennifer Baulier. Particle-based Fire Simulation & An Intro to Some Other Techniques. Why Fire?. CGI in live action Movies Computer animation Video Games Making virtual environments exciting Fire safety/parts testing. Thinking About Fire. Requirements of a Fire.
E N D
By Jennifer Baulier Particle-based Fire Simulation& An Intro to Some Other Techniques
Why Fire? • CGI in live action Movies • Computer animation • Video Games • Making virtual environments exciting • Fire safety/parts testing
Requirements of a Fire • Fuel: decomposes to gas due to heat but can start in any state • Heat: indicator of motion of an object's molecules • Fast enough motion is what leads to a change in phase • Oxygen: used in combustion, but when it is low flames will become smoke (incomplete oxidization)
“Genres” of Fire • Ambient/Calm • Constant fuel • Few force changes • Freely Fed (most common) • Lots of oxygen and fuel • Small variance over t and x • Violent • Big external forces • Unusual fuel distribution • Pressure Fed • Like freely fed • Velocity vector for fuel as it goes in the air • Explosion • Compressed fuel ignites • Shock waves lead to a chain reaction
Looking at Fire • Black Body Palette describes the radiation from fire • Gas motion is affected by wind, temperature, and thermal buoyancy • Gasses moving at different speeds swirl when interacting • Thermal Buoyancy: force due to differences in air density • Hot gas rises • Turning occurs due to increased drag as the gas cools • Fuel also expands making the fire look full
An Aesthetic Approach • Applications like movies may prefer aesthetic approaches • Dreamworks sponsored research into such a method for Shrek (2002) • Probability was used to model flickering and buoyancy • Artists could adjust wind field noise and other factors • Allows for more dynamic movement • Scales better (making a very large fire wasn't really possible with reasonably detailed physical approaches of the time) • Aspects such as spread were controlled manually
Broad Types of Physical Simulations • Particle based (the first) • Fluid based (primarily Navier-Stokes) • Flame based
Why is this Focused on Particle Systems? • Movies use pipeline rendering where every frame is precomputed • Could take hours to render 1 frame (2007) • Particles still seem to be all that's used in real time • Easily able to scale and adapt • Easy to change the appearance • Randomness can be introduced avoiding repetition
Proof of Particle System's Adaptability • A project was done using Computer Unified Device Architecture for Nvidia GPUs • Rendering directly to the GPU + parallelism • Tested one method of particle movement with different particle primitives & # of particles • Point was to gather speed statistics • More realistic models take longer but that's a trade off 65535 GL POINTS 262144 GL POINTS 16384 particles; CUDA-OpenGL vertex color array 16384 GL TRIANGLES 16384 particles: Texture Mapping 16384 GL PONTS 16384 GL LINES
Rendering Techniques to add Further Variation • Texture Splatting = layering textures at different depths with varying transparencies (opacity map) • Bitmap Splatting = project onto raster and blend new with what was there before • Adding Radiance • Ray tracing
Ray Tracing with Particles • Sphere or blob goes around each particle • Each pixel sends a ray and takes part of it's color from every blob in intersects • A background object gives color too making flame density noticeable
Another method of Ray Tracing • Can instead make a surface around the set of particles • Color each point based on calculated temperature from the particles • Recompute surface with every movement step • More realistic because flames only appear at the surface where oxygen mixes with fuel
Common Attributes used to determine the motion of a Fire Particle • Position [x,y,z] • Velocity [u,v,w] • Mass (m) • Temperature (t) • Life Time (T) • Can start with basic F = MA • Realistically would have damping force due to viscous drag • Other forces will vary based on the complexity of the specific simulation
First Commercial CGI Explosion • Star Trek “The Wrath of Khan” • Particle based but couldn't yet be real time • Spawn points in concentric circles on the surface of the moon • Rings activate over time to show spreed • Particles are small straight lines • Particle's velocity angle and magnitude are normally distributed within a cone about the spawn's normal
Star Trek Continued Wrath of Khan video • Moves like projectile under gravity • On a moon gravity would be opposite the normal • Dies before parabolic motion is noticeable • The range of possible velocity at a spawn point may decrease over time • Over time the particle's color changes according to the black body palette • There is a light over the moon that increases range to always shine just outside the spread of the fire
How to Create More Realistic Movement Systems • Gas particles rise, spread out, and swirl not move like projectiles • To create some of these properties fields are required • For a 2D environment attributes will be assigned to squares in a grid • For a 3D environment space will be discretized into shapes such as voxels and each voxel which will have attributes assigned to them • Gas swirling doesn't really occur without fluid simulation techniques
Ways fields can be used • Different forces will be attributes of the grid space the particle is in, and these will be added to the summed Force used in the Euler or RK methods • Force fields can simulate wind, other external forces, and ensure rising • A voxel can have a pressure force based on number of particles: creates diffusion/spread • Needs to be recomputed every frame • Some randomness in the force field can simulate turbulence • Velocity fields directly set the particles velocity while in a grid space • Create stream lines for particles, though on their own will always be the same • Combining these can create more complex looking motion
A specific Example that Uses a Field to Determine Motion • “Real Time Fire Simulation” University of Texas • User chooses 2D shape for the fuel • Also picks a spawn point • Particle spawn position follows a Gaussian distribution • Movement: • Thermal buoyancy • Brownian motion • User defined wind field
More on the Motion in this example ai=cbri + ctTij + w ai = acceleration of particle i cb = a coefficient for Brownian Motion ri = a random vector (x,y,z) ct = a coefficient for thermal Buoyancy Ti= temperature of the particle i j = the z unit vector w = wind and other other external forces • Brownian motion creates some turbulence • Buoyancy = primarily vertical movement • The particle's T decreases a random amount every step • Cools faster far away from the source & other particles • When cool enough a particle becomes smoke (different movement) • m is max over all particles • c indicates the spawn point • x,y,z are the coordinates • i is the current particle • C1,C2 < 1 is a coefficient
Fluid-based Simulation (overview) • 3 major fields: Velocity, Density, and Temperature • Each field is defined using partially differentiable Navier-Stokes equations • Navier-Stokes equations are based on • Newton's 2nd law Force = change in momentum • A fluid's stress being based on viscosity & pressure • Fields frequently need to be recalculated (A fluid based simulation using Navier-Stokes that runs solely on the GPU)
Flame Based Simulation (Overview) • The flame itself is a primitive • Has a more distinct outline • Fire's boundary vertices spreads • -Velocity of vertices is based on surface orientation, amount of oxygen, and density of fuel • May not always need to recompute boundary hull • If an area is too sparse remove boundary vertex
Modeling Flames • Flames sit inside burning zone's surface • Skeleton of flame changes based on an air velocity field • Vertices solved for using Euler's method • Flame may change size over time • Modify length of skeleton not just vertex positions • If air turbulent enough allow part of the skeleton to break off
Displaying Flames • Define an implicit surface • Compute color using iso surfaces based on the distance from the base • Render with ray tracing
Other Phenomenon Needed for full Realism • Smoke • Burn marks • Decomposing • Crumbling/cracking • Bending • Realistic Spread based on flammability of items
Article and Website Citation • Kruijf, Mark de. (2007). 'firestarter – A Real Time Fire Simulator'. Computer Science Capstone, The University of Wisconsin, Madison. • Foster N., Metaxas D. (1997). “Modeling the motion of a hot, turbulent gas.” Proceedings of the 24th annual conference on Computer graphics and interactive techniques, August 1997. • Nguyen, D., Fedkiw R., Jensen H. (2002). “Physically based modeling and animation of fire.” Proceedings of the 29th annual conference on computer graphics and interactive techniques, San Antonio, Texas, July 2002. • Nielsen, T. E. (1999). “Modeling, animation, and visualization of fire.” Master's thesis, University of Copenhagen, Denmark, April 1999. • "Circus High-Diving with Virtual Reality Marketing Bar Tour!" <i>Inition</i>. 30 May 2014. Web. 25 Nov. 2014. <http://www.inition.co.uk/inition-critical-mass-collaborate-virtual-high-dive-experience/>. • Lamorlette A., Foster N. (2002). “Structural modeling of flames for a production environment”, Proceedings of the 29th annual conference on Computer graphics and interactive techniques, San Antonio, Texas, July 2002. • Gillies, Duncan. "Graphical Simulation of Fire." Graphics, Lecture 17. Imperial College of London Department of Computing. London. Lecture. <https://www.doc.ic.ac.uk/~dfg/graphics/GraphicsLecture17.pdf>. • Reeves et al (SIGGRAPH 1983 17(3) 359-376). • Cutler, Barb. Computer Animation & Particle Systems" Advanced Computer Graphics. RPI. Rochester, NY. Lecture. <http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/F05/lectures/08_particle_systems.pdf>. • Santikonga, Sarayuth. (2009). “Real-time Fire Simulation” thesis, University of Texas, San Antonio,2009. • "Stack Effect." Wikipedia. Wikimedia Foundation, 24 Nov. 2014. Web. 26 Nov. 2014. <http://en.wikipedia.org/wiki/Stack_effect>. • Lyes, T.S. and Hawick, K.A. (2013). “Fire and Flame Simulation using Particle Sytems and Graphical Processing Units”, Massey University, Auckland, New Zealand, February 2013. <http://worldcomp-proceedings.com/proc/p2013/MSV2342.pdf> • P. Beaudoin, S. Paquet, P. Poulin (2001). Realistic and Controllable FireSimulation. Universite de Montreal, 2001. • Steinemann, Denis. "Simulation and Animation of Fire." (2002). Computer Graphics Laboratory, ETH, zurich. Lecture. <http://graphics.ethz.ch/Downloads/Seminar_Arbeiten/2002_03/steinemann_fire.pdf>. • "Navier–Stokes Equations." <i>Wikipedia</i>. Wikimedia Foundation, 12 Jan. 2014. Web. 1 Dec. 2014. <http://en.wikipedia.org/wiki/Navier–Stokes_equations>.
Image and Video Citation • Harry Potter and the Goblet of Fire • Toy Story 3 • Fire Eater (fire rings). Web. <http://www.inition.co.uk/inition-critical-mass-collaborate-virtual-high-dive-experience/> • New Super Mario Bros • Parts of a fire diagram <http://intraweb.stockton.edu/eyos/namslabs/content/images/health_safety/tetra.jpg> • Candle <https://creditingmarvels.files.wordpress.com/2013/10/candle-1.jpg> • Burning buildings <http://blog.burningman.com/wp-content/uploads/2012/09/blog4.jpg> • Wind blown fire<http://achangeinthewind.typepad.com/.a/6a00d8341c7b3653ef010535f56e07970c-800wi> • Boiler <http://www.trianglebiofuels.com/blog/wp-content/uploads/2012/10/firetube-boiler.jpg> • Independence Day • Black Body Radiation image: Nielsen, T. E. (1999). “Modeling, animation, and visualization of fire.” Master's thesis, University of Copenhagen, Denmark, April 1999. • Shrek • Texture Splat Image: Wei X., Li, W., Mueller, K., Kaufman, A. (2002). “Simulating fire with texture splats.” Proceedings of the conference on Visualization '02, October 27-November 01, 2002, Boston, Massachusetts • Fountain, velocity Cone, ray tracing <https://www.doc.ic.ac.uk/~dfg/graphics/GraphicsLecture17.pdf> • Star Trek Wrath of Khan • Cocentric Circles on a planet<http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/F05/lectures/08_particle_systems.pdf> • Gaussian Distribution: <http://books.google.com/books?id=lODW3QEmi6oC&pg=PA8&lpg=PA8&dq=simulating+fire+with+particles&source=bl&ots=9zrjeM8ghY&sig=RuP9Bf5oPQb2O7S4O_fprYDIwQA&hl=en&sa=X&ei=p5QXVJX9AYqQsQSeo4CYDQ&ved=0CDAQ6AEwAjgK#v=onepage&q=simulating%20fire%20with%20particles&f=false> • Particle Sytems modeled with different GL primatives, VBOs, and texture maps <http://worldcomp-proceedings.com/proc/p2013/MSV2342.pdf> • YouTube. “GPU fluid simulation – fire”. Online Video Clip. Youtube, November 24,2007. Web. November 25, 2007. <https://www.youtube.com/watch?v=ZgoDypGMV50> • Flame base method pictures and diagrams: Lyes, T.S. and Hawick, K.A. (2013). “Fire and Flame Simulation using Particle Sytems and Graphical Processing Units”, Massey University, Auckland, New Zealand, February 2013. <http://worldcomp-proceedings.com/proc/p2013/MSV2342.pdf> • Flame based method diagrams may have been originally from: P. Beaudoin, S. Paquet, P. Poulin (2001). Realistic and Controllable FireSimulation. Universite de Montreal, 2001 • Images of other effects (last slide) <http://research.cs.tamu.edu/keyser/Papers/MelekDissertation.pdf>. • Navier-Stokes Equations: <http://en.wikipedia.org/wiki/Navier%E2%80%93Stokes_equations>