• No results found

Art Directed Fluid Flow With Secondary Water Effects

N/A
N/A
Protected

Academic year: 2021

Share "Art Directed Fluid Flow With Secondary Water Effects"

Copied!
45
0
0

Loading.... (view fulltext now)

Full text

(1)LiU-ITN-TEK-A--12/055--SE. Art Directed Fluid Flow With Secondary Water Effects Lukas Lundberg 2012-09-14. Department of Science and Technology Linköping University SE-601 74 Norrköping , Sw eden. Institutionen för teknik och naturvetenskap Linköpings universitet 601 74 Norrköping.

(2) LiU-ITN-TEK-A--12/055--SE. Art Directed Fluid Flow With Secondary Water Effects Examensarbete utfört i medieteknik vid Tekniska högskolan vid Linköpings universitet. Lukas Lundberg Handledare jonas Unger Examinator Stefan Gustavson Norrköping 2012-09-14.

(3) Upphovsrätt Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare – under en längre tid från publiceringsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/ Copyright The publishers will keep this document online on the Internet - or its possible replacement - for a considerable time from the date of publication barring exceptional circumstances. The online availability of the document implies a permanent permission for anyone to read, to download, to print out single copies for your own use and to use it unchanged for any non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional on the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its WWW home page: http://www.ep.liu.se/. © Lukas Lundberg.

(4) Abstract This thesis describes methods for applying secondary water effects as spray, foam, splashes and mist to a fluid simulation system. For an art direction control over the base fluid flow a Fluid Implicit Particle solver with custom fields is also presented. The methods build upon production techniques within the visual effects industry, fluid dynamics and relevant computer graphics research. The implementation of the methods is created within Side Effects Software Houdini..

(5) Acknowledgments I would like to thank everyone at Side Effects Software for the support and inspiration during my thesis work and internship in the Santa Monica office. I also would like to thank my supervisor at Link¨oping University, Stefan Gustavson. As well my family and friends for the encouragement..

(6) Contents 1. Introduction ............................................................................................................................... 1.1 1.2. Motivation.............................................................................................................................. Work Environment................................................................................................................. 1.2.1 Company . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline of Report.................................................................................................................... 1 1 1 1 1. Related Work.............................................................................................................................. 3. 1.3 2. 2.1 2.2 2.3 2.4 2.5 2.6 3. Particle Systems..................................................................................................................... FLIP Fluid Solver .................................................................................................................. Art Directed Flow .................................................................................................................. Secondary Water Particle Generation .................................................................................... Surface Collision Handling ..................................................................................................... Fluid Simulation Frameworks ................................................................................................. 3 3 4 4 5 5. Technical Background ............................................................................................................... 7. 3.1 3.2. 3.3. 4. Particle System Model ........................................................................................................... Fluid Dynamics...................................................................................................................... 3.2.1 Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Navier-Stokes Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Fluid Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4 Fluid Implicit Particle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Secondary Water Effects Model ............................................................................................. 3.3.1 Emission Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 Surface Collision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 Spray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.4 Foam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.5 Mist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 7 8 8 9 11 12 13 13 14 14 14 14. Houdini Overview ..................................................................................................................... 15 4.1 4.2 4.3 4.4. 4.5. 4.6 4.7 5. 1. Procedural Framework ........................................................................................................... Operator Domains.................................................................................................................. Data Flow .............................................................................................................................. Geometry ............................................................................................................................... 4.4.1 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.3 Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dynamic Network .................................................................................................................. 4.5.1 Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.2 Microsolvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.3 Multiple Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.4 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.5 Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.6 Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VOPs Domain ........................................................................................................................ 4.6.1 Point Clouds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Digital Assets .......................................................................................................................... 15 16 16 17 17 18 18 18 18 18 18 18 19 19 19 19 19. Implementation ......................................................................................................................... 20 5.1. Setup Modeling ...................................................................................................................... 20 3.

(7) 5.2. 5.3 5.4 5.5. 5.6 6. 5.1.1 Collision Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.2 Emission Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Building the FLIP Solver ....................................................................................................... 5.2.1 Initialize the Particle System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Velocity from Particles to the Field . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 Solving Navier-Stokes for the Velocity Field . . . . . . . . . . . . . . . . . . . . . . 5.2.4 Velocity from Field to Particles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.5 Surface Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6 Collision Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Particle Surface Collision Detection....................................................................................... Custom Velocity Field............................................................................................................ Secondary Effects ................................................................................................................... 5.5.1 Emission Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2 Particle Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.3 Spray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.4 Foam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.5 Mist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.6 Splashes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tool Building .......................................................................................................................... 20 21 21 22 22 23 23 23 24 25 25 27 27 28 28 29 29 31 31. Results......................................................................................................................................... 32 6.1 6.2 6.3. Performance ........................................................................................................................... Discussion .............................................................................................................................. Conclusion.............................................................................................................................. 6.3.1 Future Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 4. 34 35 36 36.

(8) List of Figures 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38. Reeves method implemented for a Genesis particle effect in the science fiction movie Star Trek: The Wrath Of Khan. Figure taken from [4]. . . . . . . . . . . . . . . . . . . . . . . FLIP solver simulating liquid and sand. Figure taken from [6]. . . . . . . . . . . . . . . . Rhythm & Hues proprietary system FELT, and in production for the feature Land of the Lost. Figures taken from [7] [12]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CG ocean with secondary water effects from the movie Poseidon. Figure taken from [10]. Naiad river simulation. Figure taken from [14]. . . . . . . . . . . . . . . . . . . . . . . . . RealFlow liquid render. Figure taken from [15]. . . . . . . . . . . . . . . . . . . . . . . . . Final render and concept art for a dam break in the movie Tangled. Figure taken from [17]. Scalar density field and the corresponding vector velocity field from a wispy smoke simulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Signed Distance Field of a teapot geometry. . . . . . . . . . . . . . . . . . . . . . . . . . . Green gradient vectors of a scalar field pointing towards the highest differences in the field. An Eulerian volume representation of a smoke fluid simulation. . . . . . . . . . . . . . . . A Lagrangian SPH representation of a liquid fluid simulation. Figure taken from [20]. . . Reflection illustration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Houdini’s FLIP fluid solver network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Geometry attribute overview. Figure taken from [1] . . . . . . . . . . . . . . . . . . . . . Overview workflow chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Mountain SOP attached to an extruded polygon grid. . . . . . . . . . . . . . . . . . . Visualized FLIP velocity field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Surface and Collision field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Surface and Collision field visualized during simulation in DOPs . . . . . . . . . . . . . . Particle Surface Collision Detection before and after. Particles visualized as vectors, red inside the collision field and blue outside. . . . . . . . . . . . . . . . . . . . . . . . . . . . Polygon shapes with corresponding velocity fields. . . . . . . . . . . . . . . . . . . . . . . Secondary simulation Billowy smoke velocity field. . . . . . . . . . . . . . . . . . . . . . . Overview secondary effects workflow chart. . . . . . . . . . . . . . . . . . . . . . . . . . . Visualization of the criteria; curvature, vorticity and velocity (upward and maximum) . . Spray simulation with emitters for foam and mist visualized. Spray in white, foam emitters in green and mist in red. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Foam mask from Point Cloud sampling the foam simulation, and a shader example with displacement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Lookup curve used for sampling the current age state. . . . . . . . . . . . . . . . . . . . . Sprites visualized on a mist simulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview splashes workflow chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FLIP simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FLIP simulation with path field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FLIP simulation with smoke field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spray simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Foam simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mist simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Splash simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spray, Foam and Mist simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 5. 3 4 4 5 5 6 6 8 9 9 11 11 14 15 17 20 20 22 24 24 25 26 26 27 28 29 29 30 30 31 32 32 32 33 33 33 33 34.

(9) Chapter 1 1. Introduction. This chapter purpose is to introduce the topics and the structure of the thesis.. 1.1. Motivation. Fluids are physical phenomena that comes in infinite shapes and characters. It can be a stormy ocean with spraying white caps and foamy patterns, a strong fierce flowing river that splashes down the rocks of a mountain with a dissipating fog, or a harmonic string of water with trails of drops dripping down. This phenomena is often used within a story to add realism and drama because of the wide selection of characters and features. With todays technology in computer graphics we are now able to simulate the realistic and the complex behavior of a fluid. The fluid simulation field have grown over the years and can now be seen almost everywhere within movies, commercials and video games. Games are often required to be in real time, this results in a demand for a quick computation of the simulation and limits the resolution and the features for the fluid. Fluid simulations intended to be in movies do not have the real time limit, which let us use heavy simulations and also the ability to process the simulation with additional effects afterwards. Art directing and visualizing these effects is essential when working with a production. The supervisor often needs a quick and clear idea how the shot will turn out throughout the stages. The purpose of the thesis is to present methods and models that are suitable to simulate a selection of secondary water effects as spray, foam, splashes and mist. For this a custom built fluid system is presented as well with an art directable control of the base flow. The aim of the thesis is to give a set of art direct friendly tools to add realism and details to a liquid fluid simulation.. 1.2. Work Environment. The main work and research of this thesis was carried out during an internship at Side Effects Software [1], Santa Monica CA, USA. 1.2.1. Company. Side Effects Software is the creators of the simulation and procedural animation software for visual effects Houdini, and the production class renderer Mantra. 1.2.2. Software. The resulted tools was created as subnetworks within Houdini’s node based system with its scripting languages Hscript, VEX and Python [2]. Houdini’s renderer Mantra was used for rendering and The Foundry’s software Nuke [3] was used for compositing the resulting images.. 1.3. Outline of Report. Below is a brief overview of the chapters,. Chapter 1 Introduction of the thesis, company, motivation, aim and software used.. Chapter 2 Related work is presented that the thesis is based on.. 1.

(10) Chapter 3 Technical background for the methods that the implementation is based on is described.. Chapter 4 Houdini technical overview is explained for prerequisite purposes in the implementation chapter.. Chapter 5 The implementation of the methods in Houdini networks is explained.. Chapter 6 The results of the implementation is presented and discussed.. 2.

(11) Chapter 2 2. Related Work. This chapter’s purpose is to give the reader an overview of the context used for modifying a fluid solver motion flow and for implementing the secondary water effects. Previous and related work is presented such as particle systems, fluid dynamics, art directed velocity fields and surface collision handling. Relevant fluid simulation frameworks are also discussed.. 2.1. Particle Systems. In 1983 Reeves [4] presented a method for modelling fuzzy objects, in other words particle effects for example fire and explosions. The method was first used in the movie Star Trek: The Wrath Of Khan as can be seen in Figure 1, and have been used for particle systems in video games and in visual effects since.. Figure 1: Reeves method implemented for a Genesis particle effect in the science fiction movie Star Trek: The Wrath Of Khan. Figure taken from [4]. The group of particles from a particle system can be used to define and shape the volume of an object, for example a water drop. The particles have an individual motion controlled by a procedural equation, for example a fluid equation, which affect the appearance of the entire volume. Particle choreography was introduced by Sims [5], where he introduced several methods to model particle system motions but without the particle interaction. With this technique he presented a waterfall example where the particle interaction was not the essential. In a fluid simulation the particle choreography and the interaction between the particles is fundamental for a convincing fluid motion. Particle systems are used in many context in computer graphics for example positioning instances, creating trails of particles and in fluid simulations.. 2.2. FLIP Fluid Solver. Fluids can appear with certain features and behave differently depending on its content. A fluid solver is a model that solves a set of equations for describing a fluid phenomena as smoke, fire and liquids. Different types of representation for the fluid solver determine the characteristic behavior and the features that are desired. The Fluid Implicit Particle(FLIP) solver is a modification of the Particle in Cell(PIC) method that describes a fluid system. For calculating the fluid motion the incompressible Navier-Stokes flow equations are solved. The PIC method is a hybrid between a particle and a volume fluid based approach and have been modified and extended over the last decades. In 1986 the FLIP method was introduced by Brackbill and Ruppel. They presented a modified PIC method with a more accurate representation of fluids with minimized numerical dissipation. Zhu and Bridson introduced incompressible flow to the method in 2005 which was originally designed for simulating sand [6] as can be seen in Figure 2, and was implemented as such in Houdini 10 in 2009. In 2010 Houdini 11 was released and the sand FLIP solver was redesigned to simulate liquids as its main purpose. A FLIP simulation tend to give a splashy behavior because of its hybrid particle feature. The FLIP model has been studied and explored for this thesis.. 3.

(12) Figure 2: FLIP solver simulating liquid and sand. Figure taken from [6].. 2.3. Art Directed Flow. Art directing a complex fluid simulation is a difficult challenge. The heavy computation and the laws of physics the simulation is constrained to makes it often hard for the artist to get in control. A proprietary system: FELT, developed by the visual effects studio Rhythm & Hues [7] creates, combines and manipulates 3d fields. These custom fields are then used for controlling how particles will flow during a simulation. Modifying the resulting fields as the velocity from a simulation based on a physics equation may alter the realism, but the goal in visual effects is more often about pleasing the eye than a physical correct simulation. The FELT technique was used for controlling particles in the movie The Incredible Hulk and for creating a fluid vortex effect in the movie Land of the Lost as can be seen in Figure 3.. Figure 3: Rhythm & Hues proprietary system FELT, and in production for the feature Land of the Lost. Figures taken from [7] [12]. Implementing irregularity in the custom velocity field based on attributes from the fluid simulation adds to additional control of details. Creating turbulent velocity based on a perlin noise pattern was introduced in the paper A Curl-Noise for Procedural Flow which the FELT technique also uses. [8]. 2.4. Secondary Water Particle Generation. There are several approaches for generating of secondary water particles. In the paper Realistic Animation of Fluid with Splash and Foam [9] a method is described for generation of splashes and foam particles based on a base fluid simulation. Splashes and foam particles are generated with an interpolation of the base fluid simulation velocity as when a certain criteria exceed a threshold. The criteria are based on custom variables conditions and in the paper the surface curvature for the emission factor was considered. The spawned particles go through different models with rules over their finite life span. For example a spray particle that falls into the main body of water can be considered being foam and follows the floating foam model instead of the previous explosive spray model. 4.

(13) An additional secondary effect was used by Industrial Light & Magic for the movie Poseidon [10]. They presented a volumetric mist effect that is emitted at the end of the particle finite lifespan as can be seen in Figure 4.. Figure 4: CG ocean with secondary water effects from the movie Poseidon. Figure taken from [10].. 2.5. Surface Collision Handling. An approach for handling particle collisions against a moving fluid surface was presented by Sony Pictures Imageworks [11] for the feature Spider-Man 3. Implicit surface representation of the Sandman character geometry determines if a sand particle has collided with the dissipating model.. 2.6. Fluid Simulation Frameworks. The fluid simulations within visual effects have grown over the years to become an important feature for several commercial 3d animation softwares. There are several applications that allow the user to simulate fluids and a few of them have a more extended fluid solver as Exotic Matters Naiad, Next Limits RealFlow and Side Effects Houdini. The three mentioned softwares have the capacity to simulate highly detailed fluids from their fluid solver which two of them are based on the earlier mentioned FLIP method. Depending on the content the simulated fluid is desired for, a or several suitable frameworks can be chosen. Contents to consider as resolution and details of the fluid, environment interaction, time span of project, as well the need for art directing the fluid shape and motion for a shot. Exotic Matters Naiad Naiad is a dynamic simulation framework that is dedicated to the simulation of fluids. The main fluid solvers within Naiad use a FLIP approach. The software is capable of simulating highly detailed simulation with environment interaction as can be seen in Figure 5. Additional secondary effects as foam and splashes can be added to the fluid node network as well. Naiad was designed to primary fit into a studio fluid pipeline as the software has support for all the major 3d animation software’s. Several major visual effects studios has used Naiad in their fluid pipeline for example Weta Digital and Industrial Light & Magic. [13]. Figure 5: Naiad river simulation. Figure taken from [14].. 5.

(14) Next Limits RealFlow Another framework dedicated to simulating fluids is Next Limits RealFlow. RealFlow’s main fluid solver Hybrido uses the SPH(Smoothed Particle Hydrodynamics) particle approach combined with an implicit grid solver. The fluid solver can generate spread out highly detailed simulations for smaller scale fluids as can be seen in Figure 6, and have the ability to produce secondary effects. RealFlow is also capable of simulating rigid bodies dynamics and it has its own renderer Maxwell. RealFlow have a lighter artist friendly designed workflow compared to the other major fluid simulation software, which makes it often attractive for shorter projects within the commercial industry with tighter deadlines and usually less complex shots. [15]. Figure 6: RealFlow liquid render. Figure taken from [15]. Side Effects Houdini Houdini is a procedural dynamic simulation framework. The framework is also capable of simulating highly detailed fluids with its fluid solvers among the FLIP. Houdini has several procedural domains for example dynamics, modeling and rendering. Between these domains information can be passed along and modified making Houdini a powerful tool for building custom fluid systems with secondary effects. In Pixar’s movie Cars 2 Houdini’s FLIP solver was used for the ocean integration with boat splashes and spray particle generation [16]. Houdini is also an open box environment meaning that networks within Houdini can be broken up and modified, for example the FLIP solver. An art direction benefit is that Houdini’s node based design comes with the flexibility that let us go back and modify our system at any point in time. After setting up a complete system it is possible for example to add another collision object or add a new force without having to rebuilding the fluid system. For example Disney Animation used Houdini for procedural shaping and sculpting the fluids for the art direction in the movie Tangled [17], as can be seen in Figure 7.. Figure 7: Final render and concept art for a dam break in the movie Tangled. Figure taken from [17].. 6.

(15) Chapter 3 3. Technical Background. In this chapter the technical background for the methods that the implementation is based on are described. Firstly a general particle system model is presented. Then a section about fluid dynamics that describes the fluid simulation data structures, the flow equations for a fluid, the different fluid viewpoints and the fluid model later implemented; Fluid Implicit Particle. Then the secondary water effects model is presented along with the criteria for emission, surface collision detection and the models for spray, foam and mist.. 3.1. Particle System Model. A particle is a point in space that can have several physical parameters such as position, mass, velocity, acceleration, color, size, age and life. For every time step, meaning a defined state in time where the simulation gets evaluated, the particle system update the time based parameters as velocity, acceleration, age and position. f m v2 = v1 + t · a a=. p2 = p1 + t · v1. (1) (2) (3). a = acceleration, f = f orce, m = mass, t = time v1 = original velocity, v2 = new velocity, p1 = original position, p2 = new position Assuming the position and the mass is known for the particles, we can set a motion by introducing forces as gravity and applying Newton’s Second Law of Motion (1). The equation solves the acceleration, which gives us the original velocity. By integrating the second equation (2) the current velocity can be obtained. And integration of the last equation (3) gives us the particles current position. For every frame step in the simulation each particle go through four phases; Generation, Extinction, Dynamics and Rendering [4]. 1. Generation Spawn the new particles and initialize the attribute values. 2. Extinction For every frame step the particle age increases. When a particle age reached the life span threshold it is considered dead and destroyed as well other custom threshold, for example when the particle moves outside a given region. 3. Dynamics Update the attributes that vary over time by integrate the particles velocity, acceleration and the position. The particle position is computed by the velocity modified by a constant gravity force to add a motion to the system. Additional attributes as age and color are updated in this step as well. 4. Rendering Draw all particles with the updated attributes. 5. Rinse Step to next frame and repeat 1-5.. 7.

(16) 3.2. Fluid Dynamics. Fluid dynamics includes both aerodynamics, often used for describing smoke and fire behavior in air, and hydrodynamics, which is useful for describing a liquid condition in air. The fundamental differences between gases and liquids is that a liquid have a surface and is volume bound opposite to a gas that is free in air. For representing a liquid fluid model in computer graphics, fundamental data structures, fluid representations, and the Navier-Stokes flow equation along with the Fluid Implicit Particle model are presented in this section. 3.2.1. Data Structure. The fluid simulation results in several data structures with different functionalities. The volume data of the fluid simulation is represented by voxels, volumetric picture elements. These elements or cells represent data values on a defined grid in a 3d space, and combined describing a volume. Compared to a pixel that represents values on an image grid in a 2d space, and combined describing an image. Two data structures, vector and scalar normally represent these volume fields as can be seen in Figure 8. In a scalar field a signed distance field is used for representing the distance from a point to the surface, and the vector gradient field is used representing the direction where the most changed has occurred in the scalar field. • Scalar Fields Scalar fields stores one primitive with float values for each cell in the grid representing for example the density, viscosity, temperature or a mask to form a certain shape. • Vector Fields Vector fields stores one primitive vector containing three floats for each cell in the grid and can for example represent velocity and forces in the XYZ axis or colors in RGB space.. Figure 8: Scalar density field and the corresponding vector velocity field from a wispy smoke simulation. • Signed Distance Field The signed distance field (SDF) contains voxels representing the shortest distance to the surface of an object in a discrete scalar field as can be seen in Figure 9. The SDF function returns a positive distance value if the sampled point(x) is inside the given object(S) and negative if located outside, i.e. in the compliment of S, S c . If the distance value is zero the voxel is on the surface of the object. [18]  d(x, S c ) if x ∈ S f (x) = (4) −d(x, S) if x ∈ S c where d(x, S) = inf ||x − y||, y ∈ S 8. (5).

(17) Figure 9: Signed Distance Field of a teapot geometry. • Gradient Field The gradient function of a scalar field returns vector field that points in the direction where the most change has occurred in the scalar field as can be seen in Figure 10. ∇f = grad f = (fx , fy , fz ). (6). Figure 10: Green gradient vectors of a scalar field pointing towards the highest differences in the field.. 3.2.2. Navier-Stokes Equations. The incompressible Navier-Stokes equations describe fluid motions from a set of factors. The equations are widely used for describing fluid simulations as smoke, fire and liquids in computer graphics [19]. In the implementation chapter the custom built fluid system solves the equation when calculating the fluid flow. The result of the equations is a vector field that describes the velocity or the flow of a fluid, ∂u 1 + (u · ∇)u + ∇ρ = g + v∇ · ∇u ∂t ρ. (7). ∇·u=0. (8). u = velocity, t = time, ρ = pressure, g = f orces, v = viscosity. The first equation (7) is known as the momentum equation and models the change of velocity for a fluid. This phase is calculated over four factors for every time step in the simulation, 9.

(18) • Advection (u · ∇)u Advection is the motion within the fluid moved accordingly from the flow of the fluid. This factor is responsible for the behavior of swirls and vortices. For example how much a thin wispy smoke will swirl as it rises. • Diffusion v∇ · ∇u The diffusion is how the fluid models the velocity outwards. The viscosity parameter adjusts how fast the propagation will occur. High viscosity mimic thick slow moving fluid as honey or syrup, and lower viscosity mimic faster lively moving fluids as water or oil. However this term is often ignored and assumed to be zero when simulating water. • External Forces g The external forces are the sum of all external forces reacting to the fluid. For example wind, drag, gravity and temperature. Local forces as buoyancy in a pyro simulation can also be considered to be an external force. • Pressure. 1 ∇ρ ρ. The forces from the pressure accelerate the fluid from areas with high pressure to low pressure. Distributing the fluid flow accordingly by the gradient of the pressure.. The second equation (8) state that the mass should always be conserved and is known as the incompressibility condition, ∇·u=0 The condition models that the volume of the entire fluid is conserved as the density is distributed within the fluid field.. 10.

(19) 3.2.3. Fluid Representations. There are currently three different approaches for representing a fluid in computer graphics; Eulerian, Lagrangian and a hybrid version of the two. Eulerian Volume fluids is represented using the Eulerian method as can be seen in Figure 11. The method uses a grid of cells with information that is passed along over the grid throughout the simulation. The information is the density of the fluid, which is passed along on a scalar field with a velocity field advected by a pressure projection based on the Navier-Stokes flow equation. The velocity field is not just where the density is displayed in the grid rather it is distributed and describing the motion over all the cells in the fluid container. The resolution of the grid determines how fast the equation is solved. A more dens grid with a higher cell number results in greater detail of the fluid but will be more time consuming accordingly. An Eulerian approach stores the solved velocities on the voxels [20].. Figure 11: An Eulerian volume representation of a smoke fluid simulation.. Lagrangian Particle fluids uses the Lagrangian representation as can be seen in Figure 12. A known Lagrangian model is the Smoothed-Particle Hydrodynamics fluid (SPH). The method is a purely particle based approach where particles determine the fluid location and the velocity is stored on the particles. The resolution of a particle fluid is determine with the particle separation, meaning the interaction distance between the particles instead of the grid resolution like in a volume fluid. When updating the velocity, the pressure projection is performed on the individual particles along with stiff explicit forces between the interaction distances to prevent collapsing. Explosive behavior tend to rise as particles are to close to each other, this can often be avoided by increasing the sub steps for the simulation but results in a longer render time. The location of particle fluids is not bound to a certain grid in space like the volume fluid representation [20].. Figure 12: A Lagrangian SPH representation of a liquid fluid simulation. Figure taken from [20].. Hybrid A hybrid representation uses elements from both the Eulerian and Lagrangian methods. Projection is performed between the two methods and the fluid solver operations are distributed. The Fluid Implicit Particle method uses a hybrid approach to take advantage of the two representation. [13] 11.

(20) 3.2.4. Fluid Implicit Particle. FLIP fluid uses particles to determine the location and to store the velocity in them as the Lagrangian SPH fluid, but at each time step the velocity from the particles are copied to a grid for solving the flow equation with an Eulerian approach, followed by a projection method to copy the solved grid back to the particles [6]. This method was mentioned in chapter 2 and is known as the Particle-In-Cell (PIC) method, and was original designed to simulate compressible fluids. An issue with the PIC method is that the model does not take the particles characteristic in consideration as it overwrites the Lagrangian particles velocity from the solved Euler grid velocity. However the extended PIC version refereed to as FLIP, updates the particles with another approach. Instead of overwriting the velocity completely the differences from the original velocity field to the solved velocity is evaluated and added to the particles. With this approach the particles individual characteristic can be maintained throughout a simulation. For an understanding of how to implement a FLIP solver and where to inject the custom fields it is essential to understand how the model sequentially works. The steps of the PIC/FLIP algorithm is briefly described as, 1. Integrate Particles Velocity 2. Velocity from Particles to the Velocity Field 3. For FLIP: Duplicate Velocity Field 4. Solving Velocity Field with the Navier-Stokes flow equations, • Advection • Diffusion • External Forces • Pressure • The Incompressible Condition 5. For FLIP: Subtract the solved Velocity Field from the duplicated Velocity Field 6. Velocity from Velocity Field to Particles (a) PIC Update Copy the velocity from the Velocity Field to the particles (b) FLIP Update Copy the differenced velocity from the Velocity Field to the particles 7. Move the Particles with the new Velocity. An advantage of working with the FLIP fluid is that we can modify and control both the particles and the volume attributes, for example the particles velocity and the volume velocity field in a simulation. Another advantage is that the method is faster on evaluating the simulation frame, however it is also an approximation, which results in less accuracy compared to the other representations. When simulating liquids the fast and flexible workflow from the FLIP model is often what is desired.. 12.

(21) 3.3. Secondary Water Effects Model. In this section the secondary water effects model is presented. First the criteria methods used for emission followed by the surface collision model and the models for spray, foam and mist. 3.3.1. Emission Criteria. For the secondary water effects emission to occur, one or several criteria conditions must been fulfilled. The criteria are based on the vorticity, curvature, and the velocity, • Vorticity The vorticity of the fluid describes where the swirling motion is located as described in [21]. Areas where the acceleration frequently varies over time have high vorticity as the velocity curls. To determine vorticity or where the most changed has occurred in the acceleration, the average velocity for an area over time is calculated in the fluid.. ω =∇×v. (9). ω = vorticity, v = velocity. • Curvature As described in the previous chapter a method [9] was presented for generation of splash and foam based on the curvature. The particles are generated when a curvature of the fluid surface exceeds a custom threshold. The curvature equation is described as,. k =∇·(. ∇f ) |∇f |. (10). k = curvature, f = surface function. • Velocity A water surface that has a slow motion tends to generate less white water. Therefor a custom velocity threshold can be considered to be used as a variable for the criteria. A custom threshold based on the maximum velocity of the fluid is used for calibrate the maximum velocity criteria, abs(vx , vy , vz ) > vt. (11). vx , vy , vz = velocity, vt = velocity threshold An additional velocity criteria for a spray model was presented in the paper [22]. A custom threshold for the upward velocity was introduced to force the emission to only occur in a upward direction away from the surface, vy > vt vy = upward velocity, vt = velocity threshold. 13. (12).

(22) 3.3.2. Surface Collision. To be able for the secondary particles to float on top on the surface as well bouncing off the environment a collision detection model based on [11] is described below, For determine if a collision has occurred with the surface, the particles position are sampled within the implicit surface representation; signed distance field. If a collision has occurred the gradient function can be used for pointing to the closest surface point in relation to the current particle. The resulting distance from the signed distance field can then be used with the gradient to translate the particles to the surface. The reflection function as can be seen in Figure 13, can be used to model a bounce from the impact by setting the particle velocity away from the surface. The velocity direction after the collision is determine by the reflection of the direction against the normal vector of the surface. Velocity vector v is the incoming velocity to the surface and vector u is the reflection of v against the surface normal n,. Figure 13: Reflection illustration.. 3.3.3. Spray. The criteria for the spray emission to occur are based on the surface curvature, velocity and vorticity. Spray particles can be considered being ballistic particle systems, as spray tends to blow up and fall down in its own matter. When a spray particle collides with the fluid surface the spray particle is transformed into a foam particle. [9] 3.3.4. Foam. The foam criteria emission is spawned by spray particles that collide with the base fluid surface. Foam particles are also constant being birthed where the vorticity tends to be high. The initial motion is interpolated from the previous state as a spray particle and the base fluid velocity flow. The particles set their velocity direction with the tangent of the surface to always be pointing aligned with the surface. [23] 3.3.5. Mist. A volumetric mist cloud is birthed when the spray particles exceeds their lifespan and no collision occurred with the surface for foam emission [10]. The mist emitters are created from the dead spray particles position. These points can be used to drive a volumetric simulation that dissipate over time [9].. 14.

(23) Chapter 4 4. Houdini Overview. In this chapter a Houdini technical overview for the implementation is presented. Firstly Houdini procedural framework is briefly introduced. Then the different operator domains are briefly presented. Followed by how data flow in Houdini, and the geometry classes and its features. Followed by an extended description of the Dynamic Domain (DOPs) with the elements to modify a custom fluid solver. Further more description of the Vector Operator Domain(VOPs) for manipulating the data, as has been frequently used in the implementation for exampled when creating the criteria and modeling the secondary water effects. Followed by a description of the Houdini’s tool assembling feature Digital Assets.. 4.1. Procedural Framework. Side Effects Software Houdini is a production class node based 3d animation software in a procedural environment. The software covers modeling, animation, particles, dynamics, lighting, rendering, volumetric, compositing and plugin development. Houdini is an open environment and support of scripting APIs like Python,VEX and Hscript. It also supports editing of contents of the nodes. Meaning that it is open for the user to explore and modify networks and subnetworks of nodes how they are designed and the functionality, for example a smoke solver or a FLIP fluid solver as can be seen in Figure 14.. Figure 14: Houdini’s FLIP fluid solver network. The software have support for communicating with all the major visual effects software, including: Maya, 3D Studio Max, Naiad, Krakatoa and ZBrush. It is also possible to write additional plugins with the Houdini Development Kit (HDK), which is a comprehensive set of C++ libraries. Major visual effects studios for example Digital Domain, Sony Imageworks, Dreamworks and Disney Animation have their own proprietary systems and solvers integrated within Houdini’s framework with the use from HDK or Python [1].. 15.

(24) 4.2. Operator Domains. There are several operator domains within Houdini, which create the dynamic workflow from particles, volumes, fluids, polygons to images. • Surface Operator Domain (SOPs) Geometry and surface operations for procedural modeling. Nodes within SOPs is refereed to as a SOP node. • Particle Operator Domain (POPs) Particle simulation operations for applying forces and modifying the particle system. Nodes within POPs is refereed to as a POP node. • Channel Operator Domain (CHOPs) Procedural animation and audio modifying. Nodes within CHOPs is refereed to as a CHOP node. • Composite Operator Domain (COPs) 2D composite operations for visualizing patterns and image modifications. Nodes within COPs is refereed to as a COP node. • Shading Operator Domain (SHOPs) Shading operators for creating custom shader and applying preset shaders. Nodes within SHOPs is refereed to as a SHOP node. • Render Operator Domain(ROPs) Render operators for setting up render passes and dependencies. Nodes within ROPs is refereed to as a ROP node. • Dynamic Operator Domain(DOPs) Dynamic simulation operators for dynamic solvers as fluids, cloth, particles and rigid bodies. Nodes within DOPs is refereed to as a DOP node. • Vector Operator Domain (VOPs) VEX operators for modifying a nodes data with logic statements and tools. Nodes within VOPs is refereed to as a VOP node.. 4.3. Data Flow. Houdini sequentially processes the node networks elements starting from the top of a node stream and works itself downwards. Several nodes can be used to gain control of the data flow, • Merge With the Merge node multiple streams with objects or data can be merged into a single stream. As additional streams are added to a network, the streams are as default sequentially processed from left to right. • Object Merge Geometry can be passed along into several networks with the Object Merge. This can be useful when a certain type of the geometry is desired to be filtered out and to be used for another operation. • Switch Switches can be used for toggle on and off streams. The switches can as well be scripted to only occur if certains criteria are fulfilled. • Import/Export Simulation data as fields and geometry from DOPs can be imported into SOPs with the Import node. It is recommended to export out the data to disk for a smoother workflow when working with simulations, this is achieved with the ROP Output node and can then be red in with the File node. 16.

(25) 4.4. Geometry. The different geometry classes, attributes, variables and grouping in Houdini are briefly described below, • Points A point is a point in space defined by the axis; X, Y and Z. Particles are points but with features as velocity and life for example that distinguish them as a particle and not only a static point. • Vertices A primitive geometry as a box define it corners or center with vertices that are referenced to points. The vertices are bound to primitives while primitives may share points between each other. • Surfaces Primitive surfaces can be represented by a polygon shape that is built from a series of straight edges defined by a series of vertices. A mesh consists of a group of polygons surfaces in a certain order. • Volumes Volumes are primitives that consist of a sub divided box with values stored in each cell or voxel. The values type can for example be a float or a vector. 4.4.1. Attributes. Figure 15: Geometry attribute overview. Figure taken from [1] Points, vertices, primitives and detail (the object) have stored attributes describing its initial features as can be seen in Figure 15. The attribute can be of different types as float, integer, vector or a string. An attribute can for example describe the position, color, velocity of a geometry. There are several operations to create custom attributes and to modify these, • Attribute Create The Attribute Create node let us define a custom attribute for a geometry representation by defining a name, value and a local variable. • Attribute Promote Attribute can be passed on from one geometry class to another with several merge methods. The merge methods can besides passing an approximate value also calculates the minimum or maximum value of the attribute that is promoted.. 17.

(26) • Attribute Transfer For transferring an attribute from a geometry to a separate geometry stream the Attribute Transfer can be used. The node interpolates the source attributes using a weighted proximity technique for transferring to the destination attribute. 4.4.2. Variables. There are global variables that can be accessed over the different domains and geometry types. For example the current frame and the current time in seconds. Local and custom variables is created when an attribute is initialized and the $ character followed by capital letters distinguish a variable. For example the global variable for the current frame is defined as $F. 4.4.3. Groups. A technique for sorting geometry based on a criteria can be achieve by grouping. The criteria can be based on an attribute stored on the geometry and with a threshold condition the variable for the attribute can determine if the geometry will be a group member or not.. 4.5. Dynamic Network. For creating simulations in Houdini dynamic networks is processed. Combining simulation objects along with certain solvers let us achieve different effects. 4.5.1. Solvers. In Houdini there are several solvers for calculating dynamical simulations for example rigid bodies, cloth, pyro and fluids as the FLIP solver. The solvers are attached to one or more streams of objects and integrate them over time by a set of algorithms based on the objects attributes. Custom solvers can be created with the Solver or the SOP Solver when an operation is needed for processing certain attributes over time. 4.5.2. Microsolvers. The microsolvers are nodes within the dynamic domain, DOPs, that solves one certain mathematical task. There are a numerous of different types of microsolvers for different task, for example copying vector fields values to point geometry attributes, or blending multiple velocity fields. The FLIP solver uses a set of networks with microsolvers when solving the incompressible fluid equation, as can be seen above in Figure 14. The microsolvers within Houdini is refereed to as Gas Solvers, for example the Gas Non Divergent. It is also possible to create custom microsolvers with the Gas Field VOP to perform specific tasks. 4.5.3. Multiple Solvers. For processing several solvers and microsolvers to the simulation objects a Multiple Solver can be used. By attaching the object and data stream along with several streams with the Multiple Solver, custom solvers can be built as the FLIP solver. For example at every time step a stream of imported SOP data flow to the Multiple Solver followed by a SOP Solver for integration of the attributes, and lastly followed by the microsolvers operations on the data. 4.5.4. Fields. Volumes within the DOPs domain are refereed to as fields for domain separation purposes. Fields are defined by the Scalar Field or the Vector Field node. Volumes created in SOPs can be referenced with the SOP Scalar Field or the SOP Vector Field, which will create the field within the DOPs domain.. 18.

(27) 4.5.5. Forces. Forces can be implemented to add a motion behavior to a simulation. • Gravity The known earth gravity force -9,81 m/s2 is an essential ingredient to add when aiming for a realistic fluid simulation. The acceleration is often set to be a constant gravity force. • Drag Drag is a force that is often used in fluid simulations for damping the motion of a fluid. Drag can be thought as a force that operates in the opposite direction of the fluid particles motion. 4.5.6. Noise. Noises can be implemented to a velocity field to give the motion a more non-uniform shape. Curl-Noise that was briefly described in the Background chapter generates turbulent velocity fields based on a Perlin noise with an incompressible result, which is often desired for a fluid pattern.. 4.6. VOPs Domain. The VEX code and VEX operator network (VOPs) can be used for modifying points from simple visualization to defining a custom volume primitives. VOPs can be thought of as the visual programming node system in Houdini as it comes with it own set of tools, a wide selection of low-level mathematical functions and logic statements that can be useful for solving algorithms. Another advantage using VOPs is that it instantly recompiles the resulting VEX code without having to restart Houdini. The VOPs network have the same logic no matter if you are creating a custom shader in SHOPs or applying a visualization to a velocity field in SOPs. For example this can be of great use when an operation logic is needed for a different domain. 4.6.1. Point Clouds. A VEX technique to focus on a certain amount of points during an operation is called Point Clouds. Point Clouds in Houdini have cached out custom information on each point of the cloud and can be modified and flagged within the same VEX operation. This can be useful for shading or deforming a certain area of geometry based on a condition, for example emission of foam on an ocean surface.. 4.7. Digital Assets. Custom operator types built from node networks is often referred to as Digital Assets in Houdini. The network is encapsulated with custom parameters or handles at top level to control the asset. The digital asset let us package and share our network with others.. 19.

(28) Chapter 5 5. Implementation. The implementation of a custom built FLIP solver and the secondary water effects in Houdini is described in this chapter. Firstly the modeling setup as the environment and the fluid emitter is described. Then the workflow of building a FLIP solver with art directable fields for control of the fluid flow is presented. Followed by setting up the secondary water effects with criteria, collision detection and the models for spray, foam, mist and splashes. Lastly assembling the final implementation to tools for distribution purposes are described. An overview of the implementation can be seen in Figure 16.. Figure 16: Overview workflow chart.. 5.1. Setup Modeling. The modeling setup for the collision environment and the fluid emitter source is described in this section. 5.1.1. Collision Environment. An underlying environment for the fluid to collide against can be an important factor for achieving a non-uniform look, as it tends to give the fluid more turbulence appearance. The environment can be created as a custom polygon shape with a noise applied to it. In Houdini irregularity to a surface can be introduced in several ways, for example with an expression or the Mountain SOP as can be seen in Figure 17. For the fluid simulation to collide against an object the object is transformed into a signed distance field and collision detection is performed during the simulation in DOPs.. Figure 17: The Mountain SOP attached to an extruded polygon grid.. 20.

(29) 5.1.2. Emission Source. A factor to consider for a more natural water behavior is the initial emission state. Flowing water particles tends to have a vivid shape than an overall uniform appearance. For an approximation of this phenomenon the fluid emitter could be of a custom geometry, which is then transformed into a volume. Points are then scattered inside the volume to become the particle system emitters. For the particle system to work with the solver the emitter particles are assigned the essential attributes as velocity and acceleration. For creating an additional non-uniform initial state an animated turbulent noise is also applied to the points position and velocity.. 5.2. Building the FLIP Solver. In this section the workflow of building a custom fluid solver is described. The solver is of the type FLIP as described in chapter 3 and the implementation method is inspired by Houdini’s main FLIP solver [24]. The fluid solvers dynamics are built within DOPs, the initial particle system and the custom volumes are built within SOPs. A modified FLIP model work flow for the Houdini implementation is listed below, • Initialize – Particle System – Original Velocity Field – Custom Velocity Field • Custom FLIP Integration Loop 1. Integrate Particles Velocity 2. For Collision: Particle Surface Collision Handling 3. Initialize the Fields (a) (b) (c) (d) (e). Resize Original Velocity Field to Particles For FLIP: Create Old Velocity Field and match to Original Velocity Field Create Surface Field and match to Original Velocity Field For Collision: Create Collision Field and match to Surface Field Convert Surface Field to a Signed Distance Field by sampling the Particles. 4. Solve Advection for Particles from Original Velocity Field 5. Copy Particles Velocity to the Original Velocity Field 6. Collision Detection (a) Sample Collision Volume to Collision Field (b) Enforce Boundaries to the Original Velocity Field by the Collision Field 7. For Custom Velocity Field: Integrate Custom Velocity Field to Original Velocity Field 8. For FLIP: Copy Original Velocity Field to Old Velocity Field 9. Solve the Velocity Field for Non Divergence 10. Velocity from Field to Particles (a) PIC Update Update Particles Velocity by copying the Original Velocity Field to the Particles (b) FLIP Update Update Particles Velocity by the difference in the Original Velocity Field with the Old Velocity Field (c) Blend Update Update Particles Velocity by blending FLIP and PIC update 11. Integrate Particles Position 21.

(30) 5.2.1. Initialize the Particle System. • Emitter The particle system emitters are first initialized within SOPs as described above. In DOPs an empty object is first created that will hold the particle system. Then the initial particle system in SOPs is referenced and created inside DOPs with the SOP Geometry node. • Motion Integration For implementing the FLIP model to the particle system the Multiple Solver is created as the base solver for the model. The particle system model that is described in chapter 3 is then performed with the first integration for the velocity followed by the second integration for the position. The time step increment is an important factor to take into consideration when performing these operations as it is depending on the simulations frames per seconds. These motion integrations are calculated with Gas Linear Combination microsolvers. • Storing Attributes To be able to store the solved velocity and acceleration attributes from the microsolver a SOP Solver is used. Inside the SOP Solver a VOP SOP processes the attributes from the previous frame to the current frame. 5.2.2. Velocity from Particles to the Field. A particle choreography system needs to be implemented for having the particles to interact with each other and to act as fluid particles. For achieving this by the FLIP model the Euelerian grid also referred to as the volume or the field is first implemented, • Creating the Velocity Field For implementing the volume grid representation a vector field is first created. When the nondivergence pressure projection is performed for the velocity field, the field should preferable use a face sampling for the voxels to properly calculate the velocity in every direction of the voxel cell. • Field Operations Considering the steps for the FLIP model as described above, all the field operations is performed between the particle motion integrations. The size of the fields needs to be resized to contain all the particles at every frame step. This can dynamically be achieved by reference the created vector field by a Gas Resize Field. The second operation is to project the particles velocity to the vector field, which can be achieved with the Gas Particle to Field. The velocity field can be seen in Figure 18.. Figure 18: Visualized FLIP velocity field. 22.

(31) 5.2.3. Solving Navier-Stokes for the Velocity Field. For obtaining the fluid flow, factors from the previous described Navier-Stokes equations were solved as advection, external forces, pressure and the incompressibility condition. The factor diffusion for achieving viscosity was ignored. • Advection For advecting the fluid the Gas Advect is used. The microsolver advect the particles accordingly to the velocity field. For an additional advection, self-advection is used on the velocity field with the Gas Advect Field. • External Forces External forces are introduced as a gravity acceleration force to the particles to set a motion to the system. As well as the forces in the later described section about custom velocity fields. • Pressure & The Incompressibillity Condition For solving the incompressibility condition as well the pressure factor the Gas Project Non Divergent Multi Grid is used. The microsolver measure the imbalance in a computed pressure field by comparing expansion and contraction velocities of the boundary of every cell in the field. As an incompressible fluid the field should have a zero divergence, as it will maintain its volume throughout the simulation. From the non-divergent calculations an advected pattern is also achieved, however the advected step above introduce a finer detail of advection that can also be custom controlled. 5.2.4. Velocity from Field to Particles. For updating the particles with the new velocity the PIC or the FLIP method can be used, or a blend between the two, • PIC The PIC update is to copy the velocity from the field back to the particles. To implement the PIC method the microsolver Gas Field To Particle can be used after the non-divergence step. A disadvantage with the method is that the individual characteristic of the particles is lost as the field operations sample approximate and blurs when solving for the new velocity field. Because of this issue the PIC method may lose the Lagrangian particle representation features and appear closer to an Eulerian representation. • FLIP The FLIP update is to influence the particles velocity from the newly solved velocity field maintaining the particles individual features. The FLIP update stores what changes was caused by the field operations. Then the change of velocity is applied to the particle values and the particle can retain their individual characteristics. To implement the FLIP update an additional velocity field is created with a reference to the same dimension and resolution as the original velocity field. The implementation order of the field is performed after the resize operation for the original velocity field to obtain the correct size and to be used for the field operations. After the particles velocity is copied to the original velocity field, the original velocity field is copied into the old field. Lastly after the non-divergence step the solved original velocity field is then subtracted from the old velocity field and copied back to the particles. 5.2.5. Surface Field. When simulating liquids a surface or a free surface is fundamental for determine what to be consider inside a liquid and what to be consider outside the liquid. In a non-free surface, voxels in the velocity field that are empty of particles will obtain an interpolated value from the closest particle velocity. If a surface field is implemented it can for example be used for zero out the velocity in the voxels where no particles are located. 23.

(32) • Creating the Surface Field To create a free surface an additional scalar field is created. The surface field is implemented after the additional velocity field with references to the velocity field’s dimension. Sampling the particles into the field is then performed with the Gas Particle to SDF. 5.2.6. Collision Field. For the fluid to interact with the environment a collision field is implemented. The surface and collision field is visualized in Figures 19 and 20. • Creating the Collision Field The collision field is a scalar field, which reference its dimension to the surface field as the collision field only have to exist where the fluid is currently located. • Sampling the Collision Environment Signed Distance Field Before the non-divergent step a Gas Field VOP is created for sampling the collision environment signed distance field from SOPs. • Enforce Boundary For the collision to work properly the velocity inside the collision field is preferable set to zero. The Gas Enforce Boundary is used for this purpose as it uses the collision field as a mask for zero out the velocity field.. Figure 19: Surface and Collision field. Figure 20: Surface and Collision field visualized during simulation in DOPs. 24.

(33) 5.3. Particle Surface Collision Detection. Collision detection between fields with high accuracy can be expensive and not always precise. Because the fluid is of a hybrid type a collision detection can be performed with the particles as well for a higher accuracy on collision as can be seen in Figure 21. As described in [11] and [12] a particle collision model against a fluid surface is created by sampling the signed distance field of the surface field. The particle position is sampled within the field within a VOP SOP in a SOP Solver. If the signed distance field returns a positive value then the particle is projected to the surface with the gradient vector along with the distance to the closest surface position. This step is performed before the field operations.. Figure 21: Particle Surface Collision Detection before and after. Particles visualized as vectors, red inside the collision field and blue outside.. 5.4. Custom Velocity Field. Art directing the shape and the flow of a fluid is often desired as the FELT [7] technique mentioned in chapter 2. For example defining a custom velocity field can give us the control how to force a fluid along a defined path, or how to achieve a strong splash when a pouring river collides with a rock or for a certain area. • Creating a Velocity Volume in SOPs An approach for achieving a similar FELT technique is to first define the custom fields within SOPs. The custom fields can be created by modeling a polygon shape that is transformed into a volume. Then a velocity attribute with the velocity pointing in a certain direction is initialized that will be influencing our fluid simulation velocity. The magnitude of the velocity can be controlled by multiplying the velocity attribute with a constant or an animated noise. – Splash Detracting the velocity from a certain object can produce splashes. The points velocity attributes are based on the gradient of the signed distance field of the object, having the velocity vectors pointing outwards from the object. Visualized as a green volume in Figure 22. The splash object is also a part of the environment and therefor mixed into the collision field to be considered for the collision detection. – Vortex Attracting the velocity to a certain object produces a vortex effect. The same principal as with the splash object but the velocity attributes are pointing inwards instead. – Target For directing the fluid to move against a certain target. The targets points are sampled within the signed distance field of the fluids scalar field with a gradient. The resulting gradient field is used as the velocity field and points towards the target.. 25.

(34) – Path An art directable flow can be produced by having the fluid to follow a certain path. The path can be a custom curve transformed into a wireframe model. The model is then transformed into a volume, and the tangents from the curve is mixed in as velocity for the volume. An additional velocity field based on the gradient of the path model can be introduced to force the fluid within the path velocity field. A path volume visualized in blue can be seen in Figure 22. – Secondary Simulation Influences from other simulations such as a pyro or another fluid simulation can be achieved by extracting the velocity field as can be seen in Figure 23. • Implementing Curl-Noise to the Velocity Field As mentioned earlier a noise that results in a fluid pattern is the Curl-Noise. The noise can be implemented with a VOP SOP to the velocity attribute for additional details to the motion. • Influencing the Velocity Field The custom velocity volume from SOPs is implemented as a velocity field in DOPs with the SOP Vector Field. An important factor to consider is to ensure that the SOP Vector Field evaluates on every frame if the velocity field is animated. The custom velocity field is influenced in the original velocity field with a Gas Linear Combination. This is performed after the volume velocity field calculations and before the non-divergent step.. Figure 22: Polygon shapes with corresponding velocity fields.. Figure 23: Secondary simulation Billowy smoke velocity field.. 26.

(35) 5.5. Secondary Effects. In this section the implementation of the secondary effects is presented. Firstly is the emission criteria presented, followed by a general particle system model, lastly spray, foam, mist and splashes are presented. An overview of the secondary effects workflow can be seen in Figure 24.. Figure 24: Overview secondary effects workflow chart.. 5.5.1. Emission Criteria. Filtering out the emission geometry with the criteria as described in chapter 3, let us determine the desired areas for the secondary effects to occur. The criteria visualized can be seen in Figure 25. • Vorticity Vorticity is the curl of the fluid velocity. An approximation of vorticity can be achieved by comparing the current velocity with an average velocity from a previous time step. The technique was implemented with a VOP SOP by Point Cloud sampling the current point velocity and on the previous frame point velocity. The two velocities is compared to measure the differences and the magnitude from the resulting vector is the approximated vorticity of the fluid particle. • Curvature To calculate the curvature criteria, the curvature of the surface field is calculated with the Volume Analysis SOP. The resulting attribute is then copied from the scalar surface field to the particles by the Attribute From Volume SOP. As a fluid tends to have high frequency curvature it is often desired to blur the field before calculating the curvature. • Velocity For the maximum velocity criteria the magnitude of the velocity is calculated. This is achieved within a VOP SOP using the length of the velocity. And for the upward velocity criteria the velocity field in Y-axis is sampled.. 27.

(36) Figure 25: Visualization of the criteria; curvature, vorticity and velocity (upward and maximum) 5.5.2. Particle Solver. The particle system for the secondary effects is initialized as described in the FLIP solver section but with the resulting particles from the criteria as emitters and within the SOPs domain. • Motion Integration For creating a particle system within SOPs we need to consider how Houdini’s memory works in the different domains. The SOPs domain is original designed for procedural modeling and not for using dynamic solvers as it as default do not store attribute information from the previous time step or frame. However the previous mentioned SOP Solver or the Solver let us create custom solvers within SOPs in combination with DOPs. For performance purposes the particle motion integration in the solver was implemented with three different approaches; Python code operator in SOPs, VOPs in SOPs, and within POPs. The motion integration has the same principal as described for the initial particle system for the fluid system. • Surface Collision Detection Particle surface collision detection is performed in a VOP SOP as described in the FLIP section above. The surface field is merged in to the collision field to be considered for collisions as well. 5.5.3. Spray. • Emission The resulting fluid particles from the emission criteria is where the emission for the secondary particle system to occur. These birthed particles are considered being spray and are in the first of three states. The spray particles inherit the emitter particles velocity and can be considered being ballistic as they do not interact and get influenced by other particles. Additional attributes for the particles are created as random initialized mass and life attributes. If the life attribute has exceeded over time the particles spray state is transformed to a mist state with its features described below. Random spray particles are assigned a shorter life span to ensure emitting mist close to the surface. The different states are visualized in Figure 26. • Bounce A bounce can be calculated from the impact along the normal of the surface. A random threshold determines if the collided particle is to continue as spray and shoot out along the reflected direction, or if the state changes to foam and continue on sticking to the surface.. 28.

References

Related documents

Pricing in life settlement transactions is based on a determination of the risk and return from securitized portfolios of life policies. Available approaches to assessing

The versions of these models with finite variance transmission rate share the following pattern: if the sources connect at a fast rate over time the cumulative statistical

The results from the mediation analysis for the marginal NDE and NIE and total effect show that having low income increases the probability of dying 29 days to 1 year after stroke

Since we wish to study the conjunction in the plane perpendicular to the rotation axis (also referred to as the x-y plane) usual elastohydrodynamic lubrication experimental

Loss probabilities obtained with some solution methods, given homogeneous. sources and a very small

The literature suggests that immigrants boost Sweden’s performance in international trade but that Sweden may lose out on some of the positive effects of immigration on

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i