Create Dynamic Water Ripples With Geometry Nodes And This Crazy Trick: Blender 3.6

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody today we're going to be working on this Dynamic water ripple effect which as you can see updates seamlessly as we move any of these objects around we can even move the water plane around and it all just works fairly flawlessly and you can use it for more than just like stylized water you can also move it use it for some crazy like um sci-fi magic effects or something like that let's just go ahead and hop it into it alrighty so what we're going to start off with is activating the node Wrangler add-on because I use it quite extensively and I highly recommend you have it as well all you have to do is go into edit preferences type in node Wrangler all right the first thing we're going to do is go ahead and grab ourselves a plane scale it up a bit apply that scale and now for this effect to work we're going to have to add a little extra geometry so we're just going to divide it subdivide it a couple of times so it's fairly high resolution then we'll go ahead add ourselves a sphere scale it down a little bit we're gonna go ahead and subdivide that as well and we're going to click on the little subdivide in the corner and just turn the smoothness up so it stays circular all right and now for the first thing we're gonna have to do is hop into geometry notes just a tiny bit um you click shift s through F3 and shortcut right on over there click it a couple times there we go we'll click new we'll call this ripples to stay organized and we're not going to worry about the fact it's all caps all right then we'll go ahead and add a mesh proxy proximity just type in proximity geometry proximity node we're going to take our sphere we're going to click shift M we add new collection and we'll call this uh edges click ok and then we're going to drag the edges collection into our geometry notes click relative and then we'll drag this out and plug it right into one of the input sockets then over in the modifiers tab we'll just make sure it's plugged in which it is fantastic all right we'll click take the geometry into Target and then we're going to add a map range node plug the distance into the value and so oh and then we're going to add a realize instances node between the collection info and the geometry proximity then we're going to flip the Min to one the max to zero and that will be important later to reverse the effect and then we're just going to take the two min plug that in as an input we're gonna that's it we're done with our geometry nodes so we're going to go from here over to the Shader editor let's hop into Eevee so we can see what we're doing we'll click on the plane click new and then come on there we go first Simplicity sake we'll just get rid of the Shader for now and then we're going to click oh wait nope I forgot one thing we need to do in the so before we leave here I forgot one thing we're going to go ahead and go to group we're going to click our result we're going to change it from float to a color and that's that's it that's all we need to do in the modifier tab we're going to click on the result we're going to just name it color um and then we're going to go back to the Shader editor in the Shader editor we're gonna get a color attribute we're going to call it color I guess we have to clear it first all right we'll hop down to the little three triangle vertex group button we'll click color attributes we'll add a new one uh color is fine make sure it's a black has the default color and now we will select it in our thing and now if we go to surface we'll see it's created this nice gradient going from the sphere away from it and if we go to our modifier Tab and we can move this around and it will change the size and darkness of the sphere so the next thing we're going to do we're going to click on our attribute we're going to move it we're going to create a value and we're going to type in hashtag frame now what this is going to do is it will just match the frame number of this file so with the click space we can see it cycling up through the frames as it goes higher and it will just do that forever or until the composition ends then we're going to get a math node and we're going to add these two values together we're going to copy our add switch it to divide and this will just allow us to essentially slow this down so if this goes to if we divided by 2 when this gets to 80 this output will be at 40. it'll just essentially make it climb slower we're going to type in like 75. it makes big value to slow down a whole bunch the next thing we're going to do once my computer stops chugging from obs is we're going to add a noise texture and we're going to plug this into the vector of it and now if we click space you can kind of see what the effects doing where we're gonna it creates this radiating outward Circle and that on its own is pretty cool and the possibilities are are pretty enormous but we're going to go ahead and use it for water ripples today to solve this sort of blinking issue here we're going to copy our add node again set it to multiply and then multiply it by the initial color attribute again and I will just say If It Started Black keep it black and that'll completely cut that off and keep it black this is like super solid and we want it to be a little bit more broken up and interesting shaped so we're going to add a mix RGB I don't know why is it showing up there we're going to mix our GB and we're going to plug let's give ourselves a little more room here again we're going to plug our output of our add into one socket and then we're going to click Ctrl t on the noise texture which will give us a mapping and a texture coordinate node we'll switch it to the object input and we'll plug that into the second spot on here and we'll plug this not into scale but into the vector and this will give us more control over how distorted it is so as you can see if we go all the way to this end it's just the circles again and this end it's just still and we're just going to take it off the circles just a little bit so it gets a little detail here while still being nice and circling the next thing we're going to do is we're going to go ahead and add a color ramp so we can actually control this uh this above here let's add a color ramp after the multiply and now we can really pull this in a whole bunch pinch in the side as well and now you can really start to see kind of the the effect we're going for here um let's and now we can also play around with this noise texture to really dial in this effect a little bit so let's start off by taking the detail the roughness and the Distortion all to zero and just that'll that'll make it smoother and make it I don't know if you're doing like stylized water I think that works a little better if you're doing other effects you can turn those up and just play around with it so you find what looks good and now we've got kind of this I think that that's pretty good we'll do a size round 10 for now let's turn this up a tiny or down a tiny bit more that's what's a little more circlally all right and now to actually like mix this with another material what you'll do is you'll use this essentially this output here as a mask for whatever else you want to do so what we'll do for this is we'll just add a mix RGB that into the but then the factor um change the top one to whatever we want our watercolor to be so we'll do like a greenish blue and then the bottom one will just make a white and that is that is literally it for the um the Rippling water um you can obviously add more effects on Top This say if you wanted to do water waves or anything else you could just plug that build that out as complicated as you want to and then plug it into this top socket here for the watercolor um what we'll also do is add the principled um bsdf back in so it's an actual Shader not just glowing and I can see it kind of reflects the light you can use this in roughness to make the ripples less rough and the water more rough you can just plug that straight in to kind of show you what I mean and now you can see the blue is like perfectly reflective and the white is perfectly rough which kind of gives it like the look of bubbles whatever for what we're doing though we'll just leave it as is because it's nice and simple and stylized um for the other stuff I was saying oh before we get it go on let's go over how you add stuff to this sphere how do you make like more stuff for it to reflect and all you have to do for that is just add stuff to this edges collection so we'll go ahead and grab our cells um another we'll say a cube it's in the collection so it's fine uh we can just multiply that out um what we can even do is grab something like a um oops grab something like a photo scan uh we'll just pop into the asset Library grab literally anything as long as it's in the collection and you'll see even even pretty complicated matches are handled fine let's find something that's a little more a little bit rockier like rocks per se and as you can see it kind of still works with all the individual little bits and if you want these ripples to be bigger or smaller you can make them more or less based on this if you want the um ripples themselves like each individual little Ripple do smaller what we can do is we can hop back into the um Shader editor I'm just using shift F3 and F1 to switch between stuff here it's a hotkey and we can either change the scale here which will add some detail to it um we can come on computer you can do it we can change this color up here to either clamp it in clamp it out you can also change the effect if you want to be really sharp like a very standard kind of cartoony effect you can use the constant which will give it this sort of sharper effect and if you wanted to do more larger ripples what we can do is we can actually adjust the texture coordinate that the noise texture is plugged into so we can hop down to the scale here and just if we wanted to say have longer ripples we can switch the scale to an X and Y to 0.5 and 0.5 and as you can see they're even longer now we could even go further we can do 0.1 and 0.1 and now you'll see the almost they're almost complete circles I don't want to go quite that crazy um and you can use that in combination with the um color amp and the uh the to Min to really dial in the effect you want so let's say we want this but a little bit larger we don't want them to be quite so big so we'll really clamp this down but now they're too small there so we can hop back over here and turn this up even more which will make him like really long thin ripples which is like a completely different look from how you do it and you can completely just customize that and tweak it to your heart's content or match whatever effect you're going for let's kind of tweak this back to a more middle of the road kind of effect and now let's touch on how I made those those sort of more magicky effects and how just uh some other stuff ways you can use this um so let's go ahead and in this material instead of just plugging into this switch here we're going to do we're just gonna leave that as fine it doesn't shouldn't actually matter come on you can do it there we go I will take color into Alpha then we'll Click N to pull out the side panel go to options switch to Alpha clip in both Shadow and blend mode and I can see it's just these little little bits poking out in fact let's go ahead and turn this up some so we can see it more and now we can turn the emission to our blue color or literally any other color you want let's go like purple because I think it'll be cool then we can turn the emission strength up and we get this sort of effect and then you can add any other shape like you're not restricted to just doing planes so we can get ourselves a UV sphere we'll add it to we'll just move it somewhere it'll be kind of cool it'll be intersecting with a lot of this geometry here will link the material to the plane and you can see that doesn't done anything else because we need to also link the um modifier so we'll click Ctrl L copy modifiers and it goes completely crazy and then it's because it is inside our edges collection so we'll just pop that up into our normal collection and as you can see it's kind of working uh if we apply scale it'll go a little bit smaller and now something else to note about this is It's reliant on the geometry in the sphere so let's go ahead and into edit mode select just the sphere and we'll subdivide it let's say twice and now you can see this effect I'll follow the edges a lot nicer than it does when it's low poly and we can even do like could even go crazy with the shapes you could even do it on something like a Suzanne we'll see how well this works so we'll control L copy the modifiers copy them materials and then we'll move it to the collection selected fill it up apply scale lint also do some more stuff with our Collision stuff make a new shape we'll duplicate them around some and as you can see even with this this crazy shape it still should work mostly fine I was probably too low poly as well so we'll go ahead and subdivide it a couple times you can get some really really neat effects with this let's also cover how one way to kind of thicken the effect as it were I don't know the exact right term but if you look at it from a steep angle you'll see it kind of disappears and one way that's pretty cool you can kind of Remedy this is to go ahead and add an empty let's do a plain axis on here and then we'll add a array modifier and we'll turn off relative and turn on object offset and let's also make sure it's below the geometry nodes modifier because that will help it be more performant and won't change the effects at all we'll turn it up to like say 10 object we'll select the empty that we just created and then we'll grab this empty and we'll scale it down just a little bit so that means each recursive iteration of this sphere is being scaled slightly smaller and since all of them have the same effect it Stacks them all up and it kind of creates this um thicker effect now it kind of falls apart if you look on it from directly you can see the individual layers and that can partly be remedied by just adding more layers and um scaling this which just a little bit different and it really kind of creates this cool thick effect um that looks pretty neat and it makes it a lot more versatile where you don't if you just pan past it it doesn't look as 2D which could be handy you can also use that for any other material thing it's just a cool trick to know and I think that's pretty much it actually I hope this was helpful if you have any questions go ahead and leave them below oh real quick before I go let's just cover why it's more performant to have the array below it it's simply because if you have it above it then has to query all of that geometry in the geometry node Street whereas if you just have it on the first one it only needs to check on that one sphere which means it's the number of vertices times this number if you have it above because if you have say five vertices and you have two layers it's five times two so you have ten vertices you have to query if you have nine times like a thousand vertices or whatever this is you have to multiply those two numbers together and that's how many vertices it needs to check for the proximity node whereas if you just have it below it only needs to check for the first shell and then it just copies that for all the ones below um I hope that was clear anyway um I hope this was helpful and I will see you all later bye-bye
Info
Channel: Benjamin Weimer
Views: 161,898
Rating: undefined out of 5
Keywords:
Id: uOXagWeOAv4
Channel Id: undefined
Length: 16min 18sec (978 seconds)
Published: Sat Mar 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.