Blender Tutorial - Physically Based Rendering (PBR) and the Principled Node

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Oh [Music] hey this is Chris plush from CG masters and this is a free lecture from our upcoming course the blender encyclopedia this is an all-in-one type course with more than 50 hours of training for the latest version of blender including tutorials for every single shader node like this comprehensive look into the principal node and the science behind physically based rendering so check the video description for more info in the course and I hope you liked this tutorial in this lecture we'll learn about the principal node which is an all-in-one type node that can be used to create realistic materials in order to understand this node and shader creation better we'll also be going over some of the basics behind PBR or physically based rendering which is simply shading and rendering that's based on accurate physics so we're gonna learn some of the science behind this node so the principal node was first created at Disney focusing on realism simple settings and some artistic freedom they developed the node with these principles in mind and that's why it's called principled for example you'll notice that almost all these settings are in a simple to use 0 to 1 range and this 0 to 1 range gives the material a result that's plausible in reality however you also have the freedom to type in values beyond the realistic 0 to 1 range for example clearcoat only goes up to 1 I can type in 20 for a stronger effect so keep that in mind if you feel the need to stylize your results more all right so let's dive into everything now now it's useful to know how a physically accurate material is actually built so that's how we're gonna start things off and we'll start with non metal materials also called dielectric materials now dielectric materials like marble for example both reflect and refract light some rays reflect right off the surface producing more mirror like reflections which will refer to as specular reflection but some rays transmitted through the material a little and we'll call those Ray's refracted Ray's now these Ray's scatter underneath the surface a little some light gets absorbed but the rest bounces back outside the material in slightly different locations and random directions so these refracted Ray's do not produce mirror like reflections now in blender we recreate this complexity in two layers first we have a diffuse layer which we can see by turning off the specular reflections real quick so this here is the diffuse layer and it simulates refracted Ray's getting scattered or diffused under the surface you'll notice it's blue to which we chose as our base color here remember that some light gets absorbed so in this case this material is absorbing red and green light and only blue light is bouncing back outside the material now on top of this diffuse layer we add on a specular layer so let me increase the specular value back up to 0.5 now this top layer simulates surface reflection and produces more mirror-like reflections and that's actually it and we now have a physically accurate dielectric material now the specular layer is added on top of the diffuse layer realistically using something called for now this is the effect where specular reflections are stronger on the edge of something like a sphere than they are in the middle the angle a light ray hits a surface is called the angle of incidence if a ray hits the surface at a low angle of incidence or more straight on it's more likely to penetrate and refract producing more diffuse reflection and when a light ray hits the surface at a higher angle of incidence or more parallel it's more likely to simply bounce right off the surface producing more specular reflection and that's why there's more specular reflection on the edges of the sphere than in the middle so for now is simply how much light reflects or refracts at any given angle fernell is different for all materials - but we'll get into that in a minute now over here we have a specular slider that can be used to control the fernell effect and as you can see the higher the value the more specular reflection we see especially at lower angles of incidence like at the center of the sphere here where light hits it straight on and now as we lower the value in fact I'll put it really low two point zero three you can see there's less specular reflection in the center of the sphere and lower values the angle of incidence has to be much higher before light is more likely to bounce off and give us more specular reflection which is why the very edges of the sphere still have an almost mirror like reflection now this graphic here shows spheres with different specular values the white represents the amount of specular reflection at each value so you can see the specular slider isn't just a strength slider for reflection which it might seem like at first it actually produces specular reflection based on the type of material and the angle light hits the surface and that all values except zero specular reflection approaches 100% as the angle of incidence approaches 90 degrees or parallel to the surface which is why the rims of all the spheres no matter the specular value are bright white still so which value was right for your material well like I mentioned before Fornell is different for all materials every material has something called an index of refraction or IOR which basically defines how light interacts with it IOR is used in the fernell equations to determine how much light is reflected or refracted at different angles and you can find a huge list of Iowa values for tons of different at pixel and Polycom slash IOR HTML so if you wanted a more physically accurate material instead of just adjusting the specular value manually to whatever looks good you can use a materials IOR value now one problem is that you can't just input the IOR value into the specular field here because like I mentioned all these sliders are in a zero to one range for usability but I our values are mostly over one so they need to be converted and this is the formula used to convert an i/o R value into a specular value now if you wanted to automate the Iowa conversion using nodes you can set up a couple of nodes that I already have here so let me pull these over a little bit so this chain of node starts with a value input node on the left and this value runs through some math nodes that represent the formula I just showed you so now we can input the IOR value here so for example I'll type in one point six three five which is the Iowa for asphalt and then it uses these math nodes to automatically convert it to a zero to one value and then we'll just plug this chain into the specular field right there and now it's using the converted IOR value as our specular value and here's that node setup again if you want to copy it alright now let me delete all of these let's go back to our principle node here and I'll reset this back to point five now the specular option is mainly tailored for dielectric materials transmissive materials like glass use the Iowa value here and we'll go over that later specular can also be used for metals but there are some things to consider with that and we'll go over that in a couple minutes and as a final note the specular field zero to one range represents the most common reflectance range for dielectric materials the most common Iowa value for these materials is somewhere around 1.5 which converts to a specular value of 0.5 and that's why 0.5 is the default value for the specular field because that's where it should be most of the time so a lot of times when creating dielectric materials you won't even have to change this if you're going for realism but of course you can if you just want to tweak the look of something all right so let's move on to specular tint real quick this is purely an artistic addition to the node and not realistic only metallic materials tint reflections in real life but you can use this slider on dielectric to tint their reflection using the base color so you can see the reflections are now more blue so that's what that does and alright that's your basic dielectric material construction layer by layer you have a diffuse base layer and then a specular layer added on top of that using for now now let's go over how a metal material is built metals are actually entirely specular they don't have a diffuse layer like dielectrics do just like with dielectric materials though metal both reflects and refracts light but in the case of metal any light that refracts gets absorbed and does not bounce back out so there is no diffuse reflection so to create a metal material we have this metallic slider right here and this goes from fully diffused at zero to fully specular or metallic at one so now the material is entirely specular and has no diffuse the material is now metal now you can see how the specular reflections are also tinted by the base color colored reflections our property of metals due to how metal interacts with different wavelengths of light or colors in this case so since we're working with a blue metal here let's see how it gets it's blue reflections so we can visualize array of white light as having a red green and blue channel when this light hits the surface of our metal the red and green channels are more likely to refract and get absorbed and the blue channel is more likely to reflect off the surface so this produces a blue reflection in the end and depending on the type of metal it will refract or reflect different colors of light giving it different specular reflection color like gold for example now if we zoom into the edge of the sphere here you'll notice that this specular slider is actually creating a fernell effect this is producing a white reflection on the rim of the sphere instead of a blue reflection and this is actually important because metal has Fornell as well just like with dielectric materials at higher angles of incidence all colors of light are more likely to bounce off the surface instead of getting refracted so on the edges of the sphere we ended up with white reflections instead of colored and this is important even for gray metals too for example if I change the base color here down to 0.4 take a look at the rim of the sphere there as I change the specular value you can see it gets darker at zero and brighter at 1 so the specular value in the case of gray metals will simply produce brighter reflections at higher angles and let me switch that back to blue now that was all a simplified explanation metal is actually really complex when it comes to reflectance and the specular value in this node doesn't really take this complexity into account it's actually more for dielectric materials and I think the formula I showed you earlier is 2 so I'm not sure if that works right for metals especially metals like gold that have an iowa below 1 but you can still use this specular slider for a simpler Fornell effect for metal so for metals I would just adjust the specular value manually until it looks realistic which sometimes could mean really low values or even zero and now some extra notes on the metallic slider this should typically be set to zero for non metals or one for metals but you can adjust this value for different effects like turning this slightly below one to simulate a dusty metal it's also useful if you want to stylize your materials more like increasing it above zero a little for a dielectric material to give it a slightly metallic look also if you're texturing an object where some parts are metal and some are dielectric like a piece of wood with some metal screws in it for example you can plug a black and white metallic map into the metallic input and that will define which parts are which for example if I add in a checker texture and I plug that factor value in as the metallic map you can see that some of these squares are diffused and some are metal the squares that are black have a value of zero so there will be diffuse and the squares that are white have a value of one so they're going to be metal all right so the next value we're gonna go over is roughness down here and this is how physically smooth or physically rough the surface of an object is if a surface is perfectly smooth and has a roughness of zero you're going to get sharp reflections and if it's rough and has a higher roughness value you're gonna get more blurry reflections because the light rays get scattered more when they bounce off the surface doesn't just affect the specular reflection this will affect your diffuse layer as well for example I'll turn the specular layer off so we see in just the diffuse layer and let's zoom in to the area down here might be more noticeable I'll turn roughness down to zero and then watch it closely as I turn roughness up you can see there's definitely a change there and it is subtle but the roughness value affects the base diffuse layer to by scattering the light even more so in general the roughness value just scatters all reflections more all right let me reset specular back to 0.5 so we have our basic dielectric material again now just a quick note on dielectric materials if you have a really rough surface you might be tempted to turn specular all the way down to zero so you just have a diffuse layer a more realistic way to approach this though is to keep specular where it's at and increase the roughness instead since like we learned about dielectric materials they have both a diffuse layer and a specular layer so turning the specular layer off completely wouldn't be realistic and one more note about the roughness value at the very top here we have a menu for distribution which basically defines how the reflection roughness is calculated basically G GX is less physically accurate than multi scattered ggx but it renders faster there's usually not a major difference between the two so the default and G GX is typically fine and you can see more about these distribution models in the glassy node lecture all right now let me switch over to example 2 and we're gonna go over subsurface scattering now subsurface scattering can be used for things like wax and skin where light that enters the material is scattered significantly creating a softening effect and even allowing light to pass straight through the material if it's thin enough now this happens when light penetrates material then the Rays scatter underneath the surface before exiting the material at different locations and in random directions if that sounds familiar to you it's because this is actually the same as the diffuse layer the diffuse layer simulates microscopic scattering though meaning the refractive rays don't travel a significant distance so it won't noticeably spread out the light and instead just produces a very scattered reflection with significant subsurface scattering though refracted rays travel a larger distance through the material before exiting spreading out the light which is why this can have such a strong softening effect on materials and because light travels further in the material in some cases it might travel entirely through the material to the other side if it's thin enough creating an interesting effect for things like backlit ears and lit candles so this is a very important effect for a lot of different materials so how do we use it well the subsurface slider right here increases the scattering effect and this goes from regular diffuse at zero to full scattering at 1 so let's try putting this at 0.15 and there we go so increasing the subsurface scattering the little diffuses the light underneath the surface more spreading it out and creating a much softer look and like I mentioned because this increases the amount light travels underneath the surface in thinner areas like the ear right here the light coming from behind the ear is actually shining right through it creating this extra lighting now we can give the subsurface scattering layer its own surface color as well using the subsurface color option right here for example if I made that blue and I increase sub surface a little bit you can see it's like we're mixing the peach diffuse layer with a blue subsurface layer so it results in a more purplish color like that and then we undo that in the case of something like skin though and most things we probably want to keep the same color as the diffuse layer so let me press ctrl + C over the base color and I'll press ctrl + V over the subsurface color that way we're not changing the materials main color when we increase the subsurface scattering we're just changing how much light gets scattered and next let's go over the subsurface radius which is a very important control that defines how far each color of light will travel underneath the skin now if I click on this you can see it's separated into red green and blue channels and by default these values are set for something like human skin where red light will travel deeper so red you can see is up very high and the other colors are lower which means they don't travel through the material quite as far and that's why the color coming through thinner areas like the ear here is reddish because we have red light being able to travel farther in this material so it traveled right on through the ear illuminating the other side if we instead switch these values and we made red light travel less far and blue light travel the farthest then you see it's the blue light that's coming through the ear now and let me reset these and actually that's all there is to it for these options and you can learn more about all of this in the subsurface scattering node lecture as well alright now next up is the anisotropic options right here and for that we'll switch over to example 3a now the anisotropic options here are used to simulate the reflection effect you'd see on something like brushed metal like on the bottom of a steel pot for example when you have ridges or scratches all traveling in the same direction they reflect the environment in such a way that seems to stretch it out based on the scratch directions so on the bottom of a steel pot for example you might have scratches going around in a circle like this and they're going to stretch the reflections out radially starting from the center pulling outwards to the rim and any scratch is going horizontal like this are going to stretch the reflections out vertically like you can see right here so that's the effect that the NSO tropic option tries to simulate now in this example here I actually modeled all of these ridges and I modeled and pretty large too just so that you can see them and understand the effect I'm talking about the anisotropic option though would be most useful for more microscopic scratches or ridges though like on brushed metal so for that let's head over to example 3b where I have another cylinder here but this one does not have any ridges model in it so we're gonna use the anisotropic option to simulate that effect on this now to recreate that effect on this cylinder let's turn anisotropic all the way up to one first now it doesn't actually do anything unless we also increase the roughness value here which makes sense because if the effect is based on their being scratches or ridges on the surface it's not a smooth surface so let me turn that up a little bit and you can see the effect taking shape and you can actually rotate how it stretches the reflections using the anisotropic rotation value here now it's important to note that the reflections are stretched out based on the center of the geometry so right now the center of the cylinder is being used as the center of the effect but if I go into edit mode make sure everything's selected and I press shift and D to duplicate this and move it you can see it's now using the center of both cylinders as the center of the effect which is why the center is around right there so definitely keep that in mind and now let me switch over to example 3c or I have a cube here that has the same exact shader now also keep in mind that the direction of stretching is also based on the object's axis right now this object z-axis is pointing straight up by default so we get radial stretching on top of this cube but we can also change that direction using the tangent input node let me press shift an a and from the input menu I'll add in tangent and I'll connect tangent output to the tangent input there and now we can use these access options here to change which axis the effect is created on and that does it for that so now let's move on to the Sheen options here which adds some additional soft reflection on the edges of your model which is especially useful for cloth so let me switch over to example 4 for that and let me switch to material preview - so things render a little faster now let's try turning the Sheen value up to 1 and in fact let's crank it up to 5 so we can really see the effect so you can see this basically added some rim lighting and this is a pretty useful effect for adding a soft velvety look to materials like cloth it seems to simulate the fuzziness of a cloth surface which catches the light more around the edges and the Sheen tint option here will simply color the effect based on the base color and that's it and now let's move on to the clear coat options here which add an extra specular layer on top of your shader and for that we'll switch over to example 5 so let's say we're creating car paint first we add in the base paint which is a metallic paint so I have set metallic up to 1 and this has a higher roughness value to give the surface a diffuse look to it so I've roughness set to 0.5 the problem is adding higher roughness means that we don't have any sharp reflections as you can see that's where we can turn up clear coat so let me turn this up to 1 and there we go this added another layer of specular reflection for us so it's like this was another layer of clear coat paint on top of our metallic paint and we can control the roughness of just this specular layer just this clear coat layer by using the clear coat roughness value right here now this clear coat layer can also have its own normals by plugging in normal data into the clear coat normal input down here any normal info plugged into that input will only affect the clear coat layer and not the layers underneath which is really useful if you wanted to simulate something like orange peel which is the waviness that happens on just the clear coating of car paint so for example I have a noise texture down here that's already ready to plug into that input to simulate that orange peel effect so let me plug that in and there you go you can see how the clear coat layer is very wavy now in fact a little bit too much so I'll turn that down to maybe point zero two it's still a little too much but who cares it's just for demonstration and that bump map right there is only affecting the clear coat normal layer it's not affecting the layers underneath so the clear coat normals are totally independent from the regular normals in fact if we plug this into the regular normal input instead and we crank the strength up you can see only the bottom layers are affected by the bump map now but our clear coat layer is not affected by that and instead acts like a perfectly smooth layer of Polish on top so this can be used to create some complex layered materials like that which is very very cool alright that's it for that so let me switch over to example 6 now or I have this little cup right here and I'll select that and now we're gonna go over the IOR and transmission values down here and these are for creating transparent materials like glass glass for example like every other material both reflects and refracts light for transmissive materials like glass though when light refracts and doesn't bounce back out like it does for a dielectric material it instead goes right through the material and because light travels at different speeds through different mediums it'll Bend when it both enters and exits something like glass creating a distortion effect now for this example we're gonna render this in cycles since that handles refraction more accurately and in order to create a transmissive material we simply need to turn transmission up to 1 and now we have glass now the IOR value here determines how much light bends as it travels through the material it also determines the amount of for now so in Iowa of 1.01 for example will have very little bending effect and very little specular reflection especially at lower angles of incidence but an IO R of 2 will bend the light a lot more and also increase the amount of specular reflection now you might remember that the specular field up here is also basically in IOR field this field is specifically for non transmissive materials though and it only handles for now it's completely ignored when a material has a transmission value of 1 so in that case only the IOR value down here is taken into account and the specular field has no effect you can see it's the same at 0 as it is at 200 it has no effect whatsoever because our material has full transmission so if you're working with a fully transmitted material you only have to worry about the IOR field right here and again you can find a materials Iowa at pixel and Polycom / IO our HTML also make a note that you don't need to convert the IOR value for this field like you do with the specular field for this field you just plug the IOR value in as is and it works right all right let me align the view to where I'm looking in the glass and I've got a strong specular reflection on the outside of the glass like this now let's go over the transmission roughness value here what this does is it scatters light that transmits through the material so it's an internal roughness value basically for example if I turn that up to point two you can see the light scatters as it goes through the material making it look blurry but note that the specular reflections on the surface are still sharp because this value only affects light that goes through the material so it doesn't affect specular reflection and let me turn that back to zero now as a side note this transmission roughness is different than the other roughness value up here transmission roughness determines the internal roughness whereas the roughness value up here determines the roughness of the surface so if I turn this up to point two for example this will scatter all the light hitting the material which contributes to everything looking blurry including the specular reflection but you can use both values together to make a more complex material like let's say we wanted a slightly rough surface so I'll turn that down to point one and I also want the light scattered more as it goes through the glass so I'll turn transmission roughness up to 0.3 and there you go so there's a lot of combinations possible with this node all right so we're done with that let's switch over to example seven now and we're gonna go over the emission option so let me select the platform here now the emission value right here simply makes the material emit light if for example we made this platform emit a red light you can see it's emitting light into the scene so it's adding extra illumination to the monkeyhead and anything that's around it and you can turn these values up above one as well for example if I turn red up to 15 now it's really blasting some red light into the scene and you can plug-in a mission map into this input as well like for example I have an image node over here that already has an emission map and let me press control shift and left click on that to preview it so you can see most of the platform is black but I have this ring as white and this ring as white and those are the areas that I want to admit that red light now let's change those colors by running this through a color ramp so I'll press shift an a and from the converter menu I'll add in a color ramp and plug it in right there and let's change the white value here to red and I'm gonna do the same thing I'm gonna crank that up to 15 for the red value and let's plug the principle node back in the material output and I'll plug this color value into the emission value of the principle note just like that and there we go so now only areas meant until we met light are emitting that red light and that's it so this is a newer feature to the principle node and it prevents the need for mixing in a separate emission node which is what we had to do before when we had textures that included some elements that emitted light all right now let me switch over to example 8 where I have this leaf texture on a plane and now we're gonna go over the Alpha option down here and this is another new option added to the principal node and the Alpha option simply makes objects see-through for example if I decrease the Alpha here you can see it becomes more and more transparent and it's not like glass or anything like that this doesn't refract light it just makes the object more invisible and this is useful for anything that would use an alpha map especially like this leaf for example right now I just have the Leafs color map plugged into the base color of the principled node but we still need to use an alpha map to make the area around the leaf invisible and for that I'll duplicate this image texture node here I'll load in the Leafs alpha map and let's get a preview of this so the black areas have a value of zero so they're gonna have alpha value of zero which means they'll be transparent and the white areas have a value of one so they'll remain opaque so let me plug the principle node back into the material output and we'll plug the alpha color into the alpha input right there and there we go so now only the white areas of the Alpha map are left visible so this new option prevents us from needing to mix in a separate transparency node which is what we had to do before so the principal node is really more useful than it ever was and that's actually gonna do it for all the options in this node but I do have some final thoughts that you might find useful first this does not replace all other shader nodes it's still useful to use the other shader nodes in certain circumstances but it's often very handy and convenient to base your material off of a principal shader node especially if you're striving for realism and second I wanted to clarify something about the specular slider here you may have heard of things like specular workflows or specular highlights those things are not the same hear the word specular in this case is used to mean regular reflections and this slider is based on IOR values so this field is not compatible with specular maps and specular workflows those are different things and a specular map plugged into this slot is not going to work the way you think alright and that's actually going to do it for everything so I hope you learned a lot in this lecture and I'll see you in the next one Oh
Info
Channel: CG Masters
Views: 56,570
Rating: 4.9835787 out of 5
Keywords: 3d, 3d art, blender, modeling, 3d modeling, texturing, texture, animating, animation, rendering, compositing, cycles, pbr, raytracing, cg, cg masters, tutorial, tutorials, training, learn, how to
Id: cvu5XYrZT6Q
Channel Id: undefined
Length: 28min 48sec (1728 seconds)
Published: Thu Apr 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.