Blender Tutorial: Photorealistic Puddles

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
anyone could make a lazy puddle using a noise texture but if you want to make a photorealistic puddle Shader that matches the three states of dry wet and pooled water then this is the video for you by the end of this tutorial you'll have made your very own handy easy to use node group that will add realistic puddles to any material you want in the future so let's go so to kick things off I've got a plane which I have enlarged to be 20 by 20 meters so it's nice and big and now we need a texture set doesn't matter which texture set it'll really work on anything provided you have a base color roughness normal map and displacement map those four Maps is all you'll need so I'm going to be using the polygon add-on which I'll put a link for it in the description but basically it lets you browse download and automatically import any material that you want so the one I'm looking for is this one right here just this kind of like yellow cobblestony looking paver quite common in I don't know a lot of parts of the world I've seen it but I'll also throw up on the screen here some different other materials which you might want to use and I'll put the links for those in the description as well so if I go to my material preview I should see the look at that we've got the Cobblestone applied to everything great so now the real work inside of our shading tab yeah we're going to get complex with some nodes now first of all the add-on has added in our texture set for us but it does look complex really all it's done is it's put everything inside of this node group so that we can just easily change a few handy values if we want them but really all you need to know is it's just got you know the usual texture maps and it's coming out of you know base color Alpha normal all that kind of stuff now we don't need most of this because most of it isn't relevant to this material so I'm going to disconnect all the stuff except base color roughness and normal map right we will use height later on but for now just these three to play with so that's our material okay looking Bland but it does work so anyone who knows their way around a Shader will know that if you want to make something look wet you really just drop the roughness amount the roughness is your the sharpness of the reflection and so the sharper the reflection the wetter it tends to look and the higher the roughness amount obviously the opposite it looks more dull and more matte and bone dry right so a zero to a one is the difference between a puddle and a non-puddle right so those who know what they're doing will think aha I know of a procedural texture which will generate zeros and ones across a surface and that is your noise texture so if you add in this and you put this into your roughness input here you will see this okay so to just quickly preview just that by itself it's blacks to whites right as a sort of General Randomness across the surface which when you put into roughness you can see see it gets you this effect which is kind of there like we've got a puddle sort of look effect but it's very vague and that's because it needs more contrast but more importantly we have lost our roughness input from our texture set so we don't want to override it we don't want to just like completely remove the information from that we want to use this noise texture as a mask for the roughness map that our texture set already has if that makes sense so essentially I'm going to put this up here and then in here I'm going to add in color mix color and I'm going to drop this in right here and now with this uh noise texture I'm going to put that into my Factor input here and then my roughness I'm going to put into my a slot so with this what this is doing is the white values is it's going to be using now because it's in the factor it's going to be using whatever's in a and then the B is going to be whatever is the black values so for that because roughness right we're thinking of like a puddle right a puddle is uh sharp it's going to have like wet looking Reflections where it is a black value that was a terrible way of explaining that but essentially wherever I want there to be a puddle I want the roughness to be zero which means I want my Alpha to be black like so and there we go so now I've got basically the same effect but I have retained all that roughness information which was in the roughness map okay so now let's add some contrast because this looks very vague it looks like it's just been sprayed with a mist or something so to add in contrast I mean you've got like a brightness and contrast node which I don't think I've ever used because it's just so bad and you can't understand what it's doing a lot of people like to use the color ramp node right you would drop this in here and then you could like uh you know adjust these values and yes that is helpful but it's also like it's very visual but you also don't really know what it's doing with the values necessarily and it also has sliders which aren't helpful if you want to be able to easily adjust something later in my opinion the much better one is the map range node which does exactly what a color ramp node does but it does it with values that you can change by um by a slider basically it makes it a lot more friendlier for a node setup which we'll get to later on now with this this maximum amount here is basically now going to become my wetness value if I set this all the way anything below zero that's the original like roughness right it's just using 100 the original texture and then as I increase this it's generally adding in sorry genuinely gradually it's gradually adding in a wet amount to it so this is just a really nice easy way to just quickly add puddles to something and we're going to use this map range into everything that we use for the rest of this Shader so it's all going to be nice and uh procedural and we're going to know what we're doing all right so it's looking okay but it kind of has this feeling like it's not like puddles are forming it looks like someone's just hosed it very recently with water and the reason for that is the bump if we look at reference photos of Puddles not surprisingly where there is a puddle where the water has formed so much that it has pooled you're not able to see the texture of the road or the the Cobblestone underneath it you are able to see obviously the the texture around it but where there is a puddle it's water so it is glass it is completely flat right so what's causing the bump what's giving us the bump is this normal right here so if I was to just like remove that then yes it does look more like a puddle right here but it doesn't look good because we've lost all of the bump information which is giving us so much character to the original material so we do need that bump information so essentially what I want to do is just like what I've done here creating using a mask to keep my original map value but uh tweak it I'm going to do the same thing down here so I'm going to duplicate my mix color node here shift d drag that down down and then making sure my normal goes into my a input I'm then going to take my map range output and then put that into the factor input okay now we can see something is happening but probably not what we want we've got the bump everywhere else which is what we want nice and untouched but where we have got our puddle where the puddle should be forming we've got an error and the reason for that is that this input for our printable Shader is a very special input that purple one means it's looking for Vector data so Vector data is an RG and a b which has been converted into an x y and a z very technical I know but that information is what it is looking for and the black color this one here which is where it's going to put anything that is a white value right this this white part of our Cloud noise texture is being turned into black and it doesn't it doesn't know what to do with that so essentially instead of a black color we need to use a color that the vector vector part of the the Shader can understand and that color is blue a hundred percent blue no red no green and when you do that it says Yep this surface is pointing directly upwards it's flat and it now works correctly everywhere we've still got the bump everywhere else but wherever there's a puddle it's now working correctly now if this is not working for you if you've got something that looks really weird like I don't know like something like this where it kind of looks like screwed up in some way it's probably because you haven't got Vector information going into your mix node you've instead got color information so what you're not seeing inside of this node group here what the polygon add-on did is it added in a normal map then it put it into the normal map here which then gives it this uh you see this blue output right sorry blue or purple purple then it goes into here if you had your normal map here the normal map node it would not work correctly so make sure that this goes after your normal map node wherever that is um not before it otherwise it won't work correctly so you can proud if you've made it this far because you've got something that looks pretty close to puddles and certainly a lot further than anyone else has made it and you've got a very nice system that works with just one single slider which is great but we can do better it is missing one critical component of Puddles that is why this doesn't look quite right and that reason is it's all explained by this slide right the difference between a surface that is dry and a surface that is wet is a difference in the color value right it is noticeably dark darker when something is wet and you can see this on every surface right so really a puddle is kind of like three stages you've got the dry you've got the lightly wet and then you've got the pooling right and right now all we've got is just almost like everything is completely wet and we've got pooling and that's it but we need this Stark difference now what is actually causing that by the way if you were curious is that even though it's not a pool right there is a thin coating over this patch of concrete here so inside the grooves of that there's a little bit of water and it means that when the light enters that surface instead of bouncing into it getting the color information and then exiting out into your eye some of it is actually bouncing inside of this little miniature like layer of water and then it's bouncing back into itself so because that happens enough some of that light goes back into it and then it appears darker to your eye and that is why everywhere where there is uh yeah basically like that's why you have that like part of the stone is dark and part of it is light so how do we do that well we're going to use our basically the exact same method that we've used for these two so I'm going to take my uh mix roughness here I'm going to duplicate it and I'm going to drag it up here just so that lines up with this and this is connected it for me exactly the way I want it my base color I want to go in here and I'm going to take my map range and I'm going to put that into here so essentially I am now tweaking my uh my yellow Cobblestone it's going into here and then this value here is going to be wherever there is a puddle so it's currently black which is why it looks like someone has spilled oil all over the surface so I don't want it to be completely black I want it to be somewhere in the middle right so if I was to adjust my value here I would want something like this but this isn't right so the reason it's not right is this is set to mix so instead I want to make it multiply so that it ignores all of the white the light values and just use the dark values from this so this now basically becomes you know how dark do I want the wet part of my Surface right so we can just leave it somewhere here for now and this looks somewhat better like you look at it's like yeah it's kind of right like okay now when it's completely dry it's light and then when it gets darker it is dark but something's still not right about it right kind of in a big way and the reason for that is going back to our reference because reference is King reference reference reference I'm gonna sell that shirt one day um it's it's binary right it you can see there's no gradient here it's not like it's getting darker towards the middle there it is either bone dry or it is dark because it is wet okay and you sometimes see where it looks like darker in the middle of a puddle that's usually where like sediment is pulled and that's a completely different thing where it's like muddy but in most cases no like it's just it's either completely wet or it is completely dry and that's it so what we need to do is between here and here we need to add something to basically do like a hard cut a binary cut you could actually create a separate map range node but since we're not going to be tweaking this value it's actually easier to use the more visual version of this I mentioned before the color ramp node so if I drag this in here again making sure it's going between our map range just into here not affecting these down here this as you can uh you know as you probably know you can tweak this and you can adjust which parts of it will affect where we want it to be binary so the trick is to change it from the linear blend type to instead be a uh constant is it a blend type and maybe it's just inter interpolation but you can see that now we've got we've got exactly that it's either wet or it is dry it is nowhere in between and that is pretty much what we want but it looks terrible it looks really really bad okay so why is that it's got the correct effect but it looks terrible if we go back to our reference here you will see that yes you've got you know parts of the brick here which are black and then parts that are white but it's not a completely clear like line right this looks like it was drawn with like I don't know like cut out of paper like Clipper Vector art or something completely clear line that's not the way it works in the real world because real bricks and Cobblestone and asphalt as well if you were just using like it for like a car park texture or something right the line is Jagged and it changes depending on the height of the material that is underneath it so these bricks are higher than the grout so the grout is where you're getting this pooling effect and the the bricks that are individually lower than the others those are darker because that's where water like it hasn't dried from that section yet and then you've got some bricks which are like higher than others so they're like sticking out of it and they're high and dry right so that information is very relevant we need that information on here so we need this this texture to somehow week to somehow tweak this right so between actually between the map range and in here we need to use part of our texture okay so this is why I said that the texture set that you you need you need to have a base color roughness normal which we've used and height information which is what I've got coming out of this material so if you're using materials from elsewhere it would just be your displacement node which is just basically black and white information which by the way the polygon addon will automatically by default it'll set your dis displacement strength to zero so if you want to see it you just turn it to one and now you've got this information here so we need to use this information because this has got the information of the grout is like a lot like it's dark because it is low a lower height and then you've got some brick which is lighter than others which means it's higher than other brick so now we know what information we need to use we know where to put it how do we make one influence the other and this is the trick something that you learn if you watched my abandoned house tutorial whichever direction it is up there I talked about how you can Infuse two values together so the way that you do it is by adding in a mix color node so basically same one as there right adding this in and I'm going to take my height and I'm going to put this into my bottom input down here so my noise texture this is before it goes into the map range because I want to use just like the gray values and I'll tell you why in a sec before it goes and gets like contrasted so my grayish looking values here my grayish looking values here and it's going to go in here and the trick to get them to influence each other is to use not the mix blend type but the overlay blend type now in my uh my old like abandoned house tutorial I mentioned like colorburn was the one I think maybe I didn't understand the math correctly and I thought like ah it just looks punchier and it looks nice I think actually the correct one is overlay it's more standard I don't actually know how they change that might actually probably like a fun quiz for like for like artists out there like what is the difference between multiply and subtract what is the difference between screen and add and like see how many can get it correct I bet you like 99.99 could tell the difference between overlay and color burn I again like nobody knows I know there's a difference but anyways point is with this if I now go back to here you can see that it's now correctly working right and this value here is now tweaking how much influence this is so cool this Factor amount becomes our influence value of how it is how much it is influencing um that that that blend between the noise texture and the brick which is so cool now the more astutive you might notice um that's wrong Andrew it's seemingly doing the opposite where the grout is it's making it look dry and where uh the bricks are it's making it look wet so basically this value here needs to be inverted between uh the height and the b um now normally I would use like an invert but actually I need to do another operation on it as well so I'm going to use a map range node and I'm going to drop this in here and just to invert this I'm setting my Min to 1 and my Max to zero and now it is working correctly and look at that so those lines now become darker right which is so cool just automatically looks correct this is how you get realistic materials you study reference really really hard trying to fix everything until it looks right and then it eventually does and you go aha so it's now working correctly now if you're not using polygon textures you don't need to worry about this next part but uh something that we have uh just realized we tried to standardize it to work across shaders and it meant that our displacement values had to be between 0.4 and 0.6 in range which is why this looks very uh gray looking not a lot of contrast there we are actually going to be remastering it later this year all of our textures but basically it means because of that we've got a lot of gray rounds gray range that could be normalized and this map range will do it just means basically you're going to set from 0.4 which is when the detail actually starts 2.6 and it will mean it'll go from that to this and it will actually then look correct and it means that your influence it just means you'll have more range here to play with essentially so now that this looks correct you can see the whole picture changes it looks way way different um it looks just so much more realistic because this is what Cobblestone does right it's not like everything is just coated in water right you have like bricks individual bricks this like like Lego pattern across everything which is really cool and you can see that as I change this it's almost like a really cool transition right of like water buildup across the surface okay it's really really cool um and you'll see a similar effect when you're using it on like a different texture an asphalt or something um it's just this is a cobblestone it's more noticeable but you will have the effect of the height influence the height information influencing where the puddle actually begins and ends a couple of quick things to uh improve this so first of all if you were just trying to go for like you know everything needs to be like relatively wet like a wet car park or something you might not like these dry patches which case you would just adjust this slider here until you like don't see them or you only see like a few or something but this is generally where if you want I don't know it's like it's getting drier right or like the the effect like the spread really of that that wet mask is kind of uh yeah just being changed um the other thing is that uh this the scale of this will obviously change the size of your puddles and how often they appear you can also change to 4D mode and it'll just add this W value at the top and the only difference there is that this is now C so if you don't happen to like the particular Arrangement that you've got you could change the seed and try and get a different amount of Puddles the other thing that you might want to do is to because I noticed looking at reference that like puddles rarely actually form a uniformly like even in a car park or something flat like there's generally parts of the car park where it's like lower so you'll have like a lot of Puddles there and then less elsewhere so I kind of wanted to like paint I want the ability to paint in so you could add in like an image texture and paint this way I actually prefer to use vertex paint so the way I would do that is just hold down control and tab move up to vertex paint and when you do that it will have automatically added over here in your color attributes you've got a Vertex paint attribute called cull c-o-l great name which just means if you go shift a import attributes you should see one here that says coal and then I can blend the two of these together so I'm going to take my mix color right in here I'll make this like my oh God it's all screwing up I'll make okay first of all let's do the painting on this so first of all you need everything to be black so hit X until the black value is at the at the front there on the left then hit shift K it's weird because you can't see anything that's happening but you just have to assume yep now it's working shift K everything is black it's filled and now with my white brush so white is on the left so hit X to swap I could paint now I can't paint because I've only got four vertices so this is vertex paint so you need more vertices so that's the downside of this method is that you do actually need vertices but the upside is is that you don't have to worry about UV mapping and like image texturing and then if you change your mesh you have to like redo all of your your painting or whatever like I just hate working with blender's texture painter but this is a lot easier so now with this I can just paint in using you know my brush of wherever it is that I want my puddles to appear right go back into object mode this now is going to go into here so this is my top this is now going to go into my bottom like this and then this value here I want to be set to multiply so it's basically all the way to the left is using just the mask by itself and then as I gradually increase multiply it's adding in this noise texture because while you could use just the uh the painted map that you did by yourself I find that without it it just looks oh God I hate the EV thing but it just looks like really like it just looks just looks nasty it looks like it's just been painted right because it has been painted so this just adds in a little bit of variation and it just helps it look um a lot nicer you can also use like a lower strength amount so that you can just like more subtly paint in certain areas and then you can get something that feels a little bit more realistic to like yeah this is like the low part of the Town Square where you know the contractor who built it was a little dodgy and he didn't level the surface and so you've got like a buildup of a buildup of Puddles right but it's it's more realistic right because that's how puddles appear they generally appear in like one place it's not generally over everything uniformly and that's basically it if I want to make this like a nice user-friendly tool that I will want to use again and again I'm going to hit Ctrl G and now I've got a node group here right where I've got all going into one it's all coming out correctly and the most important thing is I would go in here with this map range and I would take this drag this out over here and then where it's got the group name I would call this wetness right and I just reorder these just so that I'm easy to understand uh wetness is the key value right that's the one where I'm getting most of the control of um of how my puddles are going to look and it's just one slider it's nice and easy it's artist friendly it's very easy to adjust I mean if you wanted to you could also throw in like you know how much of the color in sorry the noise influence you could drag that in there you could also I don't know have like the seed value from your clouds or your puddles if you wanted to it's really up to you however user friendly you want to make it and I'd probably also relabel this color roughness and normal as well but then I've got a little puddle group and I can add that to my future shaders and it's easy to use and it's it's really fun if you want to download the finished node group I've put a link in the description so you can get that along with some links to several other photo scanned like concretes and asphalts and things that work really great with this Shader and yeah if you enjoyed this video hit like And subscribe so that other people can find it and thank you for watching I'll see you in another video
Info
Channel: Blender Guru
Views: 192,854
Rating: undefined out of 5
Keywords: blender, tutorial, andrew price, blender guru, blender tutorial, blender puddle tutorial, how to, 3d puddle, photorealism
Id: TxYVMw94FXE
Channel Id: undefined
Length: 26min 26sec (1586 seconds)
Published: Thu Mar 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.