How to Add AMBIENT OCCLUSION in Blender! (Ambient Occlusion Node Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so one of the problems you can run into when trying to render objects in blender is that sometimes your objects look like they're floating on different surfaces meaning that the way that they're sitting on surfaces just doesn't look very realistic we're going to check out a node inside a blender that can make these intersections between objects look a lot more realistic let's go ahead and just jump into it alright so if you look at the way this cube is sitting on this ground plane right now one thing you might notice is while the shadow looks fairly realistic meaning that the light is casting a shadow on the backside if you look at the front side of this object and the way it's facing on the ground it just kind of looks like it's floating here right so basically it looks like it's set on the ground but this intersection just doesn't look very realistic it's just kind of a straight line right here so the reason for this is if you look at buildings like this in the real world notice how there's just this kind of like where the building meets the ground there's usually like dust and dirt and grime and other things that kind of build up in here that's what make these objects look realistic right like the wind blows and things like build up around the edges of your objects right here so you can see how it looks a lot rougher in here in this image however we jump back and look at this this is just completely smooth right and so one of the things we can do with this is we can use a node called the ambient occlusion node in order to add kind of a grimy look in here or at least kind of a shadow where these two objects meet so the ambient occlusion node is a node that basically computes the distance between different objects inside a blender and it basically adds weathering effects or a darker color to those intersections so what we want to do in this situation is we want to go ahead and set up our shader so that it has ambient occlusion inside a blender so let's go ahead and jump over into the shader tab right here and what we want to do is we want to take this object and we want to add some ambient occlusion to it and so what we can do is we're going to go ahead and we're going to do a shift a and we're going to add an ambient occlusion node right here and so at the moment let's say that we were to take the ambient occlusion out of that node and drag it into this box right here and so i'm going to go ahead and unplug my principal bsdf shader for a second and what i want to do is i want to go over into my eevee rendering settings i want to make sure that i've checked the box for ambient occlusion and so notice how as soon as i check the box for ambient occlusion with um with this node plugged in here i start getting this little shaded value right here one thing to note about this is let's say i was to tab into edit mode split this object up real quick so i'm just going to take this face and extrude it and then tab back into edit mode notice how i'm or tab back into object mode notice how i'm also getting ambient occlusion at this intersection right here and so we can adjust this so the ambient occlusion value goes further away from the intersection but notice how you can't really see this very well so what i'm going to do so that we can see this a little bit better is i'm going to use a color ramp node to intensify the value i'm just going to do a shift a i'm going to add a color ramp node right here we'll go ahead and plug this in so what that's going to allow us to do is that's going to allow us to plug our ambient occlusion into our factor but then we can take the color ramp values and play with them so you get a more pronounced effect so notice how you can affect how hard this falls off as well as how dark the darks are by adjusting this value right here so between using the color ramp node and using the distance function you can significantly affect the way that this shows up inside your rendering right here and notice how if i was to move this up now i'm only getting the ambient occlusion right here that's because this is measuring the distance between my objects and applying that ambient occlusion value based on that distance so notice how if i move this down i do get that ambient occlusion that's in here like this all right so now though let's take a look at how we can use this in order to affect our values in here because right now what we've done right is we've basically just broken our shader and just plugged our ambient occlusion directly into the surface however notice how when i put this brick material in here so if i drag this back in my surface like this we're no longer going to get that result that we wanted anymore i'm going to drag my displacement back in here so the ambient occlusion is no longer doing anything all right so what we're going to do is we want to mix these two things together right because we want a darker material along the edges and then a lighter material everywhere else so the way that we can do that is we can do a shift and we can add a mix shader right here so i'm just going to drag that down here first thing i want to do is i want to drag the bsdf from my brick shader in here and then i want to drag this into my surface so right now nothing has changed right so i can adjust this so i either have like a complete dark because i don't have anything plugged into this first shader or i can drag it all the way to the right and it's just a brick material all right so now what we want to do is we want to take the color from our ambient occlusion node we want to drag that into our factor and so what that's going to do is notice how that gives us this dark material right here wherever the ambient occlusion is being calculated and then you can come in here and you can adjust things like the distance to set like how far up or down that's going to go as well as adjusting the color ramp node in order to set kind of where that's going to go and the contrast between the two like this so you can use this in order to quickly add that occlusion in here and so one thing i don't like about this is it's not necessarily giving me a ton of control over the color that's being applied in here well what you could do instead of messing around with this which is going to affect more like where the effect happens you could also add like a diffuse bsdf so if i was to add a diffuse right here and plug that into my mix shader so now i've got my factor i've got my shader and then i've got my other shader well what you can do is you can adjust the colors in here so i could like darken this down i could also kind of like make it align with my brick material um so i could actually use the color picker in order to do that i could pick a brick material in here and just kind of like play around with it but you can use that in order to more customize where this occurs all right so then the other thing you can do is you could actually use this in order to start combining um different materials together so let's say for example that we had like this metal material right here so nothing special about it but what i want to do is i want to add an ambient occlusion node right here i'm going to add a color ramp node right here so i can control the strength of the effect that's created then i'm going to create a mix shader so i'm going to add a mix shader right here and we want our metal material to be on the bottom notice how right now right if we drag this we're going to get either our metal material or nothing at the moment but we're going to drag our mix shader or our color ramp into our mix shader right here that's going to give us our ambient occlusion so notice how we can kind of adjust that right here but here we want to add another material so in this case i'm just going to add a principle bsdf and i have a rusty metal material that i'm going to set up so i just did a ctrl shift t with node wrangler in order to set that up set that up but then i'm going to drag my bsdf out of that rusty metal material into my shader right here and so notice how what that's going to do is that's going to give me that rusty material around the edges here and so there's some things i need to adjust first off that material is driven by the color that i give it so notice i can drag this in order to give it kind of a redder and oranger color right here but then notice how if i adjust things like my distance that material is starting to show up only around my edges so you can use this in order to apply like rust and wear and other things like that around edges where your objects kind of intersect together like this so and we can adjust the strength of that by using our color ramp right here so notice how if i really crank that up things start getting weird but you can use that color ramp in order to control the way that the transition between those different objects happens so you can also adjust that size of that right here and so one last thing you might consider is notice how we're getting the ambient occlusion on like our brick surface for example right here but we're not really getting anything on the ground right the ground looks really clean so what you might think about doing is you might think about also going into your shader editor and adding an ambient occlusion to your actual ground plane as well just to get that little extra shadow in here and that's not really hard to do you just do the same thing we just add that ambient occlusion you add your color ramp then you add your mix shader and maybe for this one we'll just add a simple diffuse bsdf just so we can select a color in here but then we can set our color to something dark like a gray or something like that and we can just adjust this so that we get a little bit of a shadow coming out on our edges right here so that way it just looks like there's a little bit of grunge on the ground as well as around our object like this so if you have any questions about this leave a comment down below we can talk more about this node in the future if you guys are interested i will link some other blender material node tutorials on this page as well as always thank you so much for taking the time to watch this and i will catch you in the next video thanks guys
Info
Channel: The CG Essentials
Views: 114,062
Rating: undefined out of 5
Keywords: blender, blender 2.82, blender 2.8, blender modifier tutorials, blender tool tutorial, the blender essentials, the cg essentials, thecgessentials.com, justin geis, justin geis blender, blender 2.9, blender 2.91, blender ambient occlusion, blender ambient occlusion node, blender ambient occlusion rendering
Id: fg3QQIaMIBo
Channel Id: undefined
Length: 9min 27sec (567 seconds)
Published: Wed Apr 06 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.