Creating Beautiful Water Caustics in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so while I was making this render I think I figured out a really nice way to make these fake cosics in combination with this water and and have it animated and actually look good in motion um it's it's an idea I've had for a while but I haven't really figured out a way to implement until now when I started this render so I'll show you exactly how I set it up in this video it doesn't add really any extra render time it's very easy to use um and it's sometimes situational but when it works I think it looks great so I'll show you exactly how to set it up here but basic idea is you take an area light and that emits uh a picture of cos stics down onto the whole underwater area and then you use some noise to distort that I'll show you exactly how to do it okay so I think it's going to be easiest to show this in this new demo test file so I've just got a basic uh U like structure like this with a brick texture on it uh basically just a plane with extrusions and insets on it and uh what I want to do is just add this water and costic effect in here this little domain just so that you can really clearly see what it's doing and then I'll I'll move it back into the other environment after okay so let me add a cube and this will be the water first of all and what I want to start with the water and then I'll add in all the lighting and costic effects after okay so I'm going to add a new material on this and then this is going to be uh the probably the basic water shading setup that you've already seen so roughness zero transmission up to one and then we just take a bump node and a noise texture and then run the noise uh through that to make it appear wavy so noise texture into the height of the bump this into the normal input of the principled and then that'll give you that just increase the scale to whatever and then let's decrease the strength and distance down a little bit just to make uh some something a bit more like that okay so to get light to pass through this a bit easier there's a node you can add called a light path node if you just drop that in here and then run the is camera array run that into the alpha of this plane um I'm not sure exactly how that works uh but if you want to look up this node and figure it out you can do that but basically when you do this it just lets light pass through the water much more easily and just gives you a much cleaner water Shader setup so you can stop there if you just need something really basic but I want to show you all the cool stuff you can do with uh adding these costic or I guess fake costic effects in here okay so I'm going to add a area light for this uh and I'll just drop it I'll just scale it up to match the kind of area that our water is going to be placed in and I'll just put it right below the surface of the water and I'll just actually maybe I'll keep it a little bit above for now I'll move it thereafter but that'll be a good spot right there let me just move this water up actually a little bit higher and then I'll just maybe drop it right just right there yeah that'll be fine okay first of all on the water I'm I actually want to set the I I which is the index of refraction to a little bit lower so I'm going to set it to 1.33 uh that's not really going to make a big difference but if you want it to be as real as possible if you set it to 1.33 that's the the actual refractive index of water so you can do that if you want um okay so then on the on the area light I just added I'm going to hit this button over here I'm going to hit use nodes I'm going to click that and that actually lets us use the Shader editor for this light um I'll just bring it up so you can see it there so basically the idea is to take an image of real water cos sticks I don't know if you actually call that in real life but real water cost sticks and use that to drive what gets emitted from this light and just kind of fake the effect that way so let me show you how this is going to work let me add an image in here image texture I'm just going to hit open and then I'll just uh find an image of actual CS so I'll leave one that you can download here this is just a picture of the bottom of a swimming pool uh just taking from directly above it so I'll just take that drop it into that uh where where I'm opening the image so you can download the image that I'm using here from the description you can also use mid journey I was messing around with this before making a bunch of these with AI so that's another option and then also on unsplash and stock photo websites it's pretty easy to find if you just search for like swimming pool or something like that it's pretty easy to find things like this which will probably work as well so the image is in there uh and then I'll run that image into the color of the emission now I want to turn up the strength of this light so I'll do like 10,000 um and you can see kind of where this is going it's not quite showing up yet but you can see where this is going so I'm going to just turn the beam shape down here underneath there the spread of the area light I want to actually turn that down to zero so that just means it's going to be emitting light straight down if that's up up at the default it's going to be um emitting light in all directions but as soon as you bring it down to zero it's just straight beams of light directly out of that area light and it'll just give you an image straight down of whatever is emitting from there so when you plug an image in there it'll be whatever that image is right if I put um some random other picture in here of of my my own render or whatever it's going to be that image projected from that area light which is actually quite cool anyways let me leave that water costic image in there so so that's the basic idea right there and what I want to do is take a curves here I'll drop that in here lower the uh brightness of this and just kind of drop that down a little bit I also want to desaturate this cuz I don't really like how green it is so I'll just drop a few saturation just desaturate it something like there maybe let's lower the strength a bit to 5,000 uh you don't want to go crazy with this effect it it should be probably more subtle than this but I just want to show you a bit more extreme so you can see what it's doing so to animate this now what you want to do is hit contrl t on here go over to the location and you're going to be basically moving this along the Y location uh so I'll just hit I over this to insert a key frame move forward in the timeline some amount just move this in the direction and then insert another key frame so that'll give us two key frames there and you can see it's just going in that direction and then it'll stop at some point so you can either you can either key frame the beginning and then the end and just leave it like that or you could just do it at any two points and then select those two points press shift e and then hit linear extrapolation that'll just make a straight line coming out of either end of that and just extrapolate it like that so you can now just kind of move this around a lot more easily so that's what I like doing that's what I learned from Ian Hubert but uh you could just insert a key from it at the beginning move it insert a key from at the end if you want to okay so that's going to be moving that way now it's a bit static right now so even though uh there's some ripples on the actual water that are causing it to distort a little bit it's pretty obvious that it's just a still image being moved so to offset that and make it feel a bit more like uh one thing you can do is mix in noise into the vector input of this image the way you do that is just add noise here if you just add a noise texture take a mix node and then switch it over from float to vector and just drop that in here and I'll run noise into slot B and then if I uh start mixing this in just a little bit not not a lot but just a little bit um you can see kind of how that's affecting it if I just hide the actual water take a look at this um that's what that's doing so if you crank this really really high it's going to just completely distort the image underneath it um you can kind of see this a little bit better I just have this random image demo thing over here where if you uh the more you mix in noise into the vector input of your image the more it's going to just be all distorted like this with noise but if you just do it a little bit like mix it in just a little bit you can get any image to be rippled okay so I'll hide that let's just come back here and then let's just mix this in not too much but just a little bit so I'll just bring this in just enough so that it starts distorting the image a little bit but not too much and then if we want we can also animate the noise uh or or switch this over to 4D and then animate the W uh just to make sure it's not following there's like there's not like a static noise pattern in there I'm not sure if there is but I don't I just want to make sure there isn't so insert a key frame there move this just a little bit insert another key frame shift e linear extrapolation and we can adjust the speed of that too I think I'll just keep it around there I think the whole thing needs to be moving a little bit faster as well so I'll just go to the other mapping node and just increase the speed of that to like right there and then let's animate the water as well so that that's moving so um on the noise texture that's running into that actual cube of water what you want to do is just contrl T I should probably use the object coordinates as well I'll just drop the scale down a little bit to match that and then what I want to do is again insert a key frame on the direction I want to go in so this in this case the Y AIS insert a key frame move forward and then just kind of move that forward a bit try and match the speed of those two things I'll hit shift e linear extrapolation to extend that line out on either direction there and then basically it might take a few tries but you want to try and match the speed of this noise to the speed of the uh acostic image underneath obviously so that that looks like it's all matched up one last thing is don't forget to animate the W of the actual water noise so what I mean is if you don't do this it'll just be like a static one noise pattern moving but if you animate if you actually switch this from 3D over to 4D and then the W now gives you kind of this seed value if you animate it slowly it'll just kind of add extra Ripples and stuff in there so what you want to do is just insert a key frame move forward move this just a little bit and then insert another key frame and then just take those two points shift e linear extrapolation or just move the key frames to the start and end point of the animation it doesn't matter as long as the line covers the whole uh timeline or the whole uh time time of your animation and now you're going to have I'll just adjust this slope a little bit just bring that up let's just make this a bit more extreme so you can really see this right so if I go too high with it it's going to look bad but if you find a sweet spot where it's just moving enough to where it looks a little bit more like water that's going to be a good amount to stop right there so there you go um now I will say there are some limitations here one thing you can see is if you look on the very edges of these steps there's no light hitting those edges so if you have perfectly straight edges that aren't coming in like this as soon as they're coming in a little bit then you'll start to see it but on perfectly straight edges um or perfectly upright edges rather you're not going to see this effect and that's where you might want to use some additional spotlights and stuff so I'll just show you really quick if you take this uh this light here just duplicate it switch it over to spot and then just kind of manually place a few of these if you just turn off the blend turn down uh the amount um so I'll just do like 500 that can kind of help supplement some of these areas I think there's a glitch with the spotlights right now where it's uh if you put it in a certain in certain locations it kind of I don't know makes it darker for some reason that doesn't always happen but um I'll just increase that to kind of counteract that so on that main light if you turn off multiple importance I don't actually know really what that setting does but if you turn that off and then uh that that will actually fix that weird little glitch of it being there for some reason there's a shadow in the other light I don't know why that happens but if you turn it off that should fix it um and then if you just have these other lights in here that just supplement this a little bit also I'll just set this up to 1,000 just so that there's enough little costic kind of happening on the wall there you can see if I turn that off it's just kind of pitch uh like nothingness on there um this one's sloped cuz I did it as a demo but um yeah normally you won't get any anything on there so if you just use one of these spotlights to fill in those problem areas that can be really nice way to make it feel a little bit more real and then the easier thing to do which looks a little bit nicer is just take any steep slopes uh any vertical slopes and just move them inwards so just kind of take this move it in so that you get some of those cosics showing up there um that's probably the easiest thing to do and then that'll look the most realistic if you can't do that cuz your scene doesn't allow it or you just don't want to mess up the design you made then um using the the spotlights on their own or little Point lights with that uh same settings same CTIC emitting settings uh that can be a really nice way to do it as well and then the other limitations of this are that if you have light coming from a really harsh angle like this um it just won't really make any sense because there's going to be shadows in here and you're not really it's not it's not going to be realistic to have cosics coming in from where there's no light hitting because it's a shadow so that's not great um but most of the time you probably won't notice it in a render um just be aware that it the realism does really break if you have uh these certain situations and then another thing you can do on the water is just go back and add in some volume so I'll just add a uh principled volume plug that into the volume socket I'll just decrease the density and then that's going to be there if you make it too high going to start to see all those uh all the light from that area light which actually looks kind of cool doesn't really look realistic though so I'll take that down just before you can start to see that and then uh we can actually use an volume absorption as well if we want to make it darker at the bottom so I'll just mix those together and then we're getting some absorption some uh some volume scatter as well so of course when you use this in an actual environment it's going to look a lot nicer than in a demo test scene so here's exactly what I've done here same setup and everything I've added some additional things on top like some lily pads so these are just from quickel Mega scans and then just using geometry nodes to do a basic scatter of those on over top of the surface and you can see we've got the same setup here so there's that same area light if I take that out it's all almost gone I've got those spotlights over here which are counteracting some of those problem areas which are not receiving enough of those cosics and I've also got some point lights over here which are doing uh all the all the stuff you can see on the side here the side of the animation all the reflections of the COS stics it's hard to see cuz the scene is really noisy right now but in the animation I'll just overlay it you can see kind of reflective looking quote unquote reflective costic because it's all fake um that is just a point light with the same exact setup as I showed with the area light as before same image being emitted um the only difference I think on the point light you have to switch it to normal coordinates so on the uh on the point light going into the image just make sure you're using the normal coordinates instead of the UV coordinates which you use for the area light so the normal coordinates go in there and then same same animation same everything when you place it above the surface of the water that's when you'll get uh this kind of effect where it's it's a really strange thing to look at sometimes where it's uh kind of this weird little sphere that's just emitting all this crazy light um you can see that there but that's the effect right so just as a side note too pretty much almost all the models except for the floor is uh and the trees all the walls and pillars and arches and statues all that stuff is from the new fantasy environments course if you want to use these and check that out I'll just leave a link below um but yeah I've been using that a lot in my work anyways that's it for this video thanks for watching I hope it was useful hopefully now you can make some crazy water scenes and uh yeah see you in the next one
Info
Channel: Max Hay
Views: 29,072
Rating: undefined out of 5
Keywords:
Id: e---RCWAVP4
Channel Id: undefined
Length: 16min 33sec (993 seconds)
Published: Sat Jun 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.