Intro to Graphics 25 - Simulation in Graphics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
well thank you for joining another lecture for introduction to computer graphics now we've been talking about animation and computer graphics and we spent a bit more time talking about physics-based animation we're going to spend even more time on that topic today uh we're going to cover simulation in computer graphics right this is going to be about physics-based animation and i'm going to talk about all sorts of different tools that are used in computer graphics but this is not intended to be a comprehensive overview of every simulation related thing in computer graphics but we're going to cover some of the basic stuff i'm not even going to talk about every simulation related stuff that i've done in computer graphics but we're going to cover some some more common things some more fundamental things that that happen in computer graphics not not everything and i'm going to cover these at a relatively high level instead of going into too much detail of what exactly happens i would like to give you a high level overview of how the simulation problems are solved in computer graphics and i think the the topic that we covered last time talking about the details of how mass spring simulation is amber will give you enough of a background for you to sort of understand the technical stuff that i'm going to talk about today but the technical stuff is going to be relatively limited so this is going to be in terms of technical content it's going to be relatively light lecture but the my whole intention of this is to give you a general idea about how simulation related stuff is handled in your graphics all right so let's start with our first stop we're gonna start with over here uh rigid body simulation so this is a video from a relatively recent nvidia demo uh so let's let's watch this video here as you can see then the player is throwing some balls on top of some rocks and the rocks are colliding with that ball and bouncing around now we're going to jump into this bulldozer uh there it is and then we're driving the bulldozer into these rocks uh and of course there's going to be some collusions we're going to push them around so as you can see you know there are quite a few objects here they're colliding with each other stacking on top of each other this is physics a media's gpu a rigid body simulation system on a simulation system uh that can handle rigid bodies uh so the concept of rigid body simulation and things like this is not very new now this is a relatively recent demo and what's impressive here is that this is real time and it's there's lots of rocks here or lots of rigid bodies that's what's impressive here but the whole concept of rigid body simulation actually has been around in computer graphics for for quite some time in real time replay simulation has been around in computer graphics but nonetheless i really like this video i want to show it to you if you only knew how how difficult it was for what i had to do to uh get this footage for you guys but i hope you enjoyed um yeah so this is the the gist of engine all right let's um let's move on and talk about what's what's going on here a little bit right so um we talked about mass spring simulation not rigid body simulation and with mass spring stimulation we had particles right so each particle had a mass and they were point particles that's what we had with mass spring simulation with rigid body simulation instead of particles we have rigid bodies and they're a little bit different right so a particle has a position and that's it but a rigid body has a position and it can also rotate around that position right so i need to know not just his position but also its orientation so for a particle we only have its position that means it only has three degrees of freedom what are those three degrees of freedom it's positioned in x y z you can think about it that way you can use a different sort of coordinate frame for this but in 3d a particle a point particle will only have three degrees of freedom however you represent that whatever important frame or representation you use it's going to have three degrees of freedom a rigid body is going to have position and also orientation basically rotation so i'm not assuming that it's not it's not squishy you cannot scale it down or up you can only rotate around if that is the case i can rotate it around x y or z or a combination of them so it's going to have three degrees of freedom for position three degrees of freedom for rotation so it's going to have a total six degrees of freedom so if a reached body is quite a bit more complicated than a particle because of that so when you think about how a rigid body interacts with its surrounding for example if i just drop this and it just collides with some object it's not going to just bounce back up right it's going to it's it's the impact of this collision is going to make this this rigid body rotate around and maybe continue falling right so it's the collision events are a bit more complicated here so that what we'll define what what's going to happen to this object when there's a collision is where this where exactly this collision happens in this case over here so there's going to be collision forces applied at this point in the normal direction so there's going to be some force pushing it up in this direction and that's going to create a rotation of the uh of the rigid body right so we kind of need to compute not just the force that's applied to this object but also the torque torque is the rotational force basically we also need to compute the torque that is applied to it um actually in rigid body simulation it's more common to use what we say what we call impulse based collisions so impulse based collisions basically skip the force term and you know defining an acceleration and then acceleration now when you have a force term force defines an acceleration excellent acceleration defines the change in velocity so impulse based collisions instead defines define they they find an impulse instead of a force that impulse directly modifies the velocity or the the rotational velocity right so like it's um uh it's when we directly uh directly modify the velocity based on the collision that that's the more typical thing to do it turns out to be a bit more stable than uh having a force-based formulation of what happens here actually that's pretty much what i suggested that you do for the collisions with our mass spring system so the mass spring system you will be implementing where we're modifying the velocities when there's a collision that's actually a impulse based collision tp right and so depending on where this object collides it's rotates around so because of that you know handling rigid bodies is quite a bit more difficult than just handling sizeless particles another thing about region bodies is that you know this this digital body could be landing on the surface maybe and it's like in this example there are collisions in two places right so that it's it's touching the surface in two places so it's it is stable here right it's not gonna it's not gonna fall in in any direction but if you want to compute this it is possible that maybe i find the collision here at this point in this time step and the next time step i'm going to resolve this collision in this time step and in next time step i find the collision with the the other one so i i might be finding these collisions not exactly at the same time but one after the other and if things like that happens then this object will be just you know vibrating like this non-stop right so as i keep stimulating this object it's going to be vibrating like this now this vibration can be very small so you don't actually notice it but your simulation system will be dealing with that constantly and it's very very difficult to make sure that these two collisions and two places happen exactly at the same time exactly at the same time step right it they may or may not happen and these sort of things are actually very very common it can happen even even if they're not visible now if this is not visible maybe you don't care and maybe it's okay like a simulation like this for example if you don't see this vibration if it's small enough that you can't see maybe it's okay maybe you don't care but in a bigger simulation scenario like the example that i showed you in the beginning the video with lots of rigid bodies um dealing with this sort of thing can be quite expensive right so i have repeated collision events happening and what should happen is that i i would like this this motion to stop right this is this is what i would like to happen basically i would like my simulation to produce absolutely no motion in this case so instead of simulating this and keep getting this sort of unnecessary emotion and i'm not unnecessary computation and unnecessary instability um i what we typically do with rigid body simulation is that we define a rest in contact condition so if you if we detect that an object is not moving at all then there's really no point in simulating this right and we say that oh this object is resting contact it's going to stay there until something happens to it right so it's going to be an object that's resting contact now there are different ways of checking whether or not whether an object is rest in contact and if it's rest in contact if you decide that object is in rest in contact state then you don't have to stimulate it anymore you can just stop stimulating it until something happens to it for example until we have another object that collides with it and at this point we can say oh something hit it so maybe maybe this object is going to move now or maybe not maybe there's going to be enough friction to keep it around then it's not going to move um but of course just like i have an object rest in contact on a stationary collision object here it can also be rest in contact on another object right so these two objects can be rest in contact and actually i just put two objects on top of each other and this is the concept that we call stacking this is in quite a bit of a difficulty here because i have an object that's resting contact that's resting rest it's on an object that's also investing contact right so if i uh sort of hit this object with something then the rest in contact situation for this object must be modified as well so the simulation sort of needs to keep track of this stack and if anything at the bottom of the stack changes state it's not resting contact anymore i kind of need to modify the other object in the stack accordingly and the stack can be quite large right i don't have to have a single object but just two objects i can have quite a few objects stacking on top of each other this sort of thing happens like in the example that i showed you there were piles forming and those piles were very much like this right and if you want to have an efficient simulation of course you don't want to continue simulating these files when when they're resting content all right so these are some difficulties related to rigid body stimulation another very very important topic is the simulation of articulated region bodies so in articulate the rigid body for example you can take a rigid body like this like a rod it's just rigid rod um and i take another rigid rod here and i and i connect them here at this point i'm adding a joint constraint to these two objects so now this becomes this turns into an articulated rigid body as we call it and this system this can bend like this right uh but otherwise this this object will move as as one thing right because of this this joint constraint over here so if you if we look at this system let's try to count the degrees of freedom of this system now i have a rigid body everybody here that has six degrees of freedom just like any other rigid body right and i have another rigid body here that should also have six degrees of freedom but i also have some joint constraints here now the joint constraints will not permit uh rotations around certain angles so it's not going to permit rotations it's only going to permit rotations around one direction so two of these rotation directions will not be permitted that means it's sort of removing two degrees of freedom from the system right it's also these two bodies are also attached together at this joint so this body cannot move independently from this other body right so its position is not really independent so i need to remove its position degrees of freedom as well right so if you count all of these degrees of freedom like six years six there and five removed i end up with seven degrees of freedom right that's you know one way of looking at it here's a maybe an easier way of looking at this you can think of this as just one object now if this were a rigid body i know that you would have six degrees of freedom right it can move around and you can rotate around that's 60 degrees of freedom this object is not a rigid body though it can deform how can it deform it can deform around this joint so around that joint i have one additional degree of freedom because it can bend like this right so if you look at this it's total degrees of freedom will be seven so basically we end up with the same thing obviously right these sort of bridges articulated rigid bodies are very very common in computer graphics and most of our rigid body simulators can handle different forms of articulated regional bodies for example we can have engine engine parts like this uh this is not a simulation it's just an animation of what this object part is doing but you know what this machine component is but it could be it could be a simulation as well so i could have a joint constraint that only allows rotation around this joint um this sort of articulated rigid bodies are also used for ragdoll simulations uh again it's not a simulation just an animation but you know you get the idea um they are used a lot for uh for vehicles also the vehicles are modeled as articulated rigid bodies right and in these sort of simulation scenarios all of these components are actually rigid bodies but they are connected with different types of joints and those joints have different sort of degrees of freedom they allow different types of relative motion so for wheels we know that they will permit rotating around one direction for for joint angles so for like in the for the ragdoll simulation we have joints that can move differently so they can have different constraints they typically have position constraints but they don't have to sometimes we have sliding joints that can happen as well so we have all sorts of different different joints now um when it comes to simulating these sort of things these joint constraints can be applied as different types of forces that hold the objects together but i can apply them as as for example if i want to keep two things together i can apply a spring force with zero length with zero length spring so whenever they move apart the spring force will pull them back together right so that would be one way of applying these constraints and they're actually that's a relatively common way of handling these constraints but they can also be applied as heart constraints that i can define my simulation system and i can remove the degrees of freedom in my simulation system that cannot be modeled by my articulated articulating region body system so if i remove those degrees of freedom from my simulation i guarantee that my articulated rigid body will always obey those constraints or will always obey those joint constraints so this will simply this simplifies the numerics of the simulation a little bit but of course it sort of makes the implementation of the simulation a bit more complicated the implementation becomes a bit more complicated but then you get additional benefits like efficiency but it really depends on what kind of what kind of numerical tools you're using so there are benefits to uh to either approach here so just wanted to say that there are different ways of making sure that these joint constraints are satisfied so that the articulated rigid body actually acts like an articulate region body all right enough about rigid bodies let's move on so if i don't want to have rigid bodies what can i have what can i what kind of bodies do i want to have i want to have probably deformable bodies right so let's look at deformable objects so here's an example deformable object simulation uh so now this is uh from a a a recent work that we're actually working on it's uh the likes of the forming that's what's important uh and the the particular animation the particular simulation method used here is it's what's called a finite element method so i would like to talk about the finite element method a little bit so the finite element method will is one of the one of the methods for simulating deformable objects uh and the way it works is that um we we take an object and we um we uh discriticize it in one way or another we typically for a 3d object we typically uh to realize it we form a whole bunch of tetrahedra out of this object so if you if i were to cut this uh it will look like this right so i have a whole bunch of like each one of this is actually just a digital engine right and the and the reason why we use this is this is simplest 3d element that we can pour and there are various ways of handling this but you can think of this like a triangulation in 3d right we kind of need to worry about the volume and you know this is like the basic element that we typically use we don't help you but we typically use something like this now i'm but i'm going to show you what's happening in in 2d like an example like this let's say that i have in 2d i have i actually i can implement client element method in 2d as well in which case i will have a whole bunch of triangles forming this object and if i have a deformed object it will look like this and the way this works is that for each triangle here for each triangle here so i have this original shape and the deform shape of that triangle uh what's going to happen is that if i deform a triangle or iteration in in 3d then this object depending on its material will apply some forces to its vertices uh so that it tries to recover its original its original breast shape right so this is what we call rest shape and this object in the deformed shape is trying to go to its restraint and the finite element method allows us to compute these forces now there are different material formulations there are different ways of computing these these forces but so i'm not going to get into the details of the mathematical formulation but i think it's sufficient to for you to understand how this method works is basically some mathematical formulation depending on what kind of material model you use here it applies forces to these vertices so in some ways this is this sort of resembles a mass spring system right so these are like the point masses and we're applying some forces to those point masses but we're not connecting them with springs but instead we're connecting them with these uh triangular elements or tetrahedral elements they are defining the forces applied to these to these vertices right so but with a mass spring system that we talked about things are a little bit simpler and this is uh what you guys are implementing its formulation is quite a bit simpler than finite elements and and it is still used it is still a viable method for simulating deformable objects right although although for a lot of simulations finite element method would probably give us higher fidelity so it's uh more favored more recently uh in computer graphics but nonetheless the mass spring systems have use cases too so they can be used for deformable objects they can also be used for simulating brittle objects not just deformable objects but an example of that would be a fracture simulation so here's an example fracture simulation so in this case we have a whole bunch of particles and those mass particles are connected by a spritz with springs and these springs are really super stiff springs so they don't extend that much and if you extend them a little too much or they can vibrate a little bit but they don't they don't extend very much and if you extend them just a little too much the springs are going to break and when they break the the neighboring springs break and the neighboring springs break and the whole thing fractures in a fraction of a second forms these really really interesting fracture patterns so these fracture patterns the fracture pattern that's forming here is not pre-computed this this comes out of the simulation this fracture shape comes out of this mass spring simulation and this mass this particular way of using mass spring stimulation is called paradynamics and this is again a recent simulation work that my student neothrong has been working on but i'm just showing you that this is a fracture simulation using a mass spring system a mass spring system of course can also be uh a mass speed system helps me use for simulating cloth and different types of deformable objects uh so here's a claw simulation example again from a recent work that my student uh has been working on um so in this case you know it's just a regular mass spring system not nothing nothing too complicated about it uh the only difference here is how these different vertices are these different vertices or masses are connected via springs so we have different forms of springs so that can handle an extension and bending and stretching and shear energies but it's just a typical mass spring system that you guys will be implementing for our last project but that spring system can be used for simulating cloth um but typically we use different types of forces than just traditional spring forces in in computer graphics uh so yeah we the most common way of simulating clothing in computer graphics would be uh something like this that we will have a triangulated mesh and the vertices of that mesh would be where our masses would be but instead of having spring forces that connect them we typically use different types of force formulations but conceptually they're actually very very similar to mass spring formulations i'm just saying that they're not quite mass spring formulations because what we apply are not quite spring forces they're just different there might be spring forces as well but we add different types of forces too now what i'm going to show now is just going to be an animation of a commercial product that's using cloth simulation just to show you some close simulation examples in computer graphics all right so if the closed simulation is done right you should not really notice it too much because in reality we're used to seeing cloth before but we don't really pay too much attention to that right so a lot of this cloth motion is going to be quite subtle which is exactly what's intended uh you don't need to be too distracted right but sometimes that cloth washing is going to be a little more exaggerated because that's going to be sort of hero content right and that's what you're trying to do in this example the cloth is moving a lot more and that's what is intended so these are uh different simulation examples generated with this particular choice so it's a very popular collection because you can generate static scenes like this or dynamics you sort of simulate a few frames until claw uh rest and electricity to get these shapes [Music] very nice examples of gossip all right i hope you enjoyed this now i'm going to move on to some other topic here that's going to be fluid simulation here let's remember this now this is mass spring class simulation that i showed you earlier was not necessarily mass spring class simulation uh but this is interacting with a fluid simulation this is also a massive simulation for the fracture it's also interacting with with fluid stimulation now let's move on to how fluid simulation is handled in computer graphics a popular way of doing blue stimulation is particle-based fluid simulation you know as the name suggests we're going to have a whole bunch of fluid particles moving around they may be hitting objects they might be interacting with each other they're not quite connected with springs because this is not a deformable body but the particles are still interacting with each other they're applying forces and so forth so in this case the the membrane down here is a massive simulation that the fluid is the particle-based fluid simulation we don't always render particle-based fluid simulation like this we simulate it like this and then we generate a surface around it and we form a triangular mesh around it and we render that triangular mesh with ray tracing with reflections and refraction so it actually looks like fluid here sort of moves like fluid but it doesn't quite look like fluid because i'm displaying the particles so you can see the particles here now particle-based fluid simulations another name for it is lagrangian blue simulations so if you hear lagrangian hallucinations people are talking about particle-based simulations a common way of a common method of particle-based solution is smooth particle hydrodynamics or sph the way sph works is that for each fluid particle here i look at a neighborhood around that particle and i find the other particles around it within that within that neighborhood and then i'm going to apply forces between these particles forces that are exerted onto this particle uh due to the presence of the other particles around it so these are all shocking forces that are applied to this particle right and these these forces are computed using navier-stokes equations and nobody's source equations are the governing equations of fluid motion uh so these are not quite springs these are like different types of forces even though you know their directions kind of make you think like there are spring forces but they're not quite spring forces like they they are the force magnitude is computed using a different formulation derived from the navier-stokes equations i'm not even showing you the equations they they kind of look a little complicated they're just differential equations but they are basically this f is equal to m a of fluid dynamics that that that's basically what it is they also add a few a few other things it's just that differential equations that define the motion of fluid and these forces that are applied on individual particles are derived from uh from those equations and once you derive the force formulation it's just a matter of finding the neighboring particles around the particle and applying those forces and then you step through your time step and you get your sph simulation that's not not a very complicated topic actually there are complicated problems related to sph stimulation for example how do you make sure that an sph simulation does not generate fluid that is bouncy so if i had if i had spring forces i could create something that's sort of bendy and bouncy and vibrating and sph simulation sort of behave bouncy in a way and that's very distracting because oftentimes we use fluids that are not bouncy for example water we use them for stimulating water and water is not compressible well all right technically it is compressible but very very very little for all practical purposes water is not compressible and that property is very very important a lot of our hydraulic devices are designed around that that fact so you don't want your water simulation to be bouncy right at all and and and solving that using sph type of simulation is kind of hard it's it's a it's a little bit of an issue you know it is possible with some more complicated formulations but it's it's a it's a very difficult thing to do um an alternative technique is instead of trying to solve navier stokes equation using particles like this um it's a differential equation so i can just solve the differential equation so a typical way of solving differential equations would be using some grid-based discretization so that brings us to grid-based fluid simulations so in a great baseball installation i'm going to define a simulation domain first let's say this is my simulation domain and my flute is going to live inside this simulation domain and i'm going to take this simulation domain and i'm going to discretize it into some some grid or whatever resolution that i want all right uh and for each one of the cells here a whole bunch of cells right in 3d for each one of these cells i am going to solve the navier stokes equation in this discretization so basically you uh solve for the pressure and and the velocity terms and i'm going to define all of these in this cellular discretization so one other thing that navi strokes equations define is is divergence that is if there's no divergence that means the amount of fluid that goes into this volume from any one of its faces should be equal to the amount of fluid that comes out of its other faces right if that's not the case then i would be you know compressing or expanding this fluid if this is not compressible right then likewise for example water we we want to have no divergence so we want to make sure that the fluid volume is sort of being preserved here like whatever comes in comes out and and this sort of thing can be more easily solved using this great base fluid simulations and we call these eulerian blue simulations eulerian or grid-based blue simulations uh now these grids don't have to be like regular grids like this you can form different types of discretizations but this is a more common way of defining the breed base or earlier fluid simulations so let me show you um an example of elearning fluid simulation this is a vlog will be old example but i think it's a it's a still a very very nice one as you can see in this case we have a grid-based pre-simulation that's interacting with a very thin cloth simulation so it's generating this interesting fluid motion now it could be used for liquids earlier include simulations but it can also be used for for gases in this case it's a smoke simulation uh again using a grid-based simulation technique and we have used this thing i have used this technique in my research we have used it for computing explosions so this is a grid base or a layering fluid simulation that's computing these these explosions and we're also in addition to the pressure and the velocities we're keeping track of temperature in this simulation and using that temperature we are computing the amount of elimination that is coming out of this explosion this work was actually about rendering this not simulating it it's about efficiently rendering explosions like this using the elimination that they generate so there's no external light source here the entire elimination is coming from the fluid dynamics the explosion simulation basically so explosion simulation defines temperature temperature we convert it to elimination and that elimination is used for renderings so examples of a grid base fluid simulation now grid-based fluid simulations are very good because they can you know solve this this pressure equation make sure that there is no divergence very nicely but then they have issues like they sometimes lose volume and mass and particle-based simulations don't have that problem so we that brings us to hybrid simulation techniques the hybrid simulations try to combine the the strengths of valerian and lagrangian fluid simulations great bass and particle-based blue simulations with grid-based fluid simulations i can solve the pressure really nicely like i make sure that my uh the velocity field that i generate here is divergent screen so it's that my fluid is not supposed to compress but i can still lose volume here because i have a discretization and i'm gonna have some numerical issues here like there's going to be some numerical precision limitations here and because of that these sort of simulations can have issues with preserving mass and volume that would be an issue with particle-based simulations i don't have that problem because i have particles that are directly associated with a some fluid mass right they're not going anywhere unless i delete those particles but i have difficulty making sure that you know my fluid simulation is not compressing and expanding so hybrid fluid stimulation solve this problem by combining these two methods so i'm going to have a grid i'm also going to have a bunch of particles defined inside this grid and using this i can have a nice hybrid fluid simulation so the way that it works is that um i'm going to solve some of the things using particle-based representation and i'm going to solve some of the things using the great base representation for example advection that is the motion of the fluid mass i am going to solve it using the particle base formulation in particle-based representation i have particles with velocities and they move around very easy to compute super easy to compute but then i'm going to take these velocities in their positions in the next time step and i am going to take those velocities and i'm going to going to project them onto this grid and and this when i project all the velocities to this grid it's going to form what we call a velocity field in 3d now this velocity po may or may not be divergence free if it's not divergence 3 i would like it to be diverging speed that versus 3 means that whatever comes into a cell must go out right and i can solve that fairly easily in this grid-based formulation i'm not going to get into the details of how a grid a given velocity field can be converted into a divergent speed velocity field mathy details and skipping but if just trust me when i tell you that it's fairly easy to do using grid-based formulation and once i solve these velocities and i can update the velocities of the particles i can project them backward so this is pretty much how the hybrid fluid simulation works now i'm going to show you an example of hybrid fluid simulation that we used in didn't want my well it works here it's a collaboration with within media phones uh so this is computed on the gpu using a sparse grid structure so that the advantage of the sparkscreen structure is that we don't have to explicitly store every cell of the grid it is using a hybrid simulation model so we're representing all of the particles but not all of the grid cells so we can expand the simulation volume as much as we want and that's what this this simulation is showing that fluid can expand as much as it wants and we can allocate more more cells and extend the food simulation domain as needed these are these were not real time though they were very fast and interactive but these are not real-time fluent simulations but you know we can actually do this sort of simulation real time so i'm going to show you an example of that so david lee has amazing demos and i'm going to show you some of his demos live here all right i believe this is the one all right can you see this can you see the demo all right i hope you can seems like you can alright so here you can draw some fluid volume if you want to and then you say oh start the simulation and it's generating this totally interactive simulation live running in the browser rendering using webgl and it's uh it's a pretty nice and impressive demo i can actually let me see i can increase the number of particles here so we can get at higher resolution let's pick one of the presets okay this one and this is using a hybrid fluid simulation model just like we talked about more specifically it's using the flip simulation model so particles and there's also a grid and you can interact with it so you can see uh handling um you know this many particles however many this is there's not that beginning at all and it's running on the gpu still so there's quite a bit of compute power going on here but you know it's doable real time although if you want to get high fidelity simulations uh like we would use in in movies for example you would probably have a lot more a lot more particles than what's presented here still i love these demos that they're great check them out whatever if you want to all right um i'm gonna stop playing with it now i'm gonna move back to the slides all right so we even did a live demo great um not a code that i've been just making that clear they believe uh you can actually see the source code and everything it's it's really great all right now so the particle base is this hybrid simulation idea of uh having a particle based discretization and also a grid it can also be used for simulating different types of deforming objects for example something like a lava or we can we did this for for another paper so in this case we have a solid object the formal logic is simulated using a hybrid simulation model and also the lava that's melting melting this object is also implemented using the same simulation model and this is almost specifically using the material point method this simulation was also completed on the gpu but not not not real time or interactive but relatively fast and it can be used for all sorts of different things the material point method can be used for simulating it can be used for simulating fluids it can be used for simulating sort of these gui type objects it can be used for simulating the formal deformable solids it's been used for simulating all sorts of different types of objects so yeah it's a very versatile simulation system uh very much the same idea though like there are particles particles carrying certain types of positions of velocities in this case they also also carry deformations along with them or deformation gradients and you know a part of the simulation is done and the particle representation of particle simulation is done at the great representation all right so all of the stuff that i talked about here like all these things they may look sort of different types of things but they're all when you look at them they are using one form of newtonian dynamics right so f is equal to m a is basically what all of these systems are solving one way or another uh so there are different discretizations of the system uh like you can triangulate the model using like fpm uh finite element method or all grid-based fluid simulations use a different discretization volumetric discretization or you can solve them using particles like mass spring systems um or or sph like particle-based simulations but nonetheless at the core of them when you look at them they are all based on this idea of newtonian dynamics right f is equal to m a is what's driving all of these simulations but this is not the only way we can simulate things in computer graphics there's a there's a different concept that doesn't quite use this formulation directly anyway and that brings us to position based dynamics so here's how it works now with newtonian dynamics when i have like two masses connected by a spring what i compute here in this system i have some internal forces right so with newtonian dynamics what i would do is i would compute this force and now from this force i'm going to be using f is equal to m a and that will give me the acceleration right from the forces i get the acceleration and from the acceleration i would compute the change in velocity from the change in velocity i would compute the change in position so this is what newtonian dynamics would do now position based dynamics however will not use this instead of these computing instead of these internal forces position based diagrams uses constraints constraints based on positions so what do i mean by constraints so these forces are gone i'm not even going to look at those forces instead i'm going to have a set of constraints let's call them c and those set of constraints they could be something like um a distance constraint for example these two particles should be a certain distance apart as a distance constraint it's basically like a spring right but it's a distance constraint and from this distance constraint from this distance constraint it directly computes the change in positions so it's not doing all of this compute forces from this whatever distance and from forces computer acceleration and velocity and voltage change and position change it's going directly from these conditions to the position change now there are lots of advantages of this formulation this can be unstable depending on how you solve the system this can be numerically quite unstable right we i've shown you a demo last time with the mass spring simulation if your time step is not small enough with explicit integration our simulation was just blowing up right and this happens because we have this velocity term here that defines the position and this velocity term this velocity change can be quite high because i can have very strong forces generating a strong acceleration and i can have strong velocities and now the whole thing explodes but with this i am just going from constraints to position changes this leads to very very stable simulations so these simulations don't really break that often and you can actually define a lot of different types of materials with this sort of position-based dynamics formulation so i'm going to show you show you an example of a unified simulation system implemented using position-based dynamics and these are some super impressive demos including flute simulations and the form of logics like cloth and strings and and also solid objects here they're represented as particles so this is showing the particle based representation of the same simulation here's another example uh this is probably so there's smoke simulations here going on again just about particle-based representation rendered nicely and this is the particle based rendering of the same simulation and you know it everything moves really nicely and sort of in an expected way and generating really really nice simulations and very very efficiently too and uh interaction of different types of materials can be very easily handled with this type of simulation system so position based dynamics is actually a very very powerful tool uh that's used more and more often in computer graphics today so we're puncturing the balloons filled with water here and the same simulation display as particles so just a great work i love that all right so um this is pretty much what i wanted to talk about when it comes to simulating simulation in computer graphics um before before we end it though i am going to show you a recent reveal from a software that's used in generating all sorts of simulation computer graphics uh poutine is a very very powerful and popular tool used in computer graphics in graphics production and i'm going to show you uh some nice animations that involve simulation generated using using this tool so let's uh let's enjoy it so you can see you can see all sorts of different simulation elements here uh different types of smoke particles going around lots and lots of explosions some fluid dynamics fire [Music] and smoke and dust all sorts of like [Music] rigid body simulations [Music] so these are basically the same simulation models that i talked about combined with a very nice software implementation given to really talented artists to generate some quite amazing vehicles like this [Applause] yeah not all of them want a physics based english but most of these videos [Music] [Applause] you get smoke and water and ground simulation is another thing flocking [Music] [Music] this [Music] and showing different simulations the different bedroom layers and simulations [Applause] all right well i hope you enjoyed this video i'm pretty sure you would enjoy it a bit more without me blabbering while the video is playing so if you want to see the original version of that you know check it out i'm pretty sure [Applause] these are all recent production examples generated using this particular tool thank you for saying that you enjoyed my commentary i'm pretty sure you would enjoy those videos without me speaking in the background i'm not even sure you guys can hear me while the video music is playing i hope that you could alright i'll um with that i'm going to end today's lecture again thank you all and i'll see you all next time yeah thanks
Info
Channel: Cem Yuksel
Views: 764
Rating: undefined out of 5
Keywords:
Id: iZ1e_1tnLgI
Channel Id: undefined
Length: 54min 6sec (3246 seconds)
Published: Mon Nov 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.