Slow Motion Bubble Simulation // Blender Geometry Nodes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I'm going to show you a thing and then you can guess what the tutorial [Music] is did you guess it it's the bubble popping that's what I think is cool but it turns out if you take this and speed it up a lot the quick bubble popping looks a lot more realistic than having it for one frame and then removing it this video is sponsored by skillshare but we're going to talk about that later so recently I've changed my default scene so that when I open blender it's already in cycles and there's a sphere and everything so you set up your scene and then you save startup file either way I am using 4.2 Alpha and the reason for that is there's like extra features in the material that are going to be useful for actually making a bubble so bubble material you're going to see that now there's a thin film option which basically lets you make what looks like a bubble we'll get to that so first things is first we're going to enable maximum transmission so we can see through it and make it fully shiny so we get this bubble thing by the way if you have an hdri make sure you have transparent glass to make it transparent other than that we want to mess with the I which is how much light bends when it goes through it but it turns out like an i of like 1.22 or something like that makes it look a lot more like a bubble and additionally in this thin film you're going to see we have a second I before changing this I'm going to change the thickness and you want to bump this really high so let's say like 800 or so and you can see this is without out and this is with it just adds the bubbly soapy color at which point you can now play with the I and like get different looks but I think this is a good start okay we got our soap bubble material super easy and now let's do the simulation which is the interesting Parts I want you to imagine that there's kind kind of like a force that starts at the bottom and moves its way up the bubble and what this does is it's going to like eradicate it's going to get rid of the bubble as it goes up and then on these strips it's going to spawn particles so as the bubble disappears it kind of sprays soap and water and stuff like that we're going to delete geometry which gets rid of it but I only want to do that as we move up the model so I need the Z component which we can check if it's like greater than or less than some value and put that into selection and look at that we have a bubble disappearing I'm going to do it the other way should be at minus one key frame let's say we go 60 frames down and then up to 1 or I guess 1.01 key frame let's make the 70 frames and okay so that's our bubble disappearing now if you're seeing these Jagged edges the easiest way to fix that is add more Geo and smooth the boundary so let's add some geometry so subdivide mesh is going to kind of help so in fact if we kind of like isolate this border over here we can blur only on those coordinates and this should be pretty easy cuz we kind of already have the info we need so I'm going to add another less than this one's going to stagger a bit behind so again1 key frame and then positive 1.01 key frame but in between just like add a bit of an offset so let's do 0.1 I can view what this looks like switch this to subtract and now we have kind of like this area isolated because it's lagging a tiny bit behind and by the way this is also how we're going to spawn stuff either way for these values I want to do smoothing so I'm going to set position for that position I'm going to blur so I'm going to basically smooth out the original position so you can see as I increase these iterations it slowly Smooths it out so this is before and after it kind of Smooths it out on every single frame technically I only want to blur this selection so that it doesn't blur things that I don't want to blur and now we're actually pretty set up to actually spawn particles so let's do that that's going to be a simulation the simulation is basically going to spawn and then move particles so distribute points on faces what are we Distributing on basically this deleted sphere thing and join the particles with their like previous iteration so if I do this you're going to see it basically spawns particles everywhere and then just kind of adds to them but I only want to do it on that selection we have that strip so let's put this in the selection and now we have partic spawning as we go up additionally when they spawn they should kind of move outwards so we can store the direction so if we want it to go outwards it should basically go on the normal kind of the direction that points outwards of the sphere that is basically going to be the normal so let's make that a vector store the normal we're going to call a direction and then on every single frame we can just set position so we're going to offset the position by this named attribute which is the direction which goes way too fast but you can see that's kind of the idea here so all I need to do is kind of like scale this down so if I make this like 0.1 you're going to see that it's like much more contained here I want to add a bit of Randomness so they're not all moving at the exact same speed so I can just do a random value between like 0 and 0.1 let's see what that looks like pretty good I do want to Nerf that a little so first of all you don't want anything to be at zero because then some particles won't move so we're going to go from 01 to1 and then I can kind of Nerf this a little by multiplying it by like 0.5 so we're making it two times as slow going to speed it up a little okay so to see what's actually going on here we don't want these water particles to go on forever right after they kind of burst very quickly after they should disappear so additionally I'm going to store a integer and that integer is basically going to be the frame that it was spawned on so we know when this thing was born and then we can say after five frames deleted right so I can delete geometry now and I can compare the current frame number to that like named attribute so named attribute the integer by the way I need to rename this I'll call it frame and then all I need to do is see like how long has elapsed so I'm going to subtract one from the other so this is basically the difference and if that difference is greater than let's say five so five frames have elapsed then we can delete that GE omry so let's see what this looks like okay now they're kind of dying off so that's good just like we randomized the speed I also want to randomize this like death value just just like real life not everybody dies at the same time that's great three to like seven maybe we can experiment with this yeah that looks pretty good to me okay that's not bad just want to change some numbers first of all I can bump up the density that will spawn more particles and second of all I think I want them to actually move faster and to see what this looks like we can now actually simulate make sure to save the file bubble. blend it's going to be available on patreon if you care click bake and look at that that's pretty good as mentioned earlier if you remember this video is sponsored by skillshare what is skillshare it is the biggest online learning community ever ever conceived it is a platform to learn any digital art for us typically we care about 3D animation I just have a hunch on top of all the normal courses that skillshare has had to offer and still has to offer they've added learning paths and you can think of this as a curated sequence of lessons that flow one and another and another and the one I want to talk about is Wonder for filmmakers and production designers and this learning path is based basically about CG and live footage integration which is what I've always liked the most I remember even in high school that was like my thing so we're talking about Green screening mixing live elements and CG elements and learning stuff is always a good idea but especially since summertime is on not on the horizon it is here we have an extra motivation to spend that time to learn something you can of course check out skillshare but I have an offer for you the first 500 people to click the link Down Below in the description will get a one-month free trial of skillshare you can just have it and now back to popping bubbles I guess one thing going to make this look significantly better is these particles are huge like weirdly huge so I can set point radius and make that like five times smaller so now there's like really tiny particles and that already looks a lot better and I think this is also something we can randomize so let's see 0 to 01 change the seed connect that here only other thing I want to change is these are very like uniform like they all come out from the normal which makes sense cuz that is what happened I just want to randomize these a little so instead of adding a random value this time I'm going to add a different source of Randomness so it's a little smooth so a noise texture I'm going to Center this so instead of 0 to 1 it goes from .5 to.5 and I can basically add their contribution here so we have the normal plus some Randomness and then because we only want it to be like a direction I can normalize this so that it doesn't have different magnitudes maybe I can like scale up the effect of the randomness maybe this is four times stronger oh yeah wait we didn't res simulate duh I think we need to play with the scale and stuff so I'm going to experiment so I think I've hit the sweet spot that I like with these settings so we have our particle spawning and that is almost the full effect I take this set position I join these together and now you can see we kind of have both but it looks kind of weird and that's mainly because there's this kind of like perfectly flat line where it's being cut but that kind of looks weird so I want to distort this so that the boundary is more like that well if we're deleting by the Z coordinate all I have to do is distort that Z coordinate if I want it to change so I can take a noise texture that is going to be a source of Randomness again I'm going to do the same thing I'm going to subtract by 0.5 but this time to kind of mix these together and this should be the coordinate system instead of like adding these there's a special operation in mixed color called linear light so linear light these together and now you kind of have this nice Distortion where I can bring down the scale so it's not as intense maybe bring down the detail I just want it to be really smooth so I can scale this up by maybe 30% and that looks a lot more natural to me if you're not seeing that it's like fully closed in the beginning you can just kind of like animate this Distortion where in the beginning there is zero Distortion so it starts off the same but as we progress we get more and more Distortion so something like that and let's see how this progresses it goes all the way up and good and I should mention this kind of like delayed thing we made does work with this distorted coordinates so that's good okay that's already looking much better but it's still like missing something it's just like a sphere disappearing with particles I think one thing that's very important is you want it to look like there's like Distortion going on here in fact as it goes up there should be kind of like this Wess where it's kind of disrupting the surface and we can do that by just kind of like offsetting it by the normal based on like a sine wave so instead of using this kind of like sharp cut off I want it to be a bit smoother than that so if I use the subtraction you get to see have kind of this like Smooth thing but I'm going to make this a custom parameter we're kind of doing like a soft one that says like like how far away are we from the boundary I know we've gotten very messy here so let's actually clean some stuff up so this whole part is basically our delete function so I'm hitting a Control G to kind of turn this into a node group so this is delete this part is like the offset of the particles so Control G I'm going to call this maybe direction or no let's just call it offset this whole part is just kind of like picking the direction and this part in the beginning can be our like coordinates with Distortion so I'm just going to call this coordinates and look at that that's much cleaner so take a look at that this is what we changed and now that we have kind of our smoothing I can use this to dist the coordinates so I'm going to set position to offset I'm going to offset by the normal Direction which is going to just kind of inflate this but I want to do that kind of selectively so I'm going to scale this by our custom parameter so you can see this is definitely doing something the reason it's behaving weird is there must be negative values or something I don't know so just hit clamp okay so it it's definitely like the right idea of course I want it to be wavy I can like send this through a sine wave something like that you can increase the frequency by just like multiplying the input so as we add more and more here you can actually start seeing this like waviness multiply it by a tiny number so now you can see we can actually kind of like control this but to make it look more kind of dynamic you also want to offset by adding so multiplication is frequency changing addition is what's called a phase change where as you add you kind of get this kind of effect over here so I'm going to animate this relative to time which I guess we can make move a bit faster so let's multiply this okay so that's a little better that that is an improvement and by the way if we change the surface the way we just did we want to make make sure that this is what is emitting particles so instead of this now that we've done our Distortion this is what is emitting particles I think we can do a bit better where like on top of all of this we add Distortion Like on top of everything at the very end here I'm going to set position by basically what ends up being like a noise texture so noise texture and making this less intense by scaling this down and to make the detail kind of low frequency which is actually what we want usually you want High detail here we want the opposite I'm going to bring down the scale that's actually the big one and maybe also bring down the detail so before after that adds a bit of something and you want to make sure that this in itself is evolving and I think a good way to do this is we're going to take our position coordinates and just like we're animating this going up so too can we animate our coordinates kind of Shifting up and down so you can see it kind of flows up the surface so we start this off at zero and then on frame 60 let's go a bit before so we can see what's going on I'm just going to shift these coordinates a little okay that looks much better to me so maybe at the end here we do the exact same thing we did where we blur our position so it doesn't look so sharp so something like that that is going to really kind of put it all together set shade smooth kind of like wrap this up here of course I want to emit as many particles as I can so let's multiply it by six what what is that 300 in my head the more particles the better yeah that that looks about right I think the only thing that makes this look ridiculous is the size of the particles you can actually make these really really tiny like because we have so many of them I think it's going to look good so maybe let's multiply this by 7 so we get rid of 30% so these particles in themselves should have a material we can start with the bubble material and see what that looks like it's a little hard to tell that that anything is going on here so let's add a new material I'm going to call this water we're actually going to have water droplets where we don't use any of this thin film and I also bring down or bring up I guess the I to 1.33 since this is the value for water and then I can swap this over to water as just kind of like a final thing I think we need it against a Black Background by the way make this fully white and same with the bubble material make that fully white so to add a background what I can basically do is do this in compositing so you do an alpha over so this image goes over the color black and you're like I mean you're only going to see that on render except now there a feature where you can enable compositing in the viewport so now I can actually see what's going on let's kind of disable this so we can see what's going on I think we want an I very close to one which will add minimal light bending so maybe like 1.05 maybe and then let's see if we can bring this up that is way too intense I don't really know how this works too well yet so I'm kind of learning with you and I think another layer of detail we can add is kind of like really really subtle normal mapping so use a noise texture which adds this and then run it through a bump node so we convert it into normal information bring down the det tail so it's kind of hard to tell but this is with and without it kind of just distorts this and I can significantly bring down the string and now kind of the thing to wrap this up is some motion blur and stuff so because we're viewing it this way I want the camera to be significantly closer to the action I don't want this to be top to bottom cuz that looks boring I'm just going to rotate this a little and now let's add some uh depth the field because we're very close to the bubble so I can bring down the f- stop to see what's going on and then play with the distance I think we want it way lower just to kind of tell what's going on I just want the front of this to be kind of in Focus I guess so something like that go to rendered view that seems to be a bit intense so let's multiply that by two add some hexagon blades and that isn't too bad and once I ran this through some compositing that I like so very basic node Network you can see it right here um I think it looks really really good I think the trick is to really like bump up that motion blur don't be shy let's bump it up light it up whatever okay okay so I think this is the final look I am settling on I'm going to make the original blend file available on patreon if you care and that's it hopefully you learned the thing
Info
Channel: CGMatter
Views: 11,493
Rating: undefined out of 5
Keywords: blender bubble, bubble simulation, bubble popping, bubble slow motion, blender geometry nodes, geometry nodes, simulation nodes, tutorial
Id: a-tf9VVXVOY
Channel Id: undefined
Length: 14min 0sec (840 seconds)
Published: Thu May 23 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.