INSYDIUM Training - Dynamic Water - xpOcean & xpFluidFX

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this tutorial we'll create this dynamic water body using xp ocean and xp fluid effects so let's get started so let's bring in an x particles system object which is our hierarchy and we'll just make that x particles logo invisible we'll deselect icon in viewport all right so what we're going to do first is we're not even going to think about making any ocean animations at this stage the first task is to create a dynamic water body which will interact with our collider object and create some really nice detailed foam so that's the first task and to do that we're going to use our dynamic solver xp fluid effects so let's get that scene set up what we want to do is is have a this water body contained within a cube so we'll bring in just a primitive cube let's give that a um tag we'll go to the render tags let's put a display tag on there and we'll change it from the shading to lines so there's our cube everything's going to happen inside of here so we want the particles to bounce inside of this cube so we need to give it a collider tag so we'll go to tags x particles tags collider let's take all that bounce away and we want the normals inside so the particles are bouncing inside of this cube let's have a look at the dimensions of that cube we'll go to the coordinates so 200 by 200 by 200 we'll leave it at that for now so now we're going to make our um particle emitter so let's just take this standard emitter which by default is this um square and we will change that let's go to the object tab and we'll go to the emitter shape and change it from rectangle to box and the box we want the x and the z to be the same as our um collider box so let's just put that at 200 and 200 and then we want the y to well to be the height of our water body really it'll compress slightly but let's say um let's have a look maybe 30 30 could do for now all right and then what we want to do i'm just going to go uh go to the orthographic views let's hit five and it brings up all of those and look we'll pick this side on view and let's just bring that emitter down and so it's sitting right at the bottom with our collider excellent then hit f1 back to our perspective view right let's go into that emitter let's get organized as well we'll go to basic and let's rename it we'll call it emitter uh water body excellent and we'll go to the emission tab now we don't want to omit all frames you just want to shoot these out on the first frame so let's deselect emittal frames start emit zero endemic frame one we don't want rate we want to we want to birth these in a really tightly packed grid so the best way of doing that is to use hexagonal mode and then hexagonal mode uses the particle radius to dictate how many particles it can fit within this non-intersecting grid let's just go forward a frame so now you can see we've got this non-intersecting grid let's just take all that speed away respawn them so there they are let's reduce that particle radius down to two which means we'll have more particles because it can fit more within that space and we'll just leave it at that for now let's color those differently so it looks a little bit like water just while we're building this we'll go to the display tab let's change the color mode well we'll change the display mode from dots to squares and we'll change the color mode from single color to gradient parameter and just move that up we'll change the parameter from age to speed and then we'll hit auto so that just means that at any one time the slowest particles will be blue and the fastest particles will be white so now if we hit play nothing's going to happen we've just got a load of static particles there are no forces there's no dynamic solvers in this scene just got our particles so let's sort that out we will first of all go to our dynamics tab and we're going to use the we've got three different fluid solvers next particles there is the xp domain which is a flip solver we have got xp fluid pbd which is a particle-based dynamics fluid solver and then we have xp fluid effects which is an sph fluid solver they all solve the fluid particle animation using a slightly different method so each have their own characteristics we're going to use xp fluid effects for this one so we'll just bring it into the scene and we're not going to touch any of the settings actually we're going to keep it on default apart from in the accuracy preset we're going to change it from fast to medium and what this will do is it will use more substeps so it'll more accurately work out the velocity of the particles and it will have more iterations which will more accurately work out the fluid density of the particles all of that's happening under the hood we stick it on medium it's just going to be more accurate okay so we've got fluid effects hit play still we haven't got much movement going on here and that's because there are no forces in the scene so let's bring in a force we want to gravity so we'll go to modifiers motion modifiers gravity now if we hit play you'll see they fall and they start kind of settling and there we've got our water body so now that this is an active fluid simulation [Music] let's bring in a collider object so we'll get a i'm just going to use a primitive let's bring in a platonic now that's huge let's just bring this way down to say let's have a look at that platonic radius maybe 10 10 centimeter radius maybe 15. okay good and we'll just bring that down this green circle here is the arrow of the gravity modifier showing us um the direction of the gravitational force so let's just make that invisible we don't need to see that so now we have this platonic in the scene if we hit play nothing will happen because it doesn't have any collider information if we give our platonic a collider tag let's go to tags next particles tags collider let's remove that bounce add a little bit of friction so now those fluid particles will interact with this and if we move our platonic you can see look it's sloshing about that fluid all right so we already have a interactive water body going on here so that's pretty cool okay so let's go let's just go to our emitter can you see at the moment we've got um a bit of particle movement going on here so it looks like the particles are flashing with color the reason that's happening is if if we go to the emitter water body to the display because we've got it set to auto um it maps this gradient to the whole body of water every frame and so at some um the slowest moving particle might only be moving one centimeter a second and that will be blue but on the next frame the slowest moving particle might be moving 20 centimeters of frame and that is then colored blue and so it can look a bit flashy if you use the auto so if we just don't use the auto and just put say a minimum of zero and a maximum of 200 it's now going to be a much more consistent gradient okay because always the particle moving at zero will have this blue so let's then get our platonic and if we move it around look at that got a really nice interactive water body so that's pretty cool let's increase our scene frames to say 300 frames so instead of moving this platonic around let's just set a bit of automated animation and we'll do that using a vibrate tag so we'll go to tags simulation tags and actually noticed animation tags and vibrate let's activate that tag and let's say we want it to move 100 centimeters on the x and the z and we want it to move at say 1.2 so there we go and now we've got some animation on our platonic making our water body move about the place that's looking quite nice now it looks quite slow but remember this isn't um animating in real time so the actual movement of this platonic when we do a render will be much quicker and it's going to look really nice okay so let's just make a couple of adjustments to our fluid and we're going to do that not in the fluid effects settings we've set that we're going to keep it at medium and everything else on default but if we go to our emitter water body we can go to the extended data tab and then look we have a fluid data tab so let's go there and what we're going to do what i'd like is a little bit more vorticity which is kind of like the natural swirling turbulence of the water so let's just increase the vorticity large and the vorticity small up to say 30. which should give us some nicer curls and tighter kind of ripples you can see i mean you can see here that the swirling nature of this water body is already working really nicely okay so that's pretty good now what is going to bring the detail to this is not the fluid particles but is creating some foam particles so let's get that sorted now we will go to our dynamics menu and we will go to the xp foam object click that bring it into the scene now the xp foam object requires a new emitter to be able to make the new foam particles and that's what this create button is for so let's click that and we get a new emitter let's just rename it basic tab call this emitter phone and let's just play it on default and see what we get i'll make the water body invisible so now we should only be watching the foam particles and we're not getting anything at all and it's obviously not working so what has gone wrong well there's a couple of things let's go to our foam settings first of all it's set to only start making foam after 60 seconds of scene time has gone so let's just put that back down to zero and what i'd like to do with foam is that there are two different types of foam particle that are born with this object there are the crest particles and air rate particles and the crest particles are based on the curviness of the crests of waves within a simulation and the air rate is based on the particles bash the water particles bashing into each other and trapping air in into each other thus creating more foam particles so what i like to do is to set these both up individually to get a really good handle on exactly what they're doing so let's start with air rate so i'll just switch off the crest rate which means there will never be any crest particles we're just dealing with air rate particles and i'm going to put our air rate up to say 100 and let's see on the default settings whether we're going to get any air rate based particles and we haven't got any yet so something isn't quite working for us so let's have a look at these air rate settings so the air rate are concerned with the minimum and maximum speed so it will not produce air rate particles if they are moving under this speed and they will not produce them if they're moving over the max speed and then the second thing it looks at is the minimum and maximum impact so let's just reduce this minimum impact down to zero and then we'll hit play and see if we get any air rate particles and then we're still not getting any so let's move the max down a bit we'll keep moving it down keep moving it down keep moving it down ah now we're starting to get a couple of particles so now we're almost at the bottom here look we put this on one say zero to one now we're starting to get some particles happening in there so perhaps our minimum speed is restricting the development of these particles let's reduce this down a bit ah look now we're getting loads more particles so the speed was having an impact now i've restarted and played again and now you can see can you see that we have foam particles on the bottom and the edges of our cube which is not really what we want and the reason that's happening is if i make our water particles visible again the foam doesn't care which way is up it just works out what is the surface of the surface of the water by the way in which the particles are in relation to each other and as far as the foam is concerned this side is the surface of the water as well as is this side as is the underneath so the best way and the most efficient way to get this right is to set up a kill object which will just kill any foam particles on those outside kind of peripheral parts so let's do that now we will go let's go to press f5 and we'll use this side on view all right so now we'll set up a kill object let's go to modifiers control modifiers and an xp kill there it is and look we get this bounding box so let's sort that out we want it to be just inside there which will which will get rid of any surface particles on this side and then let's bring the height way down so it'll get rid of the ones along the bottom like that and let's come out of that view and then we need to just go into this alternate side view and bring this kill object in there we go so now that's in but this kill object is look it's set to outside bound so we'll kill anything outside of this green square but it's going to kill our water body particles as well as our foam ones we don't want that so we need to to exclude it from the water body so let's go into the emitter water body let's go to the modifiers tab and let's drag in the kill and now this minus means that it's excluded it's not going to count that if it was on that ticked it would mean it would work minus means it's not going to do anything so let's hit play yep so we've still got our water body particles but if we go back to our f1 perspective view the foam particles will no longer be being um well they'll be generated but they're killed immediately all right so we're starting to get something it's not quite right yet so let's go back to our foam settings let's go to our air rate and put this up now we've started to create some particles as they're being pushed around which looks quite nice we just don't have enough so let's put this rate up by a magnitude of 10 so now we've set that to a thousand air rate and let's start it we should be getting more particles yep so as it's pushing them around we're getting loads more aerate particles now so that's working really well actually pleased with that so let's just keep those settings as they are we'll remember our air rate is going to be a thousand let's put it on zero for now so now we'll move on to our crest rate particles so now if we hit play we're not going to get any foam because we've got both rates set to zero so let's move on to crest rate put this on say 100. so we're on default crest rate settings of 30 to 50 percent and we're getting a little but not much so let's reduce the min crest down so the angle doesn't need to be as great on that crest and then reduce our max crest down which is going to give us more foam okay back to the beginning let's reduce that max quest down even further so we're going to get lots of crest particles where we don't have a huge curved crest and that's because we've reduced this max crest way down so let's just put let's put that back up because we want particles on the bits that are curling right over but let's just ramp up our crest rate put on 500 let's see what we get so yeah every time we get big kind of splashy waves we're starting to get these nice crest particles that's looking good excellent so let's mix that with our airaid particles put that back to 1000 and now we have a mixture of the two and that's looking really nice we're getting this nice swirling effect as they kind of dissipate very nice indeed it's amazing how much detail the foam brings to the simulation that's a really nice aggressive bit so that's looking lovely now these at the moment we've got the life of these foam particles set to 150 frames with a bit of variation so let's just increase that variation a little bit so they will die off arguably we could maybe reduce it a little as well let's maybe put it down to 120 frames so they don't last quite as long and this is looking very good i don't know don't if you notice right at the beginning we're getting a little bit of um foam created and the reason that's happening is because as soon as we hit play the gravity has an effect on our particles and they drop slightly and it's creating this foam so just to avoid that let's um not animate our platonic until the water is settled and also let's not activate our foam until the water is settled as well so let's just switch off the foam and let's just get an idea of when that water settles so there's the drop and it's kind of settled there so 20 let's just say 20 frames so in the foam let's activate it again after age 20 frames excellent and then in our vibrate tag let's do the same so let's go to the basic and we can put a keyframe on the enabled on frame what we on 22 let's go back one frame disable it we've got the water settling and as it starts to move we then get our foam creation and it's looking really nice isn't it i mean it's amazing how much detail that foam brings to these sims it's looking fantastic swirling around the place and that's looking great okay so the one problem that we have here we have to remember that our technique here is to create a small dynamic area of water where our object can interact and then we are going to comp that into a much larger non-dynamic body of water which will be much quicker to to simulate and to render if we were to create an almost um limitless ocean in a dynamic way it would just take about it would just we couldn't simulate it so we do this in a small dynamic container and then we need to be able to match this exactly and comp it into a much larger c and one thing we have to make sure is that the foam never pushes back and bounces back off of these walls now it's not bouncing back off the collider because we're actually killing the foam before it gets to the end but because of that we're getting this very straight killed foam line which if we comp this onto another ocean you're just going to see that line it's going to break the illusion so what we need to do is make this box bigger so it can contain the entire foam animation we want it to be as small as possible but be able to contain the entire foam animation so we're not losing these straight edges so now that we have got that working as we like it and it's looking good what we could do is just increase the size of both our collider box and the emitter so let's do that let's get our cube and at the moment we set it in the x and z to 200 so let's maybe put 350 by 350 so that's a lot bigger um maybe slightly more let's just try let's be safe let's try 400. now remember the more you do this the more you're going to up your caching time because we're going to be using loads more dynamic particles so fluid effect is having to work a lot more but by having a big one we're more likely to have a perfect foam animation contained within this without reaching the edges so we need to do the same with the emitter so let's go to our emitter water body object and let's put the x to 400 and the z to 400 and then we need to readjust our kill object because that needs to come virtually to the edge of the bounds there we go and let's do the same with the other side of the kill object where's my handle there it is there we go so this is going to work similarly the particle animation will be similar because we haven't changed the particle size so the fluid kind of resolution is the same it's just a much bigger body of water which means it will take longer to simulate and there's nothing we can do about that but it should mean that we are able to contain the foam within it so instead of playing this through you can see that we've still got playback and we can see animating but it's much slower so let's set up a cache system so we can actually cache this out and have a look at the result so we'll do that by going to the utilities let's bring in a cache object we're going to save to external files and we need a path where we're going to save those cache files so let's hit the browser button i've set up a library here dynamic ocean and let's go to dynamic ocean i'm going to make another new folder actually call this one cache and let's hit ok and that's it so we're going to cache the water body and the foam excellent that's already so going to hit bill cash so i will leave this running come back to when it's finished tell you how long it took we can have a look at the animation and then move on to the next stage okay so that uh cache took four minutes and 20 seconds to complete let's have a play through we'll get near to real time playback on this so that's looking really nice isn't it very fluid uh if anything we can perhaps have a little bit more kind of dynamism in the fluid motion here um and a couple of ways we could achieve that um let's go to our let's go to our water body emitter we'll go to the extended data here we are in the fluid data tab let's just reduce some of that viscosity down to say 15. let's also reduce the surface tension by one and in our vibrate tag let's just increase that frequency up to get a bit more dynamic movement to say 1.4 okay so let's go back to our cache and we'll build cache overwrite we'll give that another run through and we'll review those changes should be about four or five minutes so we'll come back when it's done okay and that cache took five minutes in 11 seconds let's have a look at those changes there we go and that's looking nicer to my eye some nice splashing but our foam is never reaching the very extremities because remember that wouldn't be good for when we get to the comp stage but we're able to work with this this is going to work well so arguably you could maybe get the foam particles to fade a little bit more quickly but i mean to be honest with you this is looking pretty nice i'm happy with this so then that's looking really good so now we need to move on to the stage where we can change this from what is a very nice looking dynamic water body to one which looks like it's part of a huge ocean because at the moment um it just is what it is and it's kind of reflecting off the walls of this domain so we're going to work on that in the next stage so let's just get this system let's just hold ctrl alt and deactivate the whole lot for now so we no longer have that system up and running and let's go to our x particles menu and we'll go to our um generators and we want to generate an xp ocean so if we bring it in in its default form we have this what looks like a plane and it's kind of got this animated wave pattern so let's have a look at those settings so in default it's set to primitive which brings in its own geometry and it is this wave and we've got various different um settings the width and the height are obviously the size of that primitive and then the segments if we hit d the segments just give it more um segments which means like any deformed object um the more segments you have the more polygons the more detailed that deformation let's hit nh to get rid of that and then we've got various different settings to alter the way in which these waves work um first of all we've got wave height so we've got the waves going smaller and bigger we have a time scale which is kind of like almost an animation speed you can think of the time scale the noise type is set by default to tessendorf which is this type of wave simulating noise and the resolution is the resolution of the map that is driving this deformation so the higher up you go in the resolution the more kind of detailed deformation you get but you'll you will experience um significant viewport slow down because it's having to process much higher resolution maps to make this distort so we can just leave that on default for now and then we've got various other different sliders we have an ocean size so bring it up it makes a much bigger scale ocean bring it down it makes it much smaller so we have an ocean size setting we have a smaller smaller wave setting which is a bit like a a detail setting really if we put this up it'll smoothen it right out bring it down and it adds more detail then the choppiness slide is an interesting one it kind of pinches in on the x and zed um the deformation and it kind of creates these these pinches on the waves which kind of it's kind of like distorting and stretching it really and it gives you this bit of detail the problem is if you go too far in choppiness it overlaps itself and it it breaks that deformation so you need to be kind of less there's more on the choppiness really then we have an ocean depth which will slightly change the way in which those waves are moving now we have a wind speed which is a really important slider the wind speed um if you increase this it kind of makes a bigger swell if you imagine the bigger the gale you're going to be moving much larger volumes of water so more wind speed equals a much bigger swell once you've got a bigger swell you can risk a little bit more choppiness to get more detail you can even increase that wave height if you do you'll have to reduce your choppiness so as you can see these these sliders all kind of play off each other nothing really works in isolation but very quickly you could mess around and get some fantastic looking oceans with this so what we want for ours is we're not going to go for a a huge ocean actually um we're going to go for a relatively tame just kind of bubbling bobbing along ocean uh let's increase that time scale a bit something like that maybe a slightly more choppiness all right we can if the damping is an interesting one if you have the dampening on zero the ocean is just reflecting back and forth and there's no kind of continuous looking movement and the more damping you introduce the more wind direction movement you get until if you put it onto full you can see look we've just got a perfectly moving um swell which is following the wind direction if we change their in direction that movement changes if we but but for realism you do want a little bit of reflections in that so if you have it i mean 0.9 to be honest is a good number and you get a little bit of reflection it just makes it feel that little bit more realistic so that's going to be our basic ocean shape and animation so how do we use this to make our interactive dynamic water system look like it's part of of this big ocean well this is the real power of xp ocean is that we can use it in primitive mode but we can also use it in deformer mode so let's put it into deform mode and now it's disappeared because it's acting as a deformer it's just like any of the other cinema 4d deformers now and it needs to be a sibling or a child of the thing that you want to deform now this is the amazing trick let's just reopen rx particle system and reactivate it by holding ctrl and alt and let's just move forward so we have this sim which is a flat water body but just interacting with our collider object look what happens for now i'm just going to switch off our foam let's just switch off the phone so we have this dynamic water body but look let's go to generators let's choose a generator and we'll pick an open vdb mesher there it is and this mesher we're going to mesh the water body particles so let's drag the water body particles into the sources window and now it's meshed it let's make the water body particles invisible so this is too blobby at the moment so let's go to our point radius and put it down to say two so now we have an open vdb mesh which is animating with the movement of our dynamic water body fluid effects particles let's have a look there we go look and we're getting that animation now i haven't got any smoothing filters on or anything yet but look we can see now that we have a mesh that is animated with all that nice fluid motion fantastic but here is the cool thing because the open vdb mesher is creating these polygons it can be deformed by any cinema 4d deformer so if we put our xp ocean as a child of the open vdb mesher it becomes deformed by those waves but it's still going to respect that animation from its its source which is our dynamic water body particles so if we hit play now we're getting this wave animation playback isn't amazing at this point because obviously it's creating all these polygons live but look so we have our water surface but we've also got that wave deformed water surface with our interaction of our live kind of dynamic sim so we've got the best of both worlds which is really cool so how can we make this better because if we get our foam particles these foam particles aren't being deformed by the xp ocean like the open vdb measure it so they're going to look like they're going to be sinking underneath of these waves now so that's not working but don't forget and a lot of people do that x particles can also be deformed by any cinema 4d deformer including xp ocean so what we are going to do is we are going to re-cache these two particles but we are going to set the foam particles to be deformed by our xp ocean so let's get that set up before we do i just think our waves a little bit too strenuous for this look so let's go to our xp ocean um we'll set the displacement space from local to world this is in the explosion deformer now this is very a very important step because what this is going to do is it means that any other object that is being deformed by this will be deformed by the same noise it will be a kind of a continuous noise across the entire scene and it's a really important step and we'll demonstrate that a little bit later but we want this to be in world mode and let's just take the let's have a look um we want the [Music] wave height to be a bit smaller yep that's looking better maybe fraction more choppiness there we go that's looking more like it i think very nice all right so what do we need to do so we want to recache and at this stage i'm not going to cache the open vdb mesher so i'm just let's just switch that off we're going to recache these but the foam particles we want them to be distorted by this xp ocean so let's go to the emitter foam we're going to go to the modifiers tab drag in the ocean and make sure it's on tick yes affect those foam particles excellent so now we will go to the cache object and we want to recache this let's hit build cache overwrite and we need to let this run through again so it's going to be another five minutes or so so we'll do that we'll let it run through and i'll come back to you when it's finished okay so again that was about five and a half minutes that cache five minutes 31 let's just make our emitter water body particles invisible and so now you can see we've got what seems like a very similar simulation but look our foam particles are now animating in exactly the same way as our xp ocean waves because they are being deformed by them which is amazing it's such a neat trick so that is working really well let's just make our openvdb mesher visible again and you can see the trick that we are going for so we get our animating waves and our foam particles are now going to feel like they are in this same sim so yeah look as it moves away and displaces the water and we get our foam particles moving in the same way but they're still respecting and following the kind of underlying wave surface and this is looking really really nice excellent so what we could do with now is um getting this cached out let's just hit nd to have a look at our open vdb line so arguably we could have this mesh slightly higher resolution and remember with our xp ocean object the more resolution in your mesh the more kind of detail is going to come through in those waves so let's go to our open vdb mesher and let's go to our voxel size and put it down to say three which is more let's go down to say two so obviously this will take longer to calculate but look you can see more detail coming through that mesh now um and we can just perhaps smoothen out a little bit of these creases there's again a couple of different ways we can smooth them out we can go to the filters within the mesh and add a filter and so just the default median if i take that off it's just smoothed out some of those bumps another one that's good for fluids if we just deselect the medium if we bring in a curvature it kind of smoothens out bumps but does but doesn't offer too aggressive um a smoothing on other parts which is quite nice of fluid because you want some of this um you want some of this kind of um this kind of spikiness uh and kind of unevenness in in in the uh in the fluid surface so that's looking pretty nice just like that i would say let's just move forward a few frames um let's go forward to frame 170 very nice that's looking excellent all right so let's get this properly cached up now then because we want to cache the open vdb mesher as well so to do that all we need to do is have it active let's go back to our cache object and we're going to go to build cache but this time instead of overwriting which would overwrite both the foam and the water body we can just hit continue what that'll do is it won't bother trying to recache what's already cached here the foam and the water body it'll just cache the open vdb mesher so let's hit continue it'll run through that once that's finished i'll come back to tell you how long it took and we'll have a look at that final animation all right and that was a faster cache because it wasn't having to do the fluids this time just the mesh that's three minutes 15 seconds and it looks quite right actually but there's something a little bit off isn't there now the problem here is um that we cached the open vdb mesher with the xp ocean deforming it and it's cached that but the expiotion is still active and it's trying to well it is deforming it again so we've got kind of a double strength exp ocean here so now we've cached let's just deactivate the xp expiotion and there we go this is all in cache now and that's kind of working nicely so let's just play this through and there we've got that splash working really nicely foam working well and it's all kind of coherently moving as it should but it's being deformed by those waves where necessary so very nice technique and it's working really nicely for us okay so another thing we're able to do after the event you see right near the beginning of our scene before our particles settle we can see a little bit of um particle separation as our mesh um as they kind of settle onto the floor um and we can we can get around that another really nice thing you can do with the open vdb mesh and you saw with the xp ocean is that even when it's cached it can still be deformed so let's go to the cinema 4d deformers and bring out a smoothing deformer we'll make that a child of the open vdb mesher and look we can just stiffness by default is 30 percent we probably don't need that uh we don't need it to be that smooth let's increase the stiffness which brings you closer to its original state and then look that's just enough to smoothen out i've got a little bit at the beginning we're not going to be rendering at this stage anyway actually but we can just increase that smoothness just to get rid of those and if we wanted this beginning but i guess we could animate this stiffness so there's very little stiffness at the beginning and then once that settled we could bring it back just to bring back because you want you want the detail really but there we go so we've got this nice water body and that's looking fantastic excellent so let's just have a look at doing a really quick kind of hardware render here and then we'll look at ways of how we can comp this quite small dynamic fluid body in with a much larger ocean um to make it feel like it's a proper ocean that is dynamic even though only this very small little bit in reality was dynamic so we'll sort that out now so let's get a material sorted out first of all for our mesher we will uh we're just going to do a viewport render here a hardware render but we can still make this look a bit nicer so let's just double click in our window here make a new cinema 4d material and we'll just drag that onto the mesher let's double click to get our material settings right so we could kind of do reflectance and bring in an hdri as a sky object and all that but actually we just want this to render quickly we don't necessarily want it to be physically accurate so we can just fake the look of this by actually using a nice little shader in the color channel so just go to texture and we'll bring in a fresnel so what a fresnel does is it kind of maps applies this black to white gradient to is dependent on the camera position angle to the object so the parts of the object directly facing the camera will be black and as the as they are facing away from the camera they're mapped to white and so you can see look that we get this kind of changing gradient over our object it actually looks pretty decent for a reflective surface and obviously it's really quick to render so let's just change the color of that we'll just do all of the colors instead of having a sky with reflections we'll just color this gradient so let's go to we can bring in a preset and there will be a sky preset in here there's a couple yeah look sky one two and three let's choose um sky uh let's choose sky two so there you can kind of see that you've got a very basic uh water going on so let's just have a look we are going to let's pick the angle we're going to view this from i don't know something something like this and what we'll do is we'll extend our ocean out in this area so something like that so then let's just make adjustments to this to make that look a bit more pleasing so we can take out some of these knots there we go let's bring this up there we are and take out that knot a bit more white in there and obviously you pay much more attention to this than what i'm doing maybe something a bit like that okay and even with a really quick kind of cheaty um texture on there you can see that with our foam particles it's looking pretty decent i mean this obvious just viewport um preview but that foam really brings out the detail of that water sim um that looks that looks really cool i think what we could perhaps do let's move these knots up a bit yeah that's looking better and this one will just make it a bit lighter that's it so the saturation coming out makes it feel a bit better all right and this one again let's take out a bit of the saturation and darken it maybe okay there we go that's looking quite nice and nice and foreboding we might need to make a change to that when we create the rest of the ocean but for now that's going to work fine for us excellent let's close down that material so what we want to do let's just put a camera in there there we go and i want a protection tag let's just hit shift c to bring up the commander i'm going to type in protection there's protection tags in the rigging tags so now i can't move the camera right so now what we want to do is we want to create the rest of this water body so this is the fantastic thing well one of the many fantastic things of xp ocean let's just bring it out of this hierarchy because we've cached it into the openvdb meshes so it no longer needs it let's bring in a plane object and this plane object we're going to move down to approximately the same level as the mesher and then let's increase its width let's move it back we're basically wanting to fill out the scene here so there we go and then let's increase the height which is that way on the z so if we hit nd we want to match the density of polygons in the open vdb mesh and we need to make the plane the same so let's go to the plane and let's add say i mean we're going to want maybe 300 by 300 even more than that we could go 500 by 500 and let's just come out of that camera see even that's not enough let's go 800 by 800 oops 800 so that's looking pretty similar now isn't it okay let's go back in and hit n a to get rid of those so let's put our material on the plane and now if we make our let's bring the plane into our utilities folder and if we make the ocean a child of the plane and activate it you will see that because we have our xp ocean remember we put it in world displacement mode that means that the deformation is fixed in world space so we can move our plane anywhere around and it's still going to be in the same displacement space as it is on our mesher which means that apart from these edges we have really nicely coherent cohesive deformation can you say look these waves are moving in exactly the same way now the problem we have with the join is we have a bit of a bump here the reason that is is that the plane is perfectly flat and our open openvdb measure is actually it's meshing particles which aren't a perfectly flat surface and so we have a little bit there's a bit of a disparity between the two what we could do though is we could for a start move the plane up ever so slightly let's deform it again so that has reduced that bump but here's what what we're going to do we are going to render out just our dynamic ocean like this okay and then once that's finished we are going to get that off and we are going to render out just the plane this one and then in comp all we need to do is mask out anywhere these these lines here and this is why we didn't want the foam to come right to the edge of our domain because we'll just mask them out layer them up and it'll look it'll look infinite so let's get this set up then so first of all let's do we'll do our hardware render of our meshes let's make that inactive make the ocean inactive we don't need to um have the water body particles active because the mesher is cached so here we go looking good all right that's nice so at the beginning of the simulation we've got as the particles are settling we've got a little bit of bumpy separation here where um it would have been it would have been nice to have started our animation of our platonic once this had properly settled and that you see look we've got a perfectly um a perfectly smooth mesh uh just the first few frames of that animation we've got a little bit of a bumpy mesh which is not the end of the world but obviously if you were doing it for real you'd smooth that out what we can do is let's get our smoothing deformer and once it's smoothed okay so we've got to the we've got to a frame where everything's nice and smooth let's just maybe reduce it slightly more that stiffness let's hit a keyframe and then let's go back a bit and yeah so we want much more smoothing hit a keyframe so now it should kind of maybe ease in a little bit more and it's not going to be quite as prominent there you go so let's clean that up but obviously if you're doing it for real you would resim it until you had a perfectly smooth mesh all the way through from the point at which you want to render right so you want to get rendering and we're going to do a hardware render so what are we going to do we want to get rid of all of this viewport furniture so the quickest way to do that let's just go to the filter option and put no filters then go to filter and just hit well we want generators and then we're going to see let's have a look all of the stuff that we want we don't want to see this box so let's just deactivate the cube let's go to our foam emitter which is what this red square is showing let's go to display and uncheck draw emitter so there we go that's it very nice very cool that's looking excellent love it all right so let's go to our render settings and we'll go to output we want to save all frames we'll just do it at 720p let's go to our save and we'll save it as an exr and we'll do a 16 bit and let's choose a file path and i have my dynamic ocean look i have an empty render folder here so we'll save it in there and then we need a file name let's put dynamic ocean hero hit save great that's all good so we need to change our renderer to the hardware opengl renderer we want to activate this uh reflections and that'll look okay let's just put some anti-aliasing on there for look right okay so that's that excellent so let's hit range to picture viewer so this should uh chug through this really quickly um because it is uh obviously it's hardware render so not a huge amount going on so i'll let this render once it's finished i'll come back to you tell you how long it took and then we'll get on with rendering the background element which is going to be our big large ocean okay so that render has uh finished and it was a pretty quick one let's just have a look it was two minutes and 46 seconds and so here we have our hero water and this is not quite real time this is just loading it in so it's a bit quick here we go here's the proper speed and we've got this nice thrashing platonic moving around in our ocean with some really nice foams and water deformation and that's looking really nice all right so that's that one let's just come out with a picture viewer so now what we want to do is our second render so what do we need to do switch off our foam switch off our open vdb mesher we don't need any of that let's activate our plane and our ocean object we'll get rid of our platonic and now we just need to render this out as well so let's go to our render settings we'll save and this one will save this as dynamic ocean this one's going to be bg background save and that looks good so let's hit render so this will chug through again it'll be uh two or three minutes and then we will come back have a look and we'll get them comped together so here we are in after effects and we have our two rendered scenes here we have our background and our hero so let's just bring in our background first so there we have our background uh animating away nicely that's our big ocean so now obviously we want to see our hero so let's get our hero pass let's put this on the top now obviously we didn't render an alpha with this because all we're going to do is we're going to mask out the sides of this ocean and we want it to start kind of when it settles down so we're going to start about there weren't we let's just trim our work area to there okay so very simply let's just go to our mask tool and we're just going to draw a bog standard mask there we go let's hit m m and let's put a bit of feathering on the mask so if i just make the other ocean visible let's hide that mask line so that is that's basically it that is our mask now this is the reason why it's so important to make sure that your foam doesn't go too close to the edge of your domain because we need to be able to mask out this to feather it over the top of our other ocean so here you can see look it's slightly coming out so let's have a look at our mask path we could do a bit more of an intricate mask here and just bring it out slightly so we don't lose that detail there we go so realistically if we were doing this for production we would it would be nice to have a slightly even bigger domain that we um that we simulated so we weren't running into these problems and having to kind of animate masks um when it comes to output but for our tents and purposes this is looking really good very nice so then when we reintroduce the c we have an indistinguishable join and that's because both scenes are being uh displaced by the same um xp ocean and there you go if we play that through there we have what looks like an ocean that could be dynamic the whole surface over but in reality it's only our small section but then we've easily been able to comp that and it's looking really nice so that is how we can set up using xp ocean to get the general ocean wave motion but then use xp fluid effects and xp foam to create this really nice dynamic detail of our moving object interacting with that water surface you
Info
Channel: INSYDIUM LTD
Views: 38,455
Rating: undefined out of 5
Keywords: X-Particles, INSYDIUM, C4D, Cinema4D, Cinema 4D, MAXON, VFX, MotionGraphics, Update, Sneak Peek, Cinema, 4D, xparticles, particles, simulation, cgi, vfx, mograph, motion graphics, 3d, 4d, effex, visual fx, software, tutorials, tutorial, tip, hint, help, quicktip, trick, hints, xpOcean, water, liquid, ocean tutorial, X-Particles Ocean Tutorial, digital art, realism, realistic ocean, xpFoam, foam
Id: pl1aX6iT3so
Channel Id: undefined
Length: 60min 43sec (3643 seconds)
Published: Tue Jun 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.