1 H17 Masterclass Whitewater System biAv43960218,P1 flv

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is Omar Zarif II and I'm a developer at side effects software today I'll be presenting this masterclass dedicated to the new white water system in Houdini 17 just to give an outline of this presentation I'll begin by introducing the white water system and providing a quick overview of the major changes we've made to it in Houdini 17 well then look at the components of the system and discuss each in a little more detail finally I'll do some examples to demonstrate the new white water in action so without further ado let's begin by establishing the job of the white water system which is to enhance the look of a fluid animation with secondary effects that are difficult to capture with the single simulation such as spray foam and bubbles so here we have a beach where the white water system was used to generate the foam on top of it with the intricate patterning and this makes the scene look quite a bit more natural and realistic here's another example where splashes and spray were added on top of an ocean patch to really sell the energy of the system and the rich interactions that supposedly occur between the surface and surrounding wind let's talk about the major changes we made to white water in Houdini 17 to start off it's a lot easier to control white water amount now with the previous iteration of our system the user had to manually specify particle counts but given the particle counts it was really difficult to predict how much white water would actually be generated when you go out to render the scene with Houdini 17 we've made it a lot more intuitive to think about the amount of white water and the low-level task of managing particle counts is delegated to the solver we've also added inter particle forces for the cohesive effect and this endow is the white water with much more natural fluid like behavior and also prevents them from clustering too closely into tight clumps discrete particle states and hard transitions between them have been eliminated in favour of depths that generated forces so the previous system classified each particle as one of bubble spray or foam and depending on the type of the particle it would be driven by different forces the problems occurred when particles would constantly transition between these various states as they would cross the different thresholds with the new system we don't suffer from this problem because all of the forces are continuously attenuated by depth so there's no hard transitioning to to cause issues we've also added a mechanism to facilitate emergence of cellular form patterns to this end we've added repellents which are special particles that are maintained by the solver and these push and nearby white water particles away and create the nice cellular form patterns on top of the liquid surface introduction of more sophisticated forces and interactions inevitably has an Associated computational cost and our improvements furthermore greatly increase the range of phenomena that can be simulated so without any additional factors this results in more combinations of parameters to test as well as each combination taken longer to produce results so to alleviate this issue we've introduced the notion of whitewater scale that controls simulation resolution so this enables artists to quickly iterate at that lower resolution to try out different combinations and fine-tune the various settings and then once they're happy with the overall look they can crank up the resolution to get some more detail out of it finally we did some work on rasterization and rendering so did this and our default setup also generates a gradient field for density which is an approximation of the normals and the new basic whitewater shader uses this information to render the foam complete with nice specular highlights that make it look a lot less flat than it did previously so the components of the whitewater system are unchanged at a high level you still have sourcing which is responsible for identifying the regions within the fluid where the white water should appear and should you want to manually inject particles in certain areas you would also do so here the source is then used by the solver to actually berth particles and perform the simulation and this is where most of the parameters that affect emergent white water behavior live finally the results are imported back into shops where the user can tweak the settings to get the geometry ready for rendering so let's talk about sourcing the previous system used a node called white water source that took the particles from the fluid simulation and considered criteria such as acceleration curvature and vorticity to identify which ones should be emitting and the output of this node was emission points that were then replicated by the solver this was one of the major causes for the difficulty of control the amount of white water so to address this issue in white water source 2.0 we've moved to outputting an emission volume whose density corresponds to the probability of particles appearing at each voxel and this makes it a lot easier for to control the white water amount since the solver at runtime can determine how many particles should be generated given the emission volume that it's given aside from that we've retained all of the same all the same criteria namely acceleration curvature and vorticity for identifying actual regions where white water should appear on the simulation side the number of relevant nodes has been reduced to two so now we have white water object 2.0 which is a container for the simulation object and it's mainly unchanged it just has a few more visualization options for the repellents as well as the collision parameters now live on the object so you can specify how the object interacts with the collision geometry around it the white water solver has been completely revamped and it's now actually responsible of birthing and killing particles so there's no need for another white water emitter now so the white water emitter note that was previously necessary is no longer required and in fact it's gone so we've made a subtle but important change to the life cycle of particles the particles are now birthed by the solver which also takes care of aging them normally so that particles have an H attribute that store is the number of seconds that have elapsed since that particle was added to the simulation however the lifespan is no longer prescribed the particles do have a life attribute but this is more of a guide as to how long the particle should live as opposed to a hard constraint so the particles are actually killed based on the value of their death chance point attribute and determinants of this dying probability are agen life so that older particles are more likely to die and depth so that if you want your bubbles to die quicker then you can specify their aging rate to be higher so that they are more likely to die every time step and if you have erosion enabled the local density of particles is also considered when calculating death chance and the major advantage of this new way of thinking is that particles no longer retain a memory of where they were born so the previous system if you for example wanted a form only simulation you would set your bubbles to have a very short lifespan but the problem with this is that a lot of times the bubble is actually end up surfacing but since they were born as bubbles they will also die a lot quicker whereas in the new system they don't retain memory of being born somewhere else and the death chance is computed dynamically based only on its current surrounding environment in case you're curious this is a plot of probability of a particle being eliminated from the simulation against this age and the expected lifetime for this particle is 5 seconds so we can see that it starts off very low and then ramps up and eventually tapers off into a constant and the distribution of life spans for such a stochastic process is given here the simulation was done with a million particles so that if you were to compute the mean of this distribution it's still 5 seconds as expected but we see that a lot of the particles greatly outlive their expected lifespan if they're lucky as long as 40 seconds in this particular scenario so let's talk about the various forces that the solver applies to the particles so first we have uniform gravity which applies the same acceleration to all particles there is buoyancy that pushes particles in the opposite direction of gravity and this is responsible for bubbles surfacing and there's also advection which carries the particles with the motion of the underlying fluid so that you get an illusion of coupling and the first three forces here which I'm going to call basic forces were present in our previous solver as well the bottom three here however are completely new so we have density control which prevents particles from clustering too closely and also gives your spray and splash nice surface tension effect it really sells the idea that this is a fluid there's also depth control which pushes the particles toward the fluid surface and you can use this to prevent particles from either submerging or being launched off the surface so that you have foam that really sticks to the surface of the liquid and there is also a repulsion that the white water particles experience from nearby repellents and this is actually de Matic mechanism that's responsible for giving rise to the cellular phone patterns on the surface here we have a comparison of the old solver versus the new one and no effort was made here to make these match up but we can see that with only basic forces enabled on a new solver and the results are fairly close to what you would get previously so here we took the simulation but in a both density controls so that the particles are prevented from clumping up into tight streaks as in the top video here you can see that the particles are applying repulsive forces between each other so that you get a much more uniform distribution of them throughout the domain if you watch the top video closely here which only has a density control enabled you can see that the foam constantly submerges given rise to these strange disturbing looking artifacts in the bottom video here we enabled the adhesion so that the particles stick to the surface much more faithfully and the amount of submerging of particles under the surface is practically eliminated here we've also took the previous animation and enabled erosion on it so that the particles that are in areas of lower density have a higher chance of dying and we can see in the bottom clip here that the this results in much nicer looking or more natural-looking dissipation of the foam as it looks like it's evaporating inwards from the outside so that covered let's talk about repellents which are a special points that push nearby a white water away giving rise to the cellular foam pattern and the solver is responsible for creating these repellents and maintaining their distributions so it performs necessary reseeding as it sees fit and the particles are stored as points in a separate geometry called repellents of the white water object and the artist is of course free to manipulate these in any way they'd like and unless a certain parameter called density threshold is enabled they're actually completely unaffected by the Whitewater so that this is useful because you can temporarily turn off all particle emissions so that you just have your repellents in the geometry and you can watch how they evolve as the simulation proceeds and that gives you a nice idea of the kind of cellular pattern you can get so the behavior of the repellents is largely dependent on their various point attributes which I have listed on this slide and I'll quickly go through these here so there is action and magnitude which govern how strongly the repellent particle is pushing nearby whitewater magnitude is meant to be more of a permanent property of the repellent whereas action is a temporary modifier that's applied as a multiplier on top of the magnitude so this is useful for example if you want to temporarily make certain repellents a weaker without without forgetting their actual magnitude so you could just set their action to be less than 1 on top of that there's also noise and phase which control the shape of the repellent so the repellents have shaped that ranges between perfectly spherical to quite oblong so the value of noise actually controls how far away from spherical the repellent is and for each noise value there's also a continuous range of looks you can get depending on its face parameter now with the fixed phase and noise the shape of the repellent is going to remain static throughout the simulation but you can also set its pulse which will continuously vary the shape throughout the simulation and depending on the magnitude of the pulse you can get repellents that change their shape much more rapidly and finally there's radius which as the name suggests controls the overall size of the repellent aside from these there's also a pseudo parameter that doesn't actually affect dynamics but is used by the solver to determine where reseeding needs to happen and this particle is called crampon s so you can visualize this particle or you know monitored but it doesn't really affect the behavior of whitewater with respect to repellents and if you have mortal repellents enabled which is an option and that you may turn on the particles will also have two additional attributes called age and life and these are fairly self-explanatory once of particles age exceeds its life it will be deleted this video here shows the effect of noise and pulse on the shape of a repellent we see as the noise increases that particles become more and more oblong whereas the lower noise values are quite close to being circular and the pulse determines how fast the shape changes so we see that if pulse is zero then the shape is actually static and for as you increase pulse in negative direction then it will rotate a certain way and change shape in a certain direction and the positive value will do the same but just do it in the opposite direction so now I have a few videos here to demonstrate the effect repellents can have on a simulation so here I've done the bare minimum you can do with enabling repellents which is to enable them and have them all be the same so all the repellents here have the same radius and the same magnitude and we can see that they are creating the empty Wells everywhere but all the wells end up being the same size so here we've gone a step further and added some variation in the size and magnitude of these repellents however all of the the distribution of all these attributes is uniform so you get equally likely repellents of any size in the specified range now we've provided a custom radius distribution to the solver and in particular we've set it to be largely smaller ones and then a few larger ones here in there and the solver correctly seeds them based on her specification as we can see most of them are pretty small and then we have the larger ones scattered around so here we've enabled threshold at seating which only which signals to the Whitewater solver to only put repellents in areas that already contain white water as you can see this greatly reduces the erosion of the edge of the foam that is quite prevalent in the top clip here and finally we've added noise so that shapes of the repellents are allowed to vary here and here we're starting to get more interesting looking foam structure as opposed to the circles of the previous simulations and here's a comparison of results of the of whitewater solver 1.0 and results of the new solver now we can see that we have the freedom to get quite a different look from the new solver whereas with the previous one were more or less restricted to the same streaky foam that you see here so let's move on and talk about important rendering so our default setup for the import Network now has a wrangle that sets the density of particles based on their age as well as depth so that you can have particles that fade in instead of suddenly appearing as the white water solver gives birth to them and also the depth so that particles that are further away from the surface can be made to be less visible for example so that you have spray that looks more diffused than the thick foam on the surface and these parameters are all controllable I'll be using ramps the inputs of this are then taken by the volume rasterize attributes node and turned into a fog volume of density and additionally we're now computing the gradient of this volume which is going to approximate a normal field for us that can be used by the basic white water shader to do generate the specular highlights and make the foam look more volumetric and what so here's an example of how that looks and if you watch the front of the ship you can see the specular shimmering and this gives the white water a much wetter look then you would get if you didn't have the specular highlights enabled and if I can go back to the simulation side of things here this is the same simulation that was those performed at four different resolutions or white water scales and we can see that they all look basically the same it's just that the lower resolution simulations have fewer particles on the top left whereas the higher resolution ones have substantially more and the one caveat of whitewater scale and not affecting the overall behavior is that if you have thresholded repellent seating enabled this only puts repellents in areas that already contain white water which and of course your density your density approximations are going to be quite different at different resolutions so here we see two different simulations with threshold at seating enabled and we can see that the repellents and the foam structure that gets generated is different but the overall look is still quite similar so let's shift gears now and do some examples so with the first one here I will just set up a simple simulation of a whirlpool and then add some bubbles on top of that with some custom seating and this is just meant to familiarize us with the structure of a whitewater simulation and various components of it so let's begin I'm going to put down a flip tank which is found under the particle fluids shelf here and this just creates a flat tank for us and if we go ahead and simulate this we see that nothing much changes as expected so let's go back to the initial Network where you specify the initial conditions as well as the size of the domain so I'm going to go ahead and increase this to be 10 by 10 and let's raise the water level just a little bit there we go now to make a whirlpool I'm going to create custom force field or a velocity field that I would like the fluid simulation to follow so let's put down a box and make it the same size as our simulation domain and this is going to be mainly used to activate our velocity V DB so let's call it velocity and I'm going to make this a vector volume and we'll use VDB activate ensure that the box holes inside the box are activated and I'm gonna turn off the value here so that we don't write anything so we can use the volume velocity so to create a vortex for us so here we go let's add a vortex and set the radius to be five and I want it to fall off at the outer edge but inside I want it to be to have full speed so there we go this should create a vortex for us but we can't really see it right now so let's use a velocity or a volume trail sob the trail points within this volume to see how this actually looks so we see that this requires two points to trail and the velocity and the vector field which will plug in as for the actual points we'll just we'll just use points from volume and hook it into the box oh that's a little too dense so let's do 0.4 and we see now that we did in fact create a vortex and let's do it backed by time just so we're not fooling anybody with the length of these vectors all right that looks nice however this is not going to end up pulling anything down so what we actually want is an indent in the middle so let's see if we can incorporate that in so this end I'm gonna put down a volume Bob and hook up our velocity volume to it and let's go in and try to incorporate it so first thing I'll do is take a vector to float node and I'm just gonna use this to isolate the X and zette components of the current voxel location this is because I don't really care about the y-coordinate I want all of the downward force to be equal on every vertical slice so let's convert that to vector two and like I said I only care about the X and that components and we'll take the length of this vector so let's add a parameter for the radius and I'll call it radius and let's fit let's remap the value of the length from zero to radius to be zero to one so for this we're gonna use v range hook up our length and for source max I'm gonna use this radius parameter now this takes our length value and then maps it to be between zero and one and from there we're going to evaluate this ramp parameter which we will specify after so we're going to call this the speed ramp so this will take as input zero and one which is whatever refitted value of the law of the vector length is and then give us a value of between zero and one depending on what the ramp we specify us and we just need a float RAM so there we go so now we need a parameter to actually specify maximum speed so let's do that and multiply the result of the ramp with maximum speed and this will be the actual amount of negative vertical velocity that we want to add so let's convert this to a vector so we just want the Y component the other ones can stay at zero and finally we're gonna have to bind our velocity value so let's find velocity which is the name of our vector field this one's gonna be used for input and this one for output so finally we just need to subtract from our input velocity this new vector get our output and there we go so let's set these parameters for radius let's use the same radius we used for the vortex which is 5 maximum speed let's also use five and likewise for the speed ramp we're gonna do the same thing we had previously so we had one on the left and one in the middle and zero on the right okay so now if we plug this into volume trail we should hopefully see it turns out that we need to specify that this is actually a vector so let's try that you can see that we're binding it as a vector and let's subtract and there we go that looks like the expected result nice so I'm just gonna add a null now to get a convenient output location then we can see that we have the velocity V DB here we should call this out and now let's go into our dope net and import this field so to this end we're gonna use the new volume source node and for the soft path let's just find to note we just called so and we're gonna do a single operation on a vector volume our source volume is called velocity and the target field that we want to effect is called vel so this is the velocity field of the fluid and since we only want to touch the velocities that are inside the fluid let's mask this by the surface top field which happens to be assigned distance field so I'm going to turn on this absolute sign distant field and there we go so the operation is currently set to add which is can actually run into problems if we continuously keep adding this as the simulation might eventually explode so instead of doing that let's set this to pole which will simply pull the current values in this target field towards the ones that are inside of the source volume and this avoids overshoot overshooting so that it's actually impossible to get unstable simulations in this matter so we're going to enable the direction strength so that we are independently controlling the direction of the velocity and let's plug this into the third input called volume velocity so we run this now we should hopefully see the vortex and there you go as expected and there we have our animation of the whirlpool cool so let's add whitewater to this so we don't need to see this so it's great the Whitewater set up for us we'll use the shelf tool that's found under the same tab here so click on the Whitewater shelf tools select our fluid press enter there we go so this lands us inside of the top nut that performs the actual simulation let's exit out of that and check out the sourcing so now would be a good time to describe how this node actually works first it looks at the voxels that are within the specified range up here if it's enabled and then it Maps tower speed from this range to zero one range and that value becomes the base emission value for that voxel from there it also computes curvature of the surface field the acceleration and vorticity of the velocity field and you will notice that each one of these has a range that gets mapped to 0 1 and then the maximum of these 3 values get gets multiplied by the actual base emission amount to get the final emission value for the voxel and that's the basic method of operation but you will also notice that there's all these remap options so you can get finer control over how the actual mapping between this range and the emission actually happens so we actually noticed that with the default values we're not getting any emission here for most of these frames and that's fine so let's just roll our own for this specific setup so to begin I'm just going to add a sphere and that's a little too large so let's reduce its size and I'm going to you add a box as well and I'm going to bully and subtract these just so I get a the lower half of the sphere so I get just two lower hemisphere so let's use boolean subtract and I'm going to subtract the box which is offset by half a unit vertically from the sphere and so I don't want the top cap there so I'll just treat the treat the sphere as a surface and there we go so now let's scatter some points on top of it but before we do that actually let's move this to a nicer location within the domain we don't want it to be in the center and we probably want it to be lower down and we can kind of think of generating a volcano that's constantly emitting bubbles under the liquid so let's use a transform sob to translate this and that looks like a better location let's go with that so now we're gonna scatter some points on top and just so we know where where we're headed the wet water source actually also has an option to emit from extra sources so that this allows you to inject your own particles into the simulation and the way this happens is that you give it particles and each particle is supposed to have an emission attribute which describes how much the particle should be emitting and that emission attribute gets rasterized into a volume and added into the total emission based on what ever emerge method you specify here so for that reason we're scattering some points and since we need an emission attribute let's use attribute noise to give us some varying attribute here and let's call the attribute omit and we need one D noise let's make sure it's animated so you'll notice there is a little button here and if you click this this will actually create and the visualizer for you so you can see what this attributes what's happening to this attribute in this node and we see that red values are the smaller range and white is that middle of the range and the blue is going to be the lower values and let's make sure it's using the zero one range and you see as we did that it became a lot more dull and the reason for this is that actually simplex noise is really a lot of that a lot of the noise is actually located in the center of the range so not to worry we're gonna use the remap noise here to actually get a uniform distribution out of it in fact I'm going to increase the left side here so that we get less emission then then we would otherwise and since this is a fairly Scott a small scale object here will also reduce the element size and that's how that looks cool so the other attribute that is needed for a white water source to rasterize the incoming points is P scale which determines how far out the particle has influenced so let's create that I'm gonna use an attribute create a scale and the value let's just use something reasonable okay let's plug this into the second input and if we visualize this and action extra sources we can see that it created a little fog here where we had the points seems to be working fine but looks kind of blurry so let's decrease voxel size of the emission volume and there we go so right now it's doing a lot of the computations on the various fields of the fluid which is why it's running a little slower for this particular simulation we only care about the mission that we're manually injecting so one thing we can do is actually around manually rasterize these attributes into a volume and we feed that to the Whitewater solver so let's put down up volume rasterize attributes node plug that into our points and the attribute we want to rasterize called emit u 0.05 for the voxel size just like we did with the white water source and normalized by clamped coverage so that we get a smooth fall-off and there we go we see that we're getting identical results now but you'll notice that the scrubbing is a lot faster since this is actually oblivious of all of that fluid the fluid fields that need to be analyzed here and the output is still an amid VDB just like the white water source so let's feed that into this out null and let's exit out of here to see where that's actually being referenced so let's enter the Whitewater sim and we'll see that that shelf tool actually went ahead and set it up for us so that it has your reference to the volumes which should contain the surface and the velocity field of the fluid and it also is pointing towards an emission source somewhere so if all of that will actually see that this is exactly the out and all that we recently redirected so let's go back here and see what's happening so let's just quickly add a bit of noise just so that the particles store we'll start with some random velocities and just momentarily turn off all of these fancier options under under the foam tab okay let's run this and see what happens I'm gonna go under the Whitewater object and enable color particles by depth so that the bubbles now get colored red and then as the depth increases and increasingly in the color the particle gets mapped to white you so we're seeing here that all of these particles are starting off at our source but they're gravitating towards the rights for some reason here so what's happening there well when the particles are born they're inherit their velocity from the fluid at the same location and the multiplier applied to that inheritance is this velocity multiplier under the emission tablet so let's go ahead and set that to zero so that the particles start stationary if you play this now should hopefully see that it's reduced a little but still it's noticeably going towards the right there so what's happening well despite the fact that they start out stationary they're still being acted on by these other forces that are forcing that are causing them to go to the right there so this gives us a chance to inspect this forces tab here right at the top we have the gravity which is a uniform acceleration that is applied to all particles within the simulation but then you will notice after that that we have three sets of parameters namely for buoyancy advection strength and advection multiplier and each one of these consists of a base value and then a ramp after at that attenuates the effect of the force based on the depth of the particle and each each of these ramps the center corresponds to the foam location are specified up here and the horizontal range spans twice the depth range that you have that you have set so for example the leftmost point here is actually 0.8 units below the this foam location which is right at the surface and the right endpoint pertains to all particles that are at least 0.8 units above the surface so we can see here for buoyancy at least that all of the particles that are under the surface get a lot of effect of the buoyancy whereas once you're out it quickly falls off to zero force we're actually interested in here is advection so advection refers to the mechanism that carries these particles with the flow of the underlying fluid so what we can do is for example set the left endpoint to zero so that all particles under the surface or at least your point eight units under the surface get no effect since the value of zero gets multiplied by the base of five so if we were to run the simulation we would see that all of these bubbles are unaffected by advection until they reach the surface so that seems to have fixed of the particles gravitating towards a certain direction however they also that the particles now look like they're not at all concerned with what the fluid is doing which is a bit strange looking so let's see if we can fix that so let's reset this value back to 0.4 and instead to worry about the multiplier so the advection strength controls how closely the particles will follow the fluid velocity but instead of following the fluid velocity you can set it to follow a multiple of the fluid velocity so for example if I set this to 0.5 now the particles will be affected by half the fluid velocity and all particles are going to be affected uniformly because of this constant 1 we go we can see that the bubbles are nicely moved with the fluid but not too violently but once it gets to this surface it looks a little strange because the foam looks like it's lagging behind the liquid underneath so if we play this at full speed we see that you see that the liquid is moving a lot faster than foam on top of it so we can fix this instead of changing the global multiplier which will reset to 1 let's just make it so that the particles that are under the surface are affected less by advection well are affected by slower advection than the ones at the surface so now we get similar effect out of the bubbles but once the particle surface they'll start to follow the liquid more faithfully and there you go basic simulation let's see if we can just do around with these settings see what happens if we enable density control which is which prevents particles from clustering too closely let us run now we see that the particles are applying repulsive forces between each other so that if we zoom in at the surface we can see that we're getting that nicer uniform distribution out of them instead of a very very tight clump so let's quickly check this out at full speed oh not bad can see that these pink particles are kind under the surface and to prevent that we can actually enable depth control which will stick the particles to the surface once they get there so let's see if this looks significantly different you particles are clearly sticking a lot service now compared to the previous iteration so let's run this to see how it looks and there we go simple example of a whitewater simulation demonstrating how you can use these depths that generated forces to get different effects for foam at different or whitewater at different depths so let's shift gears and try our hand at a foam simulation on a beach so let's go to the ocean stab and let's use this beach shelf tool which will create a simple fluid simulation for us of a of waves constantly crashing on to a collision geometry here which is supposed to represent the beach so let's exit out and see the setup that gets created here we have any node for beach geo which is responsible just for importing this collision geometry for us and we have four nodes for the flute simulation so we have beach tank initial which specifies the initial conditions but also continuously seats waves so that you have constant incoming liquid washing up ashore the.net actually performs a simulation and then we have these two nodes that are used for caching or rendering the fluid there we go and then the final three nodes pertain to the whitewater system so we have the source the sim and the final import we'll take a look at those shortly so let's begin by looking at the beach geo and let's give ourselves a wider working day so I'm going to set the set scale of the transform to a2 and while we're here let's change the color just so it's a little easier on the eyes there we go we see that the actual fluid simulation didn't change its size but we'll take care of that shortly so if we go into a beach tank initial we can take this ocean source node and specify where the liquid gets seated so let's increase the jet size to 40 and we see that the initial points have increased but this is also linked to the simulation domain of the fluid so that we'll get appropriate properly updated now let's go into the simulation actually and we see that there's a poppet effect by volumes here that is actually used to make sure that there's always waves coming in but the velocity scale is set to 1.5 let's set that to 1 just do get a calmer Beach and this looks like a very coarse simulation at this point and you see that the particles are very coarsely separated so let's decrease the particle separation to something a little finer and there we go that looks better so instead of simulating this I went ahead and cached it for us so that we don't have to wait for that and if we take a look here see what's happening we have the liquid constantly being pushed up to shore and then gravity pulling it back so a fairly standard beach simulation so let's look at the whitewater simulation that's being generated to here as well so let's enter the wet water source and this is actually the exact same setup we saw in our previous example I'm just going to go to the white water source and disable some of these let's just omit from acceleration for this one and since this is a more energetic simulation than your usual one we're gonna increase the speed range to four to eight so see how that looks it looks reasonable and I happen to have also cached this out so there we go the solver to work with so in here the first thing I'll do is click the Whitewater object and we'll see that there's a physical tab up here where there's parameters for how the particle interacts with pollution geometry so in particular I'm gonna set the bond bounce forward to zero and in this manner will get more inelastic collisions so that the particles actually don't end up bouncing around like crazy off this half of the beach and in the Whitewater solver itself let's adjust the limits a bit so we only care about the front of the beach so let's just see if we can isolate that and that looks like a decent domain size and let's disable closed boundaries so that the Whitewater can properly leave and you'll notice here that this collision swap has been provided for us here and this is important for simulations like this where you can possibly expect the foam to remain on top of the collision geometry as the liquid pulls back in situations like that if you don't have the collision geometry present then the solver will think that the particles that were left ashore are spra since they're far away from the actual liquid body but if you give it the collision geometry then it will be able to I correctly determine that these actually should be treated as foam so let's switch over to this foam tab and adjust some of the other settings here so let's make the repellents have a longer range of sizes and also strengths and in in addition I'm going to change their radius distribution so by default if I have this disabled then the actual propellants will be uniformly distributed in size in this range but I can actually control the distribution of them more finely by specifying this the ramp here so let's make most of them quite small and then we'll get a few large ones here and there all right that looks reasonable and the last thing I'll do here is set the control range for deaf control to be fairly large so that particles find it difficult to separate from the liquid and we're gonna set the off velocity angle to zero so this parameter is useful for disabling adhesion for particles whose velocity vector is co directional with them with the surface normal so that you can have particles separating out of the leading edge of way for example in this particular scenario we only care about getting the foam on the edge here so we don't need to let that happen and the last thing I'll do is that this is set a fairly large white water scale for us so that would be a very low resolution simulation let's reduce that a bit and likewise I'm going to reduce the voxel size so the voxel size is used for approximating particle density and that particle density in turn is used for two different purposes one is for emission limiting and let's just reset emission amount to one so limiting emission and if this is enabled and then the white water solver will look at that well how much white water is already in a certain location and if there's enough there already and then despite what the emission source is telling you then it will not see it anymore and this is very useful for preventing over emission which can be problematic if you have density control enabled since all the particles are supposed to have mass and you can't have too many ena in the same spot so that's one use of that density volume the other use is for this erosion feature so this prevents particles in more dense regions from being killed or reduces their death chance whereas the particles that are in more loosely distributed areas get their death chance boosted as specified by these parameters and the density estimates that users come from the volume of this voxel size so there we go and at this point we can run the simulation right off the bat we see these points appearing but they're not actually whitewater points those are repellent particles and you can be certain of this if you set color particles by depth for example this will only color actual white water and if you enable a repellent visualization you'll see that these repellent particles will be will become little spheres here we go our first attempt at the wet water simulation foam I went ahead and flipped book this for us and it ends up looking like this so not bad for a first attempt but what I really want here is nice smooth leading edge emission and I don't really care about what water appearing in the from the incoming Bay waves alright so with that in mind let's change our sourcing so that we only get emission at the leading edge let's go back into the white water source Network here and on the white water source we're gonna disable acceleration now and enable curvature which is useful for determining areas of high curvature such as waves or the leading edge so I found that the range of 1 to 3 of curvature works pretty well and I am just going to reduce the speed range to be 1 to 2 since the leading edge is actually gonna be fairly slow moving and I want it to be emitting despite that and the other thing I'll do here is reduce our limit by depth range do something like that so let's take a look at what that gives well now what we want turns out let's just go ahead and also reduce the emission size since we don't need it to be this large what's happening here so we're getting a lot of spurious emission here from curvature and the reason for this is that with high-resolution simulations you get more detailed but a lot of that detail manifests itself as high frequency noise when you're computing curvatures so the finer details all become areas of higher curvature that are going to be identified as possibly emitting by the Whitewater source node so to address this issue the source is actually able to filter the incoming surface so just so we are able to see what the surface looks like let's isolated and let's use B to B convert to change this into polygons and there we go so now instead of instead of using the actual volume itself let's perform some filtering operations on it so there's three operations here there's dilate smooth and a road what dilate does is expand expand the surface filled by the specified number of voxels and erode conversely shrinks it back and these operations are used for useful for filling in small little holes that appear such as easier and there's also smoothing which gets rid of a lot of those high-frequency details that are not actually desirable when we you're trying to do curvature emission so let's quickly enable these and I'm gonna take the display flag off quickly here just so I can set the parameters first so let's take a look at that so we see now that the fog is actually appearing at the leading edge and we're getting much nicer stuff so it turns out that these filtering operations are actually quite effective at helping you isolate the leading edge you will notice here that there's a pretty convenient option to output volumes which you can use to make sure that the output also gets the surface and the velocity field that was used and the this is especially useful if you're performing filtering operations because now you can change the input of this and see the actual surface field that the source was seeing and we'll see that it's lost a lot of its nice detail that we got from the high-resolution simulation but that's nice because it gave us this nice leading edge so I also have this cashed out for us let's use that instead of recomputing and all right let's one thing I'll do here first actually is reduce the submission amount just a bit and set the velocity multiplier to zero if you recall here on the Whitewater source I set the depth to contain positive values which means that we will get a mission outside of the volume out of the liquid volume that is so to prevent those particles from just separating out will set their velocity multiplier to zero so that they're just they'll just wait for the liquid that's behind them to catch up and there we go actually at this point we might as well look into the import Network here so this starts out with a set density Wrangell that has the display flag actually and what this does is create a density attribute for us based on the particles age and also based on the particles depth and the density value it gets out of each one of those criteria can be controlled by these parameters up here so for example in this particular case we're only interested in foam so we don't need the depth range to be this large so let's set this and the bubbles let's make them invisible if they're at least that much into the fluid and you'll notice another convenient think this does is set the point alpha which is the transparency when you're visualizing it in the viewport so that the picture you get here is actually a fairly faithful representation of the volume that will get rasterized for you so let's run the simulation and see how that looks that's starting to look nice here so here we have the flip book of that animation with the fluid particles underneath and we see that indeed we're only emitting at the incoming edge all right let's switch gears and try our hand at a splash simulation so here we have a simple flow simulation just some water energetically crashing against rocks and we get some splashing but we can probably do better by using the whitewater solver with it so let's see if we can get nice thick viscous looking splashing from this fluid simulation so here it is let's let's apply the whitewater tool on it so we're gonna select the fluid object and there we go so it created the network's for us one thing I'll do manually here is enter the splash sim Network and copy all of this collision geometry from it and throw that into our new sim there we go so let's quickly look at the source and see what it's given us yeah it looks it doesn't look bad let's just let's just use vorticity though looks like a fine source to work with I'll do so let's go into our actual simulation Network and on the Whitewater solver I'm going to adjust a few parameters to to make this a better simulation so let's start off by setting the Whitewater scale to something higher since that would give us a lot of particles and we don't care about that at this point the other thing I will do here is set the bubbles aging rate to 100 so that all the particles that end up inside of the liquid get their death chance boosted by a lot so that we we're not gonna end up with a lot of bubbles which is fine because we're we just want to focus on the spray here so that's good for now and another thing I'd like to do actually is just to increase the limit sizes so that we get a little more vertical room to work with so let's go to the foam tab and adjust the settings here so first of all since this is a spray simulation we're not gonna bother with repellents and actually the depth control is gonna be detrimental here so let's go ahead and turn that off and that density control is actually the most important determinant of how your sprays gonna look so let's focus here first of all we don't care about particles inside of the fluid so let's just start at zero and go to some value here and for constraint stiffness I'm going to increase that slightly and if we enable variable stiffness we'll see that it will reveal this hidden parameter for us which allows us to control the stiffness of the density constraints for particles at different depths and another way you can use this is to actually make the steps range open at one or both end points in particular you will see that by default all the both of the end points are actually at zero so that particles that are under zero depth are actually unaffected and likewise for particles that are higher than 0.5 depth but if I do this for example then I get all the particles that are beyond 0.5 depth to be affected so that all spray particles are going to be subjected to density control and get nice clumping effects to them and now let's increase the neighborhood size so that we get some longer range forces propagating among our strands of fluid and or tencel radius so let's just increase that a bit so these controls here are fairly important for the look of the surface tension you get and increasing this tensile radius actually gives it a nicer distribution so normally you would play around with this and find the settings that work for you and there we go so let's see how that looks we see that we're getting nice strands of liquid here and our splash actually looks even more fluid than the initial splashing we got from the flip simulation that we're using to generate this on top of so let's see how this looks flip booked with all of the geometry present and there we go you'll notice here that some of these strands just break apart and surface tension drives them to a more spherical shape as you would expect from a fluid so let's say I'm happy with the look of that but I also want some more diffuse mist to be to stick around for us so let's see if we can accomplish that so let's go into the simulation Network and what I'm gonna do is create a pop group node and this is gonna be used to separate our whitewater into two different groups namely spray and mist so let's set the source group to just born and just born is a special group that white water particles are put in on the frame that they're born so this is useful if you want to do something like this for example so let's call the spray and preserve group so that we're not overriding it every time and we're gonna set it to be random and let's just say 20 percent of the particles are going to be put into spray so we're gonna also use a different group here called mist and this is gonna be used to represent our are more diffuse particles so let's do that and for this one we're just gonna they import everything that was just Morin and was not classified as spray and there we go so let's put these in and hook them up to the extra sources input of the solver and another thing we can do is presumably these mist particles are a lot lighter so it's should be easier to launch them out so let's add a wrangle to boost our initial velocity so we'll do a times equals 3 so this triples their initial velocity well right now it triples up velocities of all particles at every time step what we need to do is specify the group and we'll say just born that or not spray so this is just born mist particles and the last thing I want to do here now is actually make sure that the spray particles are properly affected by density control so that we still get that those nice liquid strands but for the mist particles that are supposed to be diffused they'll just fly around ballistically so this is fairly easy to accomplish so add let's add another angle and make it act on spray and there's a special point attribute called PBF stiffness which you can use to set the stiffness of these density constraints on a per point basis so this actually works as a multiplier on top of whatever stiffness to solver specifies so here i'm saying that apply full stiffness to spray particles which is great however i don't want miss particles to get any and to get affected by density control at all so if i set their PB f stiffness to zero it will do exactly that for us so let's do that and let's hook this up to the particle forces and looks right so the last thing i'll do is go into the Whitewater solver and change the emission amount since we only have 20% of them being affected by density control so let's just set the amount to some higher like 10 and we can run the simulation here and as the simulation proceeds we will see that it looks a bit strange because all of the missed particles are kind of blending in with the spray and kind of making it more difficult to see all of those strands that we saw previously so actually if we go into the import Network we can already see that it's a little easier with all the alpha compositing but we can go a step further and actually set the mist particles to be even less visible so that the spray and the more fluid like spray is highlighted a bit more so let's add a attribute wrangle and before we change anything if I middle click on this we'll see that it actually has groups called mist and spray so it will retain all of the pop groups that you create in the.net so the springle I want to only effect miss particles and I'm going to say these going to be my miss density and for all miss particles I'm going to change their density or multiply it by this and D number so that it becomes smaller than it is currently and we'll do the same with alpha so that the viewport is represents what we would see if we were to go up and rest arises so there we go let's set this to something a little more visible 0.3 that sounds reasonable and there we go so we could go we still see the more liquid stuff here and the more diffuse spray is still visible but it's a lot less visible than it was previously so how does this look Flip booked let's take a look so there we go all right so let's see if we can do a little even more and here I just like to highlight the fact that whitewater simulation is just a particle system and you have the full arsenal of particle operators to add your own custom forces or do whatever you'd like on top of anything that the solver does internally so to demonstrate this let's add pop drag and this is gonna be used to slow down the missed particles so that looks good let's just make sure it's only applied to missed and let's use a vex pression and I'll make the make this drag more apparent as the particle ages so let's multiply this by setting up the age from 0 to some maximum n it will fully fully feel this drag force so that's drag but in addition to drag let's also add a some kind of force that simulates wind for us so let's do Bob forests and let's just make it something strong and I also have a lot of noise to it and once again I want this only to affect mist and like we did with that drag let's make sure this is only active once particles age so that once there's as soon as they're born they're more or less acting ballistically and just following the fluid velocity that was given to them so here let's multiply force by but here let's use a different max age here let's do one second so that they become they are subjected to wind before they are actually and they feel the influence of the drag force so let's add a merge node click connect these in and I'm here and the last thing I want to do just to demonstrate how you could make use of that death chance and exploit that so let's say that I want particles that are mist particles that are higher up to kind of just dissipate and become invisible so I can do that by boosting their death chance actually so let's add a final geometry angle and once again only act on mist and will do will multiply their death chance by fitting up their y-coordinate between some minimum and maximum and if it's a minimum we'll just leave the death chance unchanged so multiplied by one and that maximum will just multiply it by some value here that will specify below for the range let's do zero to twenty and for the for the multiplier let's say ten and I'm going to hook this into the posts off so that we have the most up-to-date information about the particles location that we're using here to determine the death chance modifier and that's basically it so if we run the simulation we should get nice splashing from the Spray particles as well as diffuse mist that that is affected by wind and air drag and also the particles that are higher up or further away from the ground plane here we'll get their death chance boosted so that week how did you see them dissipate so just go ahead and see this at full speed and there we go final splash simulation with mist as well what this concludes the master class on whitewater I would like to thank you all for your attention and take care
Info
Channel: ROTY TANG
Views: 1,409
Rating: 4.8461537 out of 5
Keywords:
Id: XEMB4nO-HHg
Channel Id: undefined
Length: 71min 51sec (4311 seconds)
Published: Wed Feb 27 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.