applications of advanced physics in visual e...

54
Applications of Advanced Physics in Visual Effects Tor Sterner September 9, 2011 Master’s Thesis in Computing Science, 30 credits Supervisor at CS-UmU: Niclas B¨orlin Examiner: Fredrik Georgsson Ume ˚ a University Department of Computing Science SE-901 87 UME ˚ A SWEDEN

Upload: hadang

Post on 07-Feb-2019

223 views

Category:

Documents


0 download

TRANSCRIPT

Applicationsof Advanced Physics

in Visual Effects

Tor Sterner

September 9, 2011

Master’s Thesis in Computing Science, 30 creditsSupervisor at CS-UmU: Niclas Borlin

Examiner: Fredrik Georgsson

Umea UniversityDepartment of Computing Science

SE-901 87 UMEASWEDEN

Abstract

AgX Multiphysics is a toolkit for performing physics-based simulations, devel-oped by Algoryx Simulations AB. AgX provides stable physics simulations andis used for industrial and engineering simulations around the world.

This thesis examines the possibilities for AgX to be used in the visual effectsmarket for films and commercials. The thesis includes a survey of opinions ofprofessionals from the visual effects company Digital Domain. The three mostwanted capabilities from AgX was according to the survey; stiff constraints,fluid-rigid body interaction and hair simulation. Furthermore, all new toolsmust improve or be equal on all aspects compared to the old tools, and havegood scalability.

Several simulations were run to compare the stiff constraints and scalabilityof AgX with the currently used tools. The results show that AgX handles stiffconstraints a lot better than the old tool and is also highly scalable.

In summary, for saving time from doing tedius tasks and for using physicsto an extent earlier not possible, AgX would be a good addition to the currentuse of physics in visual effects.

ii

Contents

1 Introduction 1

1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.4 Organization of thesis . . . . . . . . . . . . . . . . . . . . . . . 3

2 Theory 5

2.1 Computer Animation . . . . . . . . . . . . . . . . . . . . . . . . 5

2.1.1 Early animation techniques . . . . . . . . . . . . . . . . 5

2.1.2 Walt Disney’s Principles of Animation . . . . . . . . . . 5

2.1.3 Animation Techniques . . . . . . . . . . . . . . . . . . . 8

2.2 Computer Physics . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.3 Animation versus Physics . . . . . . . . . . . . . . . . . . . . . 11

2.4 Physics in Houdini . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.4.1 DROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.4.2 FSim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.5 AgX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3 Survey 19

3.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.2 Wanted capabilities . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.2.1 Stiff constraints . . . . . . . . . . . . . . . . . . . . . . . 20

3.2.2 Fluid-rigid body interaction . . . . . . . . . . . . . . . . 20

3.2.3 Cloth and hair . . . . . . . . . . . . . . . . . . . . . . . 20

3.2.4 Rigid body vector fields . . . . . . . . . . . . . . . . . . 21

3.2.5 Fluid tool simplicity . . . . . . . . . . . . . . . . . . . . 21

3.2.6 Future features . . . . . . . . . . . . . . . . . . . . . . . 21

3.3 Simulation tool properties . . . . . . . . . . . . . . . . . . . . . 21

iii

iv CONTENTS

3.3.1 Scalability . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.3.2 Determinism . . . . . . . . . . . . . . . . . . . . . . . . 22

3.3.3 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.3.4 Features over simplicity . . . . . . . . . . . . . . . . . . 23

3.3.5 No step back . . . . . . . . . . . . . . . . . . . . . . . . 23

3.4 Development scenarios . . . . . . . . . . . . . . . . . . . . . . . 23

3.4.1 Replace the DROP physics engine with AgX . . . . . . 24

3.4.2 Build a completely new rigid body system tool with AgX,

to replace DROP . . . . . . . . . . . . . . . . . . . . . . 24

3.4.3 Add AgX constraint fluids to DROP . . . . . . . . . . . 24

3.4.4 Build a AgX constraint fluid tool outside DROP . . . . 25

3.4.5 Add AgX wire functionality to DROP . . . . . . . . . . 26

3.4.6 Use cloth built in AgX . . . . . . . . . . . . . . . . . . . 26

3.4.7 Use hair built in AgX . . . . . . . . . . . . . . . . . . . 26

3.4.8 Add physics to modelling environments . . . . . . . . . 27

3.5 Results of the survey . . . . . . . . . . . . . . . . . . . . . . . . 27

3.5.1 Ranking . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4 Experiments 29

4.1 Simulation scenarios . . . . . . . . . . . . . . . . . . . . . . . . 29

4.1.1 Brick wall . . . . . . . . . . . . . . . . . . . . . . . . . . 30

4.1.2 Convex objects . . . . . . . . . . . . . . . . . . . . . . . 30

5 Results 33

5.1 Brick wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.2 Convex objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

6 Discussion 39

6.1 Simulations discussion . . . . . . . . . . . . . . . . . . . . . . . 39

6.2 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.3 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.4 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

7 Acknowledgements 43

References 45

List of Figures

2.1 Clay stop motion in form of Wallace in Wallace and Gromit. . 6

2.2 Animation of a horse in gallop. . . . . . . . . . . . . . . . . . . 6

2.3 Soft ball landing with squash and stretch properties. . . . . . . 7

2.4 Blue screen used with Chroma Key technique. . . . . . . . . . . 9

2.5 Motion capture transfered to animated character. . . . . . . . . 9

2.6 Simulation of ball. . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.7 Node structure in a Houdini network. . . . . . . . . . . . . . . 12

2.8 A small system built with Houdini’s own tools. . . . . . . . . . 13

2.9 Node network for a DROP setup. . . . . . . . . . . . . . . . . . 14

2.10 AgX fluid interacting with rigid boxes. . . . . . . . . . . . . . . 15

2.11 Several rigid objects constrained together. . . . . . . . . . . . . 16

3.1 A possible fluid setup with several node systems. . . . . . . . . 25

3.2 Constrained objects for hair. . . . . . . . . . . . . . . . . . . . 26

4.1 DROP brick wall simulation scene. . . . . . . . . . . . . . . . . 30

4.2 DROP convex simulation scene. . . . . . . . . . . . . . . . . . . 31

5.1 Simulation of a lock constrained wall getting hit by a light ball. 34

(a) AgX brick wall frame 1 . . . . . . . . . . . . . . . . . . . 34

(b) Original DROP brick wall frame 1 . . . . . . . . . . . . . 34

(c) AgX brick wall frame 10 . . . . . . . . . . . . . . . . . . . 34

(d) Original DROP brick wall frame 10 . . . . . . . . . . . . 34

(e) AgX brick wall frame 20 . . . . . . . . . . . . . . . . . . . 34

(f) Original DROP brick wall frame 20 . . . . . . . . . . . . 34

(g) AgX brick wall frame 30 . . . . . . . . . . . . . . . . . . . 34

(h) Original DROP brick wall frame 30 . . . . . . . . . . . . 34

5.2 Simulation of a lock constrained wall getting hit by a light ball. 35

v

vi LIST OF FIGURES

(a) AgX brick wall frame 40 . . . . . . . . . . . . . . . . . . . 35

(b) Original DROP brick wall frame 40 . . . . . . . . . . . . 35

(c) AgX brick wall frame 50 . . . . . . . . . . . . . . . . . . . 35

(d) Original DROP brick wall frame 50 . . . . . . . . . . . . 35

(e) AgX brick wall frame 60 . . . . . . . . . . . . . . . . . . . 35

(f) Original DROP brick wall frame 60 . . . . . . . . . . . . 35

(g) AgX brick wall frame 70 . . . . . . . . . . . . . . . . . . . 35

(h) Original DROP brick wall frame 70 . . . . . . . . . . . . 35

5.3 Simulation time graph, no lock constraints . . . . . . . . . . . . 36

5.4 Simulation time graph, 76800 lock constraints . . . . . . . . . . 37

Chapter 1

Introduction

To animate means ”to give life to an inanimate object” (Kerlow, 2009). In an-imation, movement and actions of objects are illusions, achieved by displayingmany images rapidly in sequence.

The craft of animation began over a century ago and grew during the firsthalf of the twentieth century with the popularity of hand-drawn cartoons. Inthe later part of the twentieth century, computers were introduced to the ani-mation art, and have since then formed several new techniques of animation.

The need for physical realism in animation greatly increased in the later partof the twentieth century with the use in live action films. When animation isused in visual effects for live action films the visual effects has to visually matchrealistic motion. This, and the ever-increasing use of computers led to the startof the field physics-based animation.

1.1 Background

Algoryx Simulation1 is a company in Umea started 2007 that focuses on deliv-ering stable and robust simulation solution for the professional simulator andengineering market. The main product of Algoryx is the AgX MultiPhysicsToolkit, which is a physics engine that comes with functionality suitable fordeveloping training simulators in heavy vehicles, marine anchor handling aswell as engineering simulations. Two of the main properties of AgX are highprecision and scalability (Algoryx, 2011). Furthermore, AgX supports unifiedphysics, i.e. combination of different forms of physical behavior for examplewires and rigid bodies.

One of the business areas of Algoryx Simulation is the visual effects market.The current use of physics in visual effects could then be improved with theuse of AgX.

1http://www.algoryx.se/

1

2 Chapter 1. Introduction

Houdini is an authoring environment for 3D animation and visual effectsdeveloped by Side Effects Software Inc.2. It covers all the major areas of 3Dproduction including modeling, animation and rendering. Houdini also sup-ports several modules including dynamical physical simulation of rigid bodies,wires, fluids and cloth.

1.2 Aim

The aim of this thesis is to examine the current role of physics in animationand suggest how AgX can be used for further improvement. Furthermore, aprototype integration of AgX in Houdini will be performed.

Part of this thesis is an initial analysis of the current use of advanced physicsin film animation. The results will be used to select scenarios interesting forvisual effects professionals. Some examples of scenarios and features whereAgX Multiphysics is believed to have potential are:

– unified physics, i.e. several different physical areas are simulated andsolved simultaneously, e.g. wires and rigid bodies (Servin et al., 2011),

– incompressible fluids, and

– mechanical systems, e.g. stiff and jointed mechanical systems, such astrees, robots and biomechanics.

The scenarios will be graded based on a survey of film animators and visualeffects artists. At least one scenario should be implemented and evaluated aspart of the integration of AgX MultiPhysics in Houdini.

The integration of AgX MultiPhysics will be directed towards 3D artistsand animators rather than programmers or physicists. This means that it willfocus more on increasing artistic expression rather than high precision. A moregeneral aim is to expand and simplify the use of physics in film animation.

1.3 Related Work

Physics in visual effects has become an important part in creating movies (Er-leben, 2005). Water, hair, smoke, explosions, cloth, and falling objects are allexamples of simulated physics common in contemporary film production.

At the same time, visual effects in films and games have been a motivationfor the development of physics in computer animation (Erleben, 2005). The bigissue with physics-based simulation for visual effects in films is the conflictingattributes of physical realism and artist control (Pentland and Williams, 1989;Liu, 1996; Bridson et al., 2007; Barbic et al., 2009). Physical realism is requiredfrom visual effects because our eyes and brain is sensitive to the behavior ofcertain objects, e.g. shape and motion of fabric (Goldenthal et al., 2007). Artist

2http://www.sidefx.com

1.4. Organization of thesis 3

control may be seen as the animators’ way to decide the outcome of a simula-tion. For example to decide where a thrown dice should land and which sideshould come up even though the motion of the object is physically simulated.The conflict is further complicated by the wish to exaggerate certain events,the so called ”The Hollywood Effect” (von Borries et al., 2007).

The conflicting attributes of realism and control is the reason for severalimprovements of physics simulation methods. The improvements are directedtowards giving animators better control of a physics-based simulation. Anexample is the use of space-time constraints (Ngo and Marks, 1993). Withcertain techniques animators are able to use regular animation methods alongwith rigid and deformable body physics (Popovic et al., 2000, 2003; Barbicet al., 2009), as well as fluid simulation as in Treuille et al. (2003).

1.4 Organization of thesis

Chapter 2 covers basic theoretical parts of animation and physics as well asmore specific information about the software to be used. Chapter 3 containsthe wanted capabilities and properties of the visual effects professionals par-ticipating in the survey. Furthermore, it includes the participants opinions ofseveral development scenarios and a ranking among the scenarios. Chapter 4describes some experiments in form of simulation scenarios and results of thesimulations are then presented in chapter 5. Chapter 6 concludes by discussingthe results, limitations, future work, and giving a summary of the thesis.

4 Chapter 1. Introduction

Chapter 2

Theory

This chapter explains the basics of animation and computer physics and com-pares the different requirements of animation and physics. Furthermore, infor-mation about the software used in the thesis is presented.

2.1 Computer Animation

In animation, pictures rapidly shown in sequence are perceived as a motion bythe viewer. Pictures, or frames, are the most basic entities of an animation(Kerlow, 2009).

2.1.1 Early animation techniques

There are plenty of techniques for making animated frame sequences, e.g. stopmotion and hand-drawn animation. In stop motion, each frame consists of stillobjects or characters moved by hand by an animator. In a frame sequence itgives the illusion of movement. Several stop-motion sequences uses clay as itsobjects, as in Fig 2.1.

Hand-drawn animation requires the animator to draw moving objects eachframe. An example of hand-drawn animation is shown in Fig. 2.2.

Both stop motion and hand-drawn animation is very time-consuming be-cause of the many frames the animator had to produce. The number of framesper second needed have also been increased since the start of animation history,from 12 to 24-30 (Erleben, 2005)

2.1.2 Walt Disney’s Principles of Animation

The art of animation was pioneered by the Walt Disney Studios, during the firsthalf of the twentieth century. Part of their legacy is their self-developed Princi-ples of Animation (Thomas and Johnston, 1981). There are twelve principles,of which three are directed towards adding physicality to the animation; squash

5

6 Chapter 2. Theory

Figure 2.1: Clay stop-motion in form of Wal-lace in Wallace and Gromit. Used with permission.(http://www.flickr.com/photos/62569532@N00/5349198629/sizes/l/in/photostream/)

Figure 2.2: Animation of a horse in galopp. (Animation by Jan-Eric Nystrom,Helsinki, Finland)

2.1. Computer Animation 7

Figure 2.3: Soft ball landing with squash and stretch properties.

and stretch, follow-through and overlapping action, and arc motion (Kerlow,2009).

The main point of squash and stretch is to maintain the volume of anobject even if it is deformed. This means that a soft ball that is dropped intothe ground and thereby squashed should also be stretched to preserve the samevolume during the whole motion as seen in Fig. 2.3.

In the follow-through and overlapping action principle, the follow-throughpart adds physicality to the animation. It discourages animators from makingmotions and actions halt instantaneously. Instead objects decelerate, as in thereal world.

The arc motion principle intends to give animation of characters a naturaland physically real look. In nature, most motions are in curved paths, rarelyin straight lines.

The rest of the principles goes through other animation guidelines, e.g. howto use timing and anticipation to enhance certain motions and exaggeration togive the animation a cartoony feel.

The principles were used by Walt Disney Studios to decrease the amount oftraining that new animators needed to go through. Additionally, the principleswere used as guides in production of animated sequences.

8 Chapter 2. Theory

2.1.3 Animation Techniques

One of the most fundamental techniques in animation is keyframe animation.In keyframe animation the animator sets up two or more key frames, wherethe characters or objects are in some important states, e.g. the beginning andend of a motion. An example of this is the throwing of a ball, where in onekeyframe the ball is in the hand of the thrower and in the next keyframe it hashit a wall. The keyframes are linked together with in-betweening i.e. creationof images between keyframes, to complete a full motion between the states. Inthe example of the thrown ball, the animator would create all images of theball sailing in an arc through the air.

The introduction of computers increased the production speed and the num-ber of produced sequences. In the beginning, computers were used to set to-gether the hand-drawn images and to add colors. As the computers and soft-ware got better, more and more of the animation production was done withthem. Computers are able to do the in-betweening in animation, using inter-polation i.e. a way of constructing new points between already given points.In the example of the thrown ball, the computer would calculate the path theball should take in the air and draw in-betweening frames.

Three important techniques in computer animation are green screen, motioncapture and physics-based simulation. The green screen technique, with thetechnical term Chroma key compositing, is used in many contemporary filmproductions. The technique is used to merge two pictures. It uses a clearcolored background in one picture and later makes the color transparent. Thepartially transparent picture is added to a background picture to form thefinal picture. The final picture gives the impression that the objects in theforeground is in the environment of the background, the use of chroma key canbe seen in Fig 2.4.

Motion capture is a way to increase the realism of animated characters.Movements of real actors are recorded by sensors and computers(Kerlow, 2009),as in Fig 2.5. The recorded movements are applied to the animated characterby the animation software. This gives the animated character the realisticmovements of a real actor but can still be in the form and environment of ananimation.

2.2 Computer Physics

Physical simulations has been used for some decades as a way to understandphysical occurrences in nature and to predict physical reactions, e.g. weatherforecast. Simulations can be done by stepping through mathematical formulasfor several steps and watch how data change.

Each such step is called a timestep and represents a short period of timein the simulation, often as a part of a second. An example of a moving ballsimulated in two timesteps is shown in Fig 2.6.

2.2. Computer Physics 9

Figure 2.4: Blue screen used with Chroma Key technique. Used with permis-sion.

Figure 2.5: Motion capture transfered to animated character. Used with per-mission.

10 Chapter 2. Theory

Figure 2.6: Ball simulated in two timesteps, velocity is calculated from previousvelocity and forces. Position is calculated from previous position and velocity.

A common simulation rate is 100Hz, i.e. 100 timesteps per second. How-ever, unless the simulation needs to be in real-time, each timestep can take anarbitrary time.

The determinism and theoretical ground makes simulations great to run oncomputers. Which is why physics-based simulations are almost exclusively runon computers. For a real-time application the time to calculate one second ofsimulation should be less than one second.

Physics-based simulation on computers has granted a way for very largecomplex systems to be simulated with little effort. This has led to special-ized software directed towards performing physics-based simulation, so calledphysics engines. A physics engine can be used as means to either perform aprecise mathematical simulation or a ”good enough” approximation of a phys-ical occurrence. Several physics engines require a high simulation rate, i.e. asmall timestep, to get good results. The choice between precise or good enoughdepends on what the simulations will be used for. Two different situations inwhich a different choice is prefered are industrial simulations, e.g. the simu-lation of a robotic arm on a conveyour belt, and physics in games, where it’smore important that the simulation is fast and produce a nice looking result.

One field that uses physics-based simulation is computer animation. Theuse of physics-based simulation for animation is called physics-based animationand is the field around which this thesis will revolve. Physics-based animationcan be divided in several areas of animation dynamics (Coutinho, 2001; Erleben,2005). In this thesis, the physics-based animation field will be divided in twomain areas, solid dynamics and particle dynamics, i.e. the motion of solids andthe motion of particles.

Solid dynamics simulations uses objects with several attributes, e.g. mass,volume, velocity and rotation. Solid dynamics are further divided into twomain categories; rigid body dynamics i.e. dynamics of hard objects that do notchange shape, and deformable body dynamics i.e. soft bodies whose shape canvary. Rigid body dynamics is very common in physics-based animation. Fallingobjects, shattering bricks, mechanical systems and character skeletons are allcommon examples of rigid body animation. Deformable body dynamics is alsoused in animation, e.g. for simulating skin and hair. Deformable body dynamicsdoes have some methods for simulating fluids, although particle dynamics isthe more common way.

2.3. Animation versus Physics 11

Particle dynamics consists of points, without volume and rotational at-tributes, and can be used to simulate a great variety of effects. Most methodsfor fluid simulations are based on particles, and fluids can by itself simulatethings commonly not recognized as fluids e.g. smoke or fire. Particles is alsoused in the simulation of cloth as well as more obvious effects like snow.

A regular physics engine takes input in forms of objects or particles withattributes and can then simulate how the input will behave over time. Aregular physics engine does not support stepping backwards in time or controlthe future outcome of a simulation. New input can however be given while thesimulation is running between steps.

The progress of physics-based animation has been immense. About twodecades ago a simulation with just a few objects with links between them washard and took a long time per frame. Since then, several methods and algo-rithms that speeds this process up has been developed. Furthermore, severalmethods that simulates new physical occurrences have been created and used.This progress is greatly amplified by the progress of computers in general. Withfaster computers, simulations can be made better, e.g. by running with shortertimesteps, and to a larger scale than before.

2.3 Animation versus Physics

Animation and physics have different advantages. Animation allows for greatartistic expression where as physics simulations makes it easy and fast to pro-duce large and realistic sequences. The conflict between artistic expression andrealism in animation physics lies in the level of control in physics-based simu-lations (Pentland and Williams, 1989; Liu, 1996; Bridson et al., 2007; Barbicet al., 2009). Simulations simplifies producing physical occurences. However,most simulations has no way to decide the behaviour and outcome of the simu-lation except for setting initial conditions and giving input during the simula-tion. This makes it hard for physics-based simulations to follow the wishes of adirector or an artist without tedious tweaking of initial condition parameters.For visual effects in many contemporary movies, control over animation is moreimportant than simplicity. However, controlling a large system animation ingreat detail is a slow and expensive process. Furthermore, the human eyes andbrain is sensitive to the realism of certain objects behavior (Goldenthal et al.,2007), which makes it hard to animate without help from physics-based simula-tions. Objects like fluids, building debris and cloth often require physics-basedsimulation to acquire the physical properties for a realistic look.

2.4 Physics in Houdini

The current use of physics in Houdini ranges from simulations of small con-strained systems to large-scale fluid simulations and rigid body systems with

12 Chapter 2. Theory

Figure 2.7: Node structure in a Houdini network.

tens of thousands objects. Small systems of rigid bodies, hair, fluids, and parti-cle systems can be simulated with built-in features included in the distributionof Houdini. Additionally, Houdini allows users to implement custom made so-lutions that can be used inside Houdini with all its features. Houdini’s ownbuilt-in tools give artists an easy to use physics-based simulation that is easyto setup, is intuitive and have good visual feedback. A small system with oneconstraint is shown in Fig 2.8. Houdini uses several node structures, the mostreleveant is a SOP network (SideFX, 2011), seen in Fig 2.7. The structure isintuitive and allows for good customization and test of data.

However Houdini’s tools are in most cases too slow for large systems, andallow for too little customization.

Instead, several externally designed tools have been constructed for largesystems. These tools are often significantly faster than Houdini’s own built-insolutions. What these externally made solutions often lack is simplicity, moretime is spent optimizing and implementing additional features.

2.4.1 DROP

One externally designed tool constructed for simulating large rigid body sys-tems is DROP. Created by visual effects company Digital Domain1, DROPallow physics-based simulation of rigid body systems using a regular physicsengine.

DROP is made for simulating large numbers of objects with good controlwhile also allowing for high detailed objects.

1www.digitaldomain.com

2.4. Physics in Houdini 13

Figure 2.8: A small system built with Houdini’s own tools. A ball is hinged toa bar and will move like a pendulum.

One example of what makes DROP able to simulate a large number of ob-jects is that it optimizes the amount of data that needs to be sent betweennodes in the network. DROP separates the visual representation of an objectand its physical properties and shape. While sending data used for simulatingthe object inside the DROP structure, DROP do not need the visual represen-tation. The visual representation of an object is added after the simulation iscomplete at the position simulated. A DROP setup is shown in Fig 2.9.

2.4.2 FSim

As with the rigid body simulations it is common for visual effects companies touse other implementations than Houdini’s own for fluids. Houdini’s own fluidscan simulate small systems with Smoothed-particle hydrodynamics (Erleben,2005) and Fluid implicit particle (Bridson, 2008) fluids. Those simulationsare good for small and simple volumes of water and can be used with simplecontrol from the Houdini environment. However, for large bodies of water othersolutions are often used for visual effects.

As with rigid bodies, visual effects company Digital Domain, uses an ownimplementation for large bodies of water. The implementation uses a particlelevel set method described in Enright et al. (2002) for simulating fluids. Thelevel set method is however not enough for most fluid simulation as it do notwork well with small amounts of fluids or splashes. In this case a combinationof particle level set fluids and SPH fluids is used. The main body of fluid issimulated using the particle level set method until it is satisfactory. Then theSPH fluids is added given velocities from the level set fluids where splashesshould be.

14 Chapter 2. Theory

Figure 2.9: Node network for a DROP setup.

2.5. AgX 15

Figure 2.10: Fluid interacting with rigid boxes stacked on top of each other,simulated by AgX. A mass of fluid flows on the stack and knocks them down.

The implementation made by Digital Domain is used as one single nodein Houdini. The node loads several files describing the whole scene with fluidand also files describing other areas affecting the fluid, e.g. certain areas wherethe fluid should flow faster or slower than regular. In addition, the fluid nodealso specifies paths to export the whole simulation to external files during thesimulation. The fluid simulation is often saved each frame to be able to restorea faulty simulation and to view each simulated frame separately. The fluidnode can only input rigid bodies in the form of a static environment.

2.5 AgX

The AgX MultiPhysics Toolkit, a physics engine developed by Algoryx Sim-ulations (Algoryx, 2011), contains several features relevant for visual effectssimulations, e.g. unified physics, incompressible fluids, and stiff and jointedmechanical systems.

Unified physics, i.e. the unification of different forms of dynamic systems,e.g. fluids and rigid bodies, chould be of benifit for visual effects simulations.Interaction between rigid bodies and water will always be present in movies inboth small scale (something is dropped into water) and large scale (a huge wavecrushes everything in its path). Today such simulations are often simulatedseparately from each other, and the effects of interaction added manually froman animator. AgX has support for full interaction between rigid bodies and itsincompressible fluid, seen in Fig 2.10.

16 Chapter 2. Theory

Figure 2.11: Several rigid objects constrained together to form a beam. Thered boxes are constrained together and forms a beam resting on two staticplatforms.

The incompressible fluid in AgX, called Constraint fluid, is based on a regu-lar SPH model with added constraints for density and other stability improvingmeasures (Bodin et al., 2011). This makes it near incompressible and able tosolve together with other dynamic systems, e.g. rigid body systems. The nearincompressibility of the fluid adds further realism to the simulation as a realfluid is practically incompressible.

Another example of the unified physics in AgX is the integration of wiresand rigid bodies, i.e. it can simulate interaction between objects and wires(Servin et al., 2011).

AgX is able to simulate completely stiff and jointed mechanical systems(Lacoursiere, 2007). Stiffness of constraints in physics-based simulations ishow hard it is to break the properties of a certain constraint, e.g. if the con-straints are completely stiff several objects constrained together would act as asingle rigid body, e.g. a building constructed by several different parts. One ofthe advantages of using several constrained objects as one instead of a singleobject is that a user can extract the forces applied to each constraint, and alsoremove constraints when needed, e.g. a building that collapses after collisionwith another object.

The stiffness of a constrained object can also be set weaker, e.g. to representdifferent kinds of materials and object softness, an example of a constrainedbeam with a little weaker stiffness is seen in Fig 2.11. A weaker stiffness couldbe used to construct softer objects, e.g. rubber-like objects or swaying trees.

In constrast to the Houdini physics, an AgX simulation are set up in textfiles. The files describe the physical objects and environment to be simulated.Furthermore, specific functionality can be described in form of callback func-tions. AgX uses the same simulation setup pipeline as Colosseum3D (Backman,2005). For representation of the environment and objects the files can be inform of code (C++ and Lua) or a simple in-house data format. Callback func-

2.5. AgX 17

tions need to be in the form of code.

18 Chapter 2. Theory

Chapter 3

Survey

A survey was performed with visual effects professionals at Digital Domainduring a three week visit to Los Angeles, California, in May 2011. DigitalDomain has produced visual effects for big movies like Titanic, Transformers:Dark of the Moon, and Tron: Legacy. The survey intended to examine howphysics is used in visual effects today and how AgX could be integrated in thevisual effects production to improve the use of physics in visual effects. Fourinterviews were performed with people from different areas of visual effectsproduction; A creative director of software, a software developer, a computergraphics supervisor and a commercials visual effects supervisor. Furthermore,several meetings were held to discuss the production pipeline for physics invisual effects and general physics-based simulations. This chapter will describediscussion topics about the use of physics simulations in visual effects.

3.1 Methodology

The survey was done with qualitative interviews and meetings. Two generalquestions were asked; What do you want for new capabilities in the near futureand What is important properties for tools in visual effects. The answers led tofurther discussions around the topic which were noted and reviewed.

Before and during meetings and interviews, the participants were shownseveral videos of AgX MultiPhysics to be able to compare and use as a refer-ence during discussions. Simulations made by Digital Domain with the cur-rent use of physics were also used as reference. Furthermore, after the surveyinformation had been reviewed, some possible development scenarios were pro-duced. The development scenarios were later discussed with and ranked by theparticipants.

The following three sections summarize what was said during the interviewsand meetings regarding the two questions and the development scenarios.

19

20 Chapter 3. Survey

3.2 Wanted capabilities

Several features of the current physics simulations in visual effects and alsofeatures that the participants thought interesting were discussed. The mostprominent are described in following sections.

3.2.1 Stiff constraints

The physics engine used in DROP cannot handle stiffly constrained objects,only really small systems (10-15 bodies) are able to act as one body. Oneexample is a collapsing building, where the building should act as one singlebody during several frames and then collapse from the impact of another object.Currently this sequence could not be simulated with the same input during theentire scene. Instead, the initial building has to be simulated separately fromthe collapsing building.

All participants saw big benefits from having the stiffness of constraintsthat exists in AgX. The example building can then be initially constrainedwith some of the constraints vanishing when the impact takes place.

3.2.2 Fluid-rigid body interaction

Another major point was fluid rigid body interaction, the current physics sim-ulation method in Fsim has no support for interaction between fluids and dy-namic rigid bodies, i.e. simulated rigid bodies. Instead a customized processfor handling such scenes have been developed. The process alternates betweenrunning the fluid simulation and the rigid body simulation. The fluids uses therigid bodies as static bodies in its simulation, and the rigid body simulationextracts forces from the fluids simulation and adds them to the dynamic bodies.

The alternating process is slow and inefficient. However, one benefit is thatsome artistic control remains in the rigid body simulation.

In sequences where the interaction is in focus and the effects on both fluidand objects must be clear, the participants saw the use of AgX fluid as a greatsolution. The example scenario discussed was where a helicopter crashes intoan ocean. The scenario requires great detail on the interaction between fluidand object, which was not satisfactory in their current physics methods.

3.2.3 Cloth and hair

Cloth was another interesting system discussed during both interviews andmeetings. While AgX did not have an implementation of it at the time, someproperties of the physics engine indicates that it would yield good results, e.g.the stiffness of constraints. The human eye and brain is very sensitive for alldefects with simulated cloth (Goldenthal et al., 2007), and the main problemis to make it as flexible as real fabric while keeping it inextensible, e.g. it doesnot stretch from its own weight.

3.3. Simulation tool properties 21

Similar to the discussions about cloth were the discussions about hair. Hairis one of the most complicated areas of visual effects in contemporary filmproduction. No solution has solved all issues hair brings, e.g. hair collision,huge numbers of hairs and natural look. As in the case with cloth, AgX hasproperties the participants found interesting during the discussions.

3.2.4 Rigid body vector fields

Some participants expressed the opinion that DROP lacked a good way to addand configure vector fields, to influence the bodies. An example sequence isthe effect of a shockwave, which could send all objects in a certain direction.The requested effects is available for fluids in Fsim.

3.2.5 Fluid tool simplicity

The participants discussed the simplicity of Fsim for using their current fluidsimulation. While their tool was highly configurable, it was not visually repre-sented in an intuitive way inside Houdini and it was hard to test different partsof the simulation without running the entire simulation.

3.2.6 Future features

Two additional features was briefly discussed during the conversations; aero-dynamics and large scale fire/smoke. Aerodynamics would allow rigid objectsto interact more with the air surrounding it, e.g. creating a gust of wind orflying a helicopter. The large scale fire/smoke feature was described with thecomment ”We want to set a city on fire”.

3.3 Simulation tool properties

During discussions and interviews several general points came up. These didnot directly specify certain capabilities, instead it was general things to thinkabout concerning the current and future use of physics. Many participants inthe discussions consider these properties more important than new features.

3.3.1 Scalability

In visual effects, everything is about the scalability of the simulated systems.Everything new has to be bigger than the old1. Several parts of this conceptis important to visual effects artists and other professionals. For rigid bodysystems there are two major aspects that are important to rate in scalability;total number of bodies and total number of constraints. Rigid body simulationsused in contemporary film production often simulates large breaking objects

1Or as one of the participants put it: ”We want to blow up bigger things in greater detail”

22 Chapter 3. Survey

with lots of debris and the general opinion of the visual effects professionalsis that more is better. Today the visual effect of a building collapsing inseveral pieces is often simulated in several steps, with large pieces simulatedfirst and small debris added from them at a later stage. This makes large piecesunaffected by collisions with small debris. While this is not a major issue, a lotof time could be saved simulating everything at the same time. For constraintsthe same reasons applies, with many constraints in a simulation the amount ofrigid bodies have to be decreased with a factor of ten. This makes it hard tosimulate large constrained systems, e.g. twenty storey buildings collapsing.

Scalability is also important in fluid simulations, not only do visual effectsprofessionals want to increase the size of fluids simulated, they also want toincrease the resolution of the fluid. The size in this case can be thought of asthe amount of fluid simulated, e.g. a glass of water compared to a tsunami,and the resolution is the detail of the simulated fluid. In the future the fluidssimulations should be able to simulate a large fluid system, for example a partof an ocean while still splash with small drops from the impact of a tennisball. A potential solution other than simply increasing the amount of data forlarger systems exists, such as a varying resolution. In the ocean example thesimulation would have a low resolution everywhere except around where theball strikes.

3.3.2 Determinism

Determinism is important for all types of simulations in visual effects. De-terminism in physics-based simulations imply that the simulation will behaveexactly the same given the same input. For visual effects it is desired that achange of a small independent part of a simulation does not influence the otherparts. For example, if a director has approved a certain simulation with theexception of a small part that needs to be changed, a new run of the simulationwith the changes applied should not alter the whole simulation.

3.3.3 Data

Two aspects of data handling from physics-based simulations is interestingaccording to the participants in the survey. First of all, it is very importantthat all information about a simulation is possible to save and load from anexternal file. This is useful when simulating large systems which need to bepaused and resumed, or when errors occur, e.g. if a simulation crashes after fourhours the user must be able to resume from precisely the moment before thecrash. Secondly, as much data as possible should be possible to extract from thesimulation about everything inside it. When visual effects artists runs physicssimulations they want as much information as possible. One example is if anartist wants to produce a sequence of a collapsing building. In this case it isuseful to know where the largest forces appears on the building to know whereit should break first. This information must be possible to extract from the

3.4. Development scenarios 23

simulation. After the simulation, smoke and small debris could appear wherethe building has shattered and should have a similar velocity and direction asthe part it is appearing from. This information must also be possible to extract.All types of stress data that the user can extract from the simulation can helpthe artist to create an as realistic and nice looking simulation as possible.

3.3.4 Features over simplicity

One key opinion among all participants in the survey is that features are al-ways more important than simplicity. The visual effects in contemporary filmproduction is always looking for the ”next step” to take in new features and insheer size and detail. To be able to produce something that no other companycan do is highly regarded in the business, and they allow for advanced tools tomake it so. Furthermore, configurability is another very important aspect ofall tools used in film production according to the participants. The artist wantto be able to tweak all parameters in the simulation and add limitations andenhancers to make the simulation behave exactly the way the director wants.The trade-off between features and simplicity is slightly different for visual ef-fects production for commercials. The commercial clip visual effects productiontime is much shorter than the production time for films, which makes simplic-ity and intuitivity important. While configurability is still the most importantproperty, it is also important that a simple scene is easy to set up. Whenproducing a sequence for three weeks it can not take one week of learning thetool and setting up the first version of the simulation. This makes having gooddefault configurations or templates, e.g. a template for using a water fluid withviscosity and density parameters already set, a great benefit.

3.3.5 No step back

The final and most important point made by the participants in the surveyis that new tools for physics simulations can only be improvements, nothingcan be allowed to become worse than the previously used tools. A new toolcan not, even if it is an improvement in some aspect or adds some features, beslower or unable to handle something previously possible.

3.4 Development scenarios

The development scenarios were constructed after discussions and interviewswith visual effects professionals, and later reviewed with the same participants.Listed are some scenarios, including the most interesting and discussed ones.

– Replace the DROP physics engine with AgX.

– Build a completely new rigid body system tool with AgX, to replaceDROP.

24 Chapter 3. Survey

– Add AgX constraint fluids to DROP.

– Build a AgX constraint fluid tool outside DROP.

– Add AgX wire functionality to DROP.

– Use cloth built in AgX.

– Use hair built in AgX.

– Add physics to modelling environments.

3.4.1 Replace the DROP physics engine with AgX

This scenario would require a implementation of DROP with AgX as physicsengine. The implementation would keep the interface for DROP and all itsfeatures, while taking advantage of AgX’s stiff constraints and other features.The advantages of doing the AgX implementation this way is that no new workprocedures need to be taught. Furthermore, it would be a fast and simple im-plementation to do, and would utilizes several features of DROP not directlyrelated to physics engine. However, DROP is a pretty specialized implementa-tion and could restrict an intuitive use of AgX.

All participants viewed this development scenario as the first step to a fullimplementation of AgX. The fact that this scenario should be reasonably fastand simple to do means that testing and further development of AgX in DROPcould begin sooner than in other scenarios. However, several participants ex-pressed the fear of being stuck in this implementation. Which is why this kindof implementation should be regarded as a first step, with either additions inform of features or a completely new implementation as the next.

3.4.2 Build a completely new rigid body system tool withAgX, to replace DROP

As implied in previous section, replacing DROP is seen as a harder and slowerprocess than integrating AgX in DROP. However, several advantages to build-ing a new rigid body system interface with AgX exists, e.g. the implementationwould allow for intuitive use of new AgX features such as wires and fluids.

Some participants expressed their wish to have a new rigid body systeminterface replacing DROP. This would allow for a implementation that couldbe maintained and upgraded more easily. However, this was seen as a stepafter changing DROP to use AgX as physics engine.

3.4.3 Add AgX constraint fluids to DROP

This implementation would require AgX integrated in DROP as explainedabove. The addition of the constraint fluid of AgX would allow for full in-tegration of rigid bodies and fluids, with the features of DROP and recognition

3.4. Development scenarios 25

Figure 3.1: A possible fluid setup. All three inputs are small networks of nodes.

from the users. The big advantage of doing this implementation would be thesimplicity of using ridig bodies and fluids together. A disadvantage is thatDROP never was intended for fluid functionality and thus do not have an easyand intuitive way of setting up fluid simulations.

If an implementation with AgX in DROP were performed, the addition ofAgX constraint fluid seemed natural according to the participants. The con-straint fluid was also the most desired addition to the current physics effects,with the integration between rigid bodies and fluids in focus. However, theparticipants discussed the scenario in regards to how the fluid could be inte-grated. Two options were debated; that the fluid integration should be usedas their current fluid, or if the fluids should be used in a more intuitive way inthe DROP structure. Their current fluid interface consists of one node with allfunctionality in one place, which sometimes can be difficult and unintuitive. Abetter solution is to implement the constraint fluid interface as several nodesthat fits together with a rigid body system. A possible interface can be seen inFig 3.1.

3.4.4 Build a AgX constraint fluid tool outside DROP

If no integration of AgX in DROP is made, the constraint fluid could be im-plemented by itself or in the new rigid body system setup made for AgX. Ifthe constraint fluids was implemented by itself, it would lack the integrationwith rigid bodies, with the exception of static bodies, and could be used inthe same manner as FSim. An implementation of the constraint fluid in a newrigid body system interface made for AgX would not have any limitations instructure or features, but would require much work.

The discussion about a fluid implementation in a new rigid body systeminterface covered the same aspects as with an implementation inside DROP,how the integration should be done. The same options as with the DROPimplementation were discussed and the same conclusions were drawn. An im-plementation of AgX constraint fluid outside any rigid body system interfacewould have the same features as the current fluid interface has, and shouldtherefore work the same way to make the transition for current users easy.

26 Chapter 3. Survey

Figure 3.2: Several constrained objects in a line or following a curve can behair.

3.4.5 Add AgX wire functionality to DROP

This implementation would allow AgX wire objects to be integrated with reg-ular rigid body physics. It would allow scenes were wires affected objects in away current methods for wires or ropes will not.

The participants of the survey saw no real use of this feature in currentvisual effects. Wires and ropes simulated in visual effects are mostly not loadbearing.

3.4.6 Use cloth built in AgX

An implementation of cloth in AgX would be able to interact with rigid bodiesand other AgX features, e.g. if fluids was implemented. A cloth interface couldbe implemented in DROP which would be the fastest and most effective wayof implementing AgX cloth that would integrate with rigid bodies.

If an implementation of AgX cloth should be implemented, the participantsagreed that it should be unified with a rigid body interface. The participantsemphasized that if such implementation should be done, it is important thatthe implementation also supports fluids. If AgX cloth could interact with fluidsit would be able to simulate sequences other cloth simulations can not, e.g. apiece of cloth getting wet after being dragged in water. A fluid-cloth interactionis required for AgX cloth to be interesting.

3.4.7 Use hair built in AgX

The specialized request of creating hair in AgX came from one of the partic-ipants and is seen as one possible development. The hair would in this caseconsist of several constrained objects in a line, see Fig 3.2 With an AgX im-plementation in DROP, a hair feature would not require a lot of effort. Theadvantages is clear, hair that can collide with other objects as well as itself.

To use hair built in AgX in visual effects is one of the most wanted develop-ments. Having AgX’s collision stability and stiff constraints in hair simulationwould be of great benefit in visual effects.

3.5. Results of the survey 27

3.4.8 Add physics to modelling environments

This development scenario is different from the rest. It would not run anyof the simulations shown in films or clips. Instead, it would be used whenmodelling and setting up an environment for any scene in visual effects , madein e.g. Houdini or Maya. With this implementation, an artist setting up anenvironment of objects could run a short simulation of the current scene andobjects would fall in place by gravity. This would result in all objects lying inphysical correct places with no gaps or intersections. This kind of feature wouldhave to be really fast and simple to be of help for artists creating environmentsin visual effects.

The participants find this idea really interesting as it would simplify theprocess of setting up environments particularly for physics simulations. Itwould however also need to be configurable, e.g. allowing some objects notto be affected by gravity.

3.5 Results of the survey

From the survey an internal ranking among the development scenarios wascreated. The participant’s opinion about wanted features has influenced theranking the most, but also their opinion about AgX features. One or moredevelopment scenarios will be chosen for prototyping using this ranking.

3.5.1 Ranking

1. Replace the DROP physics engine with AgX, i.e. get AgX functionalitye.g. stiff constraints.

2. Add AgX constraint fluid to DROP.

3. Use hair built in AgX.

4. Build a completely new rigid body system tool with AgX, to replaceDROP.

5. Build a AgX constraint fluid tool outside DROP.

6. Use cloth built in AgX.

7. Add physics to modelling environments, e.g. Houdini or Maya.

8. Add AgX wire functionality to DROP.

28 Chapter 3. Survey

Chapter 4

Experiments

A prototype implementation of the highest ranked development scenario wasperformed during the thesis. The highest ranked development scenario was”Replace the DROP physics engine with AgX”.

In the prototype, the physics engine that did the actual simulation in DROPwas replaced with AgX. The DROP node structure was retained. However, theprototype does not support every DROP configuration and setting. HavingAgX as the physics engine in DROP was seen as a base implementation whichcould then be extended with more AgX specific capabilities.

4.1 Simulation scenarios

The prototype allows for some basic property testing, mainly the constraintstiffness and the general speed of the simulation. Simulation scenarios were con-structed to evaluate these properties. Two different scenarios was set up to testthe stiffness and speed; simulating a brick wall constructed from constrainedobjects and simulating large amounts of convex objects. Convex objects arethe basis for all rigid body simulations at Digital Domain.

Two different solvers are used in AgX; a direct solver and an iterative solver.A solver is the part of a multibody physics engine that actually calculates thebehavior in the simulation. The direct solver is able to simulate infinitelystiff constraints and contacts while the iterative solver is faster in systems notrequiring completely stiff constraints.

The simulations were set up as a node network with DROP nodes as de-scribed in Chapter 2.4.1. Furthermore, several parameters and attributes wereset in some of the nodes to make the simulation behave as intended, e.g. objectsweights and solver timestep.

29

30 Chapter 4. Experiments

Figure 4.1: DROP brick wall scene, it contains 80 rigid body objects in formof bricks in a wall and a sphere with an initial velocity towards the wall.

4.1.1 Brick wall

To evaluate the stiffness of constraints a brick wall simulation was set up. Thebrick wall simulation consists of 80 bricks constrained as a wall standing onthe ground. Each brick is 0.1m in height, 0.2m in width and 0.5 in length andweighs 2kg. The wall is set together with 640 constraints to create a solid wallthat should not break from impact. A constraint between two objects is meantto keep the objects in exactly the same position and rotation in relation to eachother, this is called a lock constraint. A ball with radius 0.3m will be throwntowards the wall. The ball weighs 2kg and will be sent orthogonal towards thewall at a initial velocity of 10m/s. The whole scene can be seen in Fig 4.1.

The expected realistic behavior of the setup is that the ball should bounceof the wall with little or no effect on the wall since it is very light in comparisonto the wall. The wall should behave as a single flat object.

4.1.2 Convex objects

To compare the simulation speed of AgX and DROP two scenarios with a largenumber of objects was simulated. The only difference between the two scenariosis that lock constraints were added in the second between close objects. Thescenario is built with 12800 octahedrons. Each octahedron has an edge lengthof 0.3m and weighs 13.5kg. The objects are organized in small clumps of

4.1. Simulation scenarios 31

Figure 4.2: DROP convex scene, it contains 12800 rigid body objects in formof octahedrons (8-sided dice) falling on a flat surface.

objects in eight large sphere shapes. In the constraints scenario each smallclump will be constrained together to act as one body. The total number oflock constraints was 76800. All objects are organized over a large flat surface,like a tabletop. The entire simulation setup can be seen in Fig 4.2

The expected behavior of the first scenario is that all objects should fallindependently on the surface, colliding with it or other bodies. Objects shouldbounce and finally come to rest on the surface. The behavior of the secondscenario should be similar, but each of the clumps of objects should act as onesingle object.

32 Chapter 4. Experiments

Chapter 5

Results

This chapter shows results of runs of the simulation scenarios. In the brickwall scenario, several images are shown for subjective comparison between AgXand the original DROP. In the convex objects simulations, speed graphs arepresented.

5.1 Brick wall

The brick wall scenario was simulated with a timestep of 1/120s and produced24 frames for each simulated second. The scenario was simulated for 3 seconds.The ball impacted the wall at frame 8 and bounced back. As shown in figures5.1 and 5.2, the AgX brick wall stood still during and after the impact ofthe ball. The original DROP brick wall began to wobble elastically from theimpact of the ball and fell down. The AgX wall behaved like a single solidobject, where as the original DROP wall behaved like a rubber object.

Several different masses for the ball were simulated apart from the simula-tion described here. The walls behaved the same for almost all masses on theball. However, if the ball has a high enough mass compared to the brick wall,the AgX wall will also fall down. However, the wall will not wobble nor lookrubbery.

33

34 Chapter 5. Results

(a) AgX brick wall frame1. Ball heading towards thewall.

(b) Original DROP brick wallframe 1. Ball heading to-wards the wall.

(c) AgX brick wall frame 10.Right after the ball have col-lided with the wall.

(d) Original DROP brick wallframe 10. Right after the ballhave collided with the wall.

(e) AgX brick wall frame 20.The wall stands still.

(f) Original DROP brick wallframe 20. The wall begins towobble.

(g) AgX brick wall frame 30.(h) Original DROP brick wallframe 30. The wall fallsdown.

Figure 5.1: Simulation of a lock constrained wall getting hit by a light ball,frames 0-30. The AgX wall (left column) stands still whereas the originalDROP wall (right column) wobbles and falls down.

5.1. Brick wall 35

(a) AgX brick wall frame 40.(b) Original DROP brick wallframe 40. The wall fallsdown.

(c) AgX brick wall frame 50. (d) Original DROP brick wallframe 50. The wall fallsdown.

(e) AgX brick wall frame 60. (f) Original DROP brick wallframe 60. The wall slides onthe ground.

(g) AgX brick wall frame 70.(h) Original DROP brick wallframe 70. The wall lies on theground.

Figure 5.2: Simulation of a lock constrained wall getting hit by a light ball,frames 40-70. The AgX wall (left column) stands still whereas the originalDROP wall (right column) wobbles and falls down.

36 Chapter 5. Results

Figure 5.3: Simulation time graph, no lock constraints. Before frame 17 allobjects are in free fall. At 17 the first objects reached the surface. At frame 50all objects have reached the surface. Objects continue to bounce until frame80, where most objects have come to rest.

5.2 Convex objects

The convex objects scenarios tests the speed of the simulations with AgX andDROP. The simulation times includes the time of the actual simulation only,e.g. no rendering or set up. The simulation was run with a timestep of 1/120sand produced 24 frames for each simulated second. The simulation was run for100 frames.

The simulations were performed on a computer with an dual core proces-sor at 2.13GHz each, 4GB of RAM memory and the Ubuntu 10.04 operatingsystem.

At about frame 17 the octahedrons began to make contact with the surfaceand all have reached it at frame 50. The octahedrons bounced and most cameto rest at about frame 80.

A graph was produced for each convex object scenario. In each graph, threesimulations are represented; DROP, and AgX with one and two active threads,respectively. The graph in Fig 5.3 shows the time the simulation take for eachframe for the first scenario, i.e. without constraints. The second scenario’sgraph 76800 constraints, can be seen in Fig 5.4.

5.2. Convex objects 37

Figure 5.4: Simulation time graph, with lock constraints. Before frame 17 allobjects are in free fall. At 17 the first objects reached the surface. At frame 50all objects have reached the surface. Objects continue to bounce until frame80, where most objects have come to rest.

38 Chapter 5. Results

Chapter 6

Discussion

This chapter contains discussions and conclusions drawn from the results andthe survey. It contains a discussion about the simulation results. Furthermore,it shows limitations to the project prototype and a section describing possiblefuture work as continuation of the thesis.

6.1 Simulations discussion

The brick wall simulations show that the replacement of the old physics enginein DROP would give the visual effect artists a tool for creating really stiffconstraints in more realistic ways than currently possible. While this is a testscene, it could easily be applied to a bigger visual effect scene as a collapsingbuilding. It would only require a feature in DROP where constraints breakafter having too much force put on them.

The simulation speeds in the convex simulation runs shows that AgX shouldbe as fast or faster in large systems compared to the current physics engine inDROP. Since the original DROP does not have any support for the use ofmultiple processor cores, the gap between AgX and the original DROP shouldonly increase with the use of better computers with more cores. Thus, thespeed of AgX complies with the request by the participants that new toolsmust be scalable and better than the current.

Since AgX allows using the direct solver and iterative solver in the same sys-tem, a full AgX integration would be able to simulate infinitely stiff constraintsin an huge system at great speed. An example often used in the thesis is ofa collapsing building. With AgX it would be possible to constrain pieces of apre-shattered building so that the building acts as a single object. If an impactwas made on the building, the forces applied to each constraint between piecesin the building could be extracted from the simulation, and the constraintscould be removed if the force reached a certain threshold. The constrainedpieces would be simulated with the direct solver and the loose pieces with the

39

40 Chapter 6. Discussion

iterative, this would make it possible to simulate a large building with gooddetail.

6.2 Conclusions

All visual effects professionals that have taken part in the discussions or in-terviews for this thesis have expressed that they think the AgX physics enginewould be a great addition for the contemporary visual effects production. Themain issue with developing a big product for the visual effects market is theconstant project-specific needs and deadlines. However, much could probablybe gained by having a fast and stable physics engine as a base for more specificsimulations. The results show that AgX satisfies these requirements.

6.3 Limitations

Since the implementation is a prototype it have several limitations, most unin-teresting for the thesis. However, some features would have been nice to haveduring the testing, two of the most interesting are mixing of direct and iterativesolver and a small fluid system in DROP.

One big strength of AgX in terms of configurability is that it can solvedifferent contacts and constraints with different kinds of solvers. This wouldallow for a big constrained system being solved with the direct solver allowingfor full stiffness, while loose bodies could be solved iteratively. This would mostcertainly improve on both looks and speed of the current simulation alterna-tives.

The addition of a small fluid system in DROP would allow for testing theinteraction between fluids and bodies in the manner that the current visualeffects is built. Even though no good comparisons could be made as the currentfluid system do not have a comparable interaction.

6.4 Future work

Since the survey of this thesis, further development of a tool for simulatinghair for visual effects has been prepared. This development would use AgXconstrained objects with low stiffness to simulate guide hairs. The guide hairswould interact with objects and each other. The actual rendered hair would becreated aligned with the simulated guides to get a natural behavior, e.g. wheninteracting with rigid bodies or each other.

Further work with the integration of AgX in DROP is under discussion.

6.5. Summary 41

6.5 Summary

Creating a visual effects clip for a contemporary movie is a complex task.Several different kinds of artists are involved and must collaborate to fulfill thedirector’s requests. Several 2d and 3d-artists have the job to create both high-and low-detailed objects and environment that fits in the simulated scene. Thelow-detailed objects are used in the simulation, while the high-detailed objectsare shown in the movie. The simulations are set up by a technical director andare run a great many times with different parameters in an iterative processuntil the director is satisfied.

More often than not, the visual effects clip has several different simulationsin it. An example scene could be a war scenario, where a car explodes whilebullets rain down close to the main character. The exploding car itself would besimulated with several different simulations; one simulation for the car objectincluding falling debris, one simulation for the fire visualising the explosion, andone simulation for the smoke cloud rising up after the explosion. Furthermore,small rigid body and smoke simulations could be created for each impactingbullet. Add to this, cloth and hair simulations on the main character and yourealise how much effort that needs to be put down for a scene filled with visualeffects. AgX could decrease the work needed to create the example visual effectsclip and increase the realism by simulating some effects together.

As shown in this thesis, AgX should be a great addition to improve thesupport for Advanced Physics in a Visual Effects.

42 Chapter 6. Discussion

Chapter 7

Acknowledgements

I would like to thank the whole staff at Algoryx Simulations AB for making mefeel welcome and giving me a great work environment. Special thanks to mysupervisor at Algoryx, CTO Anders Backman and the CEO Kenneth Bodin forgiving me the opportunity to do this Master’s thesis and sending me to DigitalDomain in Los Angeles. All the kind people at Digital Domain also has mythanks for all the help and information I received during the visit. Many thanksto my supervisor at Umea University, Niclas Borlin, without whom every otherrow of text would look like crap.

43

44 Chapter 7. Acknowledgements

References

Algoryx (2011, March). AgX Multiphysics and 3D simulation. Algoryx Simu-lation AB. http://www.algoryx.se/.

Backman, A. (2005). Colosseum3D - Authoring framework for virtual environ-ments. EUROGRAPHICS Workshop IPT & EGVE Workshop 2005.

Barbic, J., M. da Silva, and J. Popovic (2009, July). Deformable object ani-mation using reduced optimal control. ACM Trans. Graph. 28, 53:1–9.

Bodin, K., C. Lacoursiere, and M. Servin (2011). Constraint fluids. IEEETransactions on Visualization and Computer Graphics 99 (PrePrints).

Bridson, R. (2008). Fluid Simulation for Computer Graphics. A K Peters/CRCPress.

Bridson, R., J. Houriham, and M. Nordenstam (2007, July). Curl-noise forprocedural fluid flow. ACM Trans. Graph. 26. Article 46.

Coutinho, M. G. (2001). Dynamic simulations of multibody systems. London,UK: Springer-Verlag.

Enright, D., S. Marschner, and R. Fedkiw (2002, July). Animation and ren-dering of complex water surfaces. ACM Trans. Graph. 21, 736–744.

Erleben, K. (2005). Physics-based animation. Graphics Series. Charles RiverMedia.

Goldenthal, R., D. Harmon, R. Fattal, M. Bercovier, and E. Grinspun (2007,July). Efficient simulation of inextensible cloth. ACM Trans. Graph. 26.Article 49.

Kerlow, I. (2009). The Art of 3D Computer Animation and Effects (4th ed.).Wiley Publishing.

Lacoursiere, C. (2007). Ghosts and machines : Regularized variational methodsfor interactive simulations of multibodies with dry frictional contacts. Ph. D.thesis, Umea University, Computing Science.

45

46 REFERENCES

Liu, Z. (1996). Efficient animation techniques balancing both user control andphysical realism. Ph. D. thesis, Princeton University, Princeton, NJ, USA.AAI9701241.

Ngo, J. T. and J. Marks (1993). Spacetime constraints revisited. In Proceed-ings of the 20th annual conference on Computer graphics and interactivetechniques, SIGGRAPH ’93, New York, NY, USA, pp. 343–350. ACM.

Pentland, A. and J. Williams (1989, July). Good vibrations: Modal dynamicsfor graphics and animation. SIGGRAPH Comput. Graph. 23, 207–214.

Popovic, J., S. M. Seitz, and M. Erdmann (2003, October). Motion sketchingfor control of rigid-body simulations. ACM Trans. Graph. 22, 1034–1054.

Popovic, J., S. M. Seitz, M. Erdmann, Z. Popovic, and A. Witkin (2000).Interactive manipulation of rigid body simulations. In Proceedings of the27th annual conference on Computer graphics and interactive techniques,SIGGRAPH ’00, New York, NY, USA, pp. 209–217. ACM Press/Addison-Wesley Publishing Co.

Servin, M., C. Lacoursiere, F. Nordfelth, and K. Bodin (2011). Hybrid, mul-tiresolution wires with massless frictional contacts. IEEE Transactions onVisualization and Computer Graphics 17 (7), 970 – 982.

SideFX (2011, June). Houdini Development Kit. Side Effects Software.http://www.sidefx.com/docs/hdk11.0/main.html.

Thomas, F. and Johnston (1981). Disney Animation - The illusion of life. NewYork, NY, USA: Abbeville Press.

Treuille, A., A. McNamara, Z. Popovic, and J. Stam (2003, July). Keyframecontrol of smoke simulations. ACM Trans. Graph. 22, 716–723.

von Borries, F., S. P. Walz, and M. Bottger (2007). Space Time Play: ComputerGames, Architecture and Urbanism: The Next Level. Birkhauser.