How to Make Photorealistic PBR Materials - Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

If you watched the original tutorial, just start from 14:12 to see the parts that have changed.

But basically:

  • For dialectric materials, the fresnel when looking directly at the face is not 0% reflectivity, it's 2-5%.
  • The default fresnel node does this automatically! yay
  • Roughness values need to be Power of 2 calculation to make them accurate
  • Roughness maps should be inverted

Check out the node screenshots and download the .blend

👍︎︎ 12 👤︎︎ u/BlenderGuru 📅︎︎ Jun 28 2016 🗫︎ replies

before and after test, world of difference... edit: by "before" I mean using the old tutorial.

👍︎︎ 7 👤︎︎ u/inboudayo 📅︎︎ Jun 28 2016 🗫︎ replies

thank you for making this, looking forward to the metallic part!

👍︎︎ 3 👤︎︎ u/pssdrnk 📅︎︎ Jun 28 2016 🗫︎ replies
Captions
if you're interested in making photo realistic renders then you need to be putting special attention into your materials materials unfortunately most artists go about creating materials the wrong way they create materials that don't actually match the physical properties of what you see in the real world so you're i can't really figure out what's wrong with it but something's not quite right about it so that's what we're going to be addressing in this video we're going to be creating a pbr shader pbr we'll get to that in a second that essentially is more accurate and therefore more realistic to what you see in the real world now if you're having deja vu watching this video yes i did actually publish this tutorial three weeks ago however if you scrolled through the comments you would see that i actually made some pretty big errors in the video big enough that i thought why not just redo the whole tutorial fixing all the problems uh then just plastering it with annotations so yeah i'd rather just redo it than have that horrible misinformation out there so that's what this is now um it is going to be in two parts um because it is a pretty in-depth topic pbr materials materials um get out of here but yeah this this part part one is all about dielectric materials dielectric don't let that work for you off it's unnecessarily complex essentially it's like it's hard stuff so you've got like plastic ceramics car paint fabric walls uh this chair if it's not a metal object if it's not a metal material then it's essentially dielectric and we're going to be uh basically creating a node setup in cycles to create a very nice looking and physically accurate dielectric material and then we're going to be combining that into one nice node group which you can then go and reuse in the future over and over and over again so that's the idea with this you do it once and then you forget about it because it's now done and you can just keep reusing it so this is part one so by the end of this video you will have this node group here which will look nice and will make nice looking uh materials and then in part two when it's out you can click on this part of the screen if it's already out and you can go and watch it i will be doing metals exact same thing but regarding metals and we'll put it into one node group for metals so at the end of this two-part series you'll have two node groups that can be used to make some awesome looking materials uh this video is long so i'm putting some chapter marks on the screen here so you can jump ahead if you already know what's uh what's coming so to start we're going to be talking about what pbr is doesn't cycles already do this which is a very common question fresnel and the fact that everything has it proper roughness and then finally creating a dielectric material in blender all right remove the webcam you don't want to see my face let's talk about the first one pbr what is it as some of you probably already know pbr stands for physically based rendering which unfortunately doesn't answer the question of of what it is so let's just look at two examples on the left hand side we've got a non-pbr render and on the right we've got one that is pbr and the difference between the two is the one on the left is it was basically created and assembled by myself um in the node editor with no regard to the physical uh limitations or the way real materials behave in the real world so essentially it's like you know i want this floor to look a little bit more shiny so i increase this shininess value etc etc and it looks okay it looks fine but in comparison to the one on the right you can see that it doesn't look as realistic and by the way if you actually prefer the one on the left that's totally fine as well you can actually customize it and tweak it in the pbr method to be whatever it is you like but the point is that the one on the right this pbr method is that at its default at the start it is physically accurate so it's like um it's it's setting you up at the start with the best step forward so that you've got your your basic node group your your material already set up so that it's keeping in mind um some of the physical the physical laws the way real light affects real materials so that it comes out at the end looking a little bit more realistic and a little bit more accurate to what you see um in the real world so that in a nutshell is what is what pbr is all about pbi is very common and very used a lot in hollywood because they want to match live action elements with cg elements so they use rendering engines like arnold and renderman which take pbr workflows already into account so by default they're already set up correctly cycles isn't which is what we're doing in this tutorial setting up so that it is it's used a lot in video games especially recently i guess in the last last sort of five years pbr sort of become more of a hot topic which is probably where a lot of you watching had actually heard the term first i know it was for me so for example new games like uncharted 4 um a lot of other ones like like anything rendered with the crisis rendering engine unreal engine what's another one uh there's a bunch of them out there that they now actually take into account um the pbr workflow so for example the old method for making a video game character was you had to set up the materials and the the textures and everything and then if you wanted to put that character in another lighting environment like go from an indoor scene to an outdoor scene you had to change all of the materials and the textures on that character because it didn't work in both lighting environments so they had to tweak it for every element which is crazy like for us to think about like can you imagine doing that but that was just the usual workflow for for video game artists because the the game engines weren't able to deal with uh with things the way standard rendering engines do that's my understanding of it but now they do so that's why it's a it's a like more of a hot topic because that's sort of the standard for the gaming industry now but anyways if i choose a lot in movies used a lot for video games but it's also used um when realism isn't a factor so you know think about the movie wreck-it ralph a movie set in the world of a video game like you couldn't think of a more a perfect example to go stylized and cartoonish non-realistic kind of thing and yet at the start of it at the start of the film disney realized that if they adopted a pbr workflow for their artist to work in that it would not only save them time but it would also enable the film to have this slightly realistic quality whilst also looking stylized so if they if they start if they gave the artists a pbr shade like a the same shader for every artist then allowed that artist to then tweak it and exaggerate things as they wanted at least from the start it's got the right foundations the right feel and that when two different artists make a material and they put them together they are still going to match each other in certain ways so it would actually save them time because the world would sort of feel a little bit more natural a little bit more connected so point being um it's it's pbr is more accurate and it allows for more realism but it can also save you time for both video game artists and cartoony stuff it's just a nice way of working um now if you're watching this and you're sort of scratching your head and you're like okay but doesn't cycles already do this yes and also no cycles does most of it it does most of it pretty well however there are a few things that it does not uh one of the things that it does already for example um is energy conservation nothing to do with saving the planet um energy conservation is all about uh the law that a material can't be brighter than the light that is hitting it so just as an example i'm just going to open up blender really quick i'm just going to do a quick demonstration um comparing cycles to the blender internal rendering engine in the regard to energy conservation so this is cycles with a very basic material using the incorrect method but just for this example you can see a diffuse gloss being controlled by a mix shader so energy conservation is that you it can't be brighter than the light that is receiving it so that means that if you want to see the diffuse you have to be seeing less of the reflection so using this mix shader you can see that as i turn down the mix shader the gloss is becoming less so that is correct and you can see if i want more gloss you're actually seeing less of the diffuse you're seeing less of that red color so that that's how this works now you can cheat you know you could add an add shader but the mix shader it just makes it easy it forces you into this realistic workflow that's just how it works and also the um the roughness of the reflection is really important as well you can see that the sharper the reflection you can see the brighter that that reflection becomes whereas the the yeah the more you make it uh the more smoother what do you call it the softer the reflection becomes the more dimmer it appears because it's stretching that reflection out over a larger surface so there you can see really bright and then really soft as it as it goes up now contrast that with the blender internal rendering engine okay something which most of you probably have not used for a long time myself included in fact i think this is the first time i've used it in maybe a couple of years just for this little example here um if you forgot how blender internal uh works essentially this is the exact same material here we've got a diffused and we've got a specular but you can see that these aren't related to each other so i can just increase this specularity here and this becomes brighter but it doesn't reflect sorry it doesn't change the amount of the diffuse that you're actually seeing there and you can see i can turn it down it doesn't change at all um as well as that i can turn up the hardness of the specularity there and it's not getting brighter that's the same amount of reflective light and i can make it wider there and it should be getting dimmer but it's not it's the exact same amount so you can see the difference between the two cycles is physically accurate whereas the blender internal is not and that's why well that's one of the very very many many reasons why cycles looks a lot nicer than it does in the blender internal engine and this by the way the blender internal engine here functions in a lot of ways to the way old game engines used to work so if you've ever let me go back to the demonstration here if you if you if you woke up one morning and you're like okay pbr why is everybody talking about pbr it's because so many people are in the game industry and they have been forced into uh the internal this this way of setting up sliders and things and having to tweak it like every time the character moves into a different environment or you know different props in different areas they had to tweak materials in order to get them to work but now a lot of game engines are moving to the cycles way of doing things so they're physically accurate so now they don't have to do that so that is why so many artists today are now talking suddenly about pbr rendering so that's it so cycles does some of it like energy conservation but there are some things that it does not so it does energy conservation check it does linear space which is another thing we won't talk about but it's pretty boring basically keeping everything in the same color space check um for now it does not automatically do it proper roughness it does not automatically do it and when i say automatically i mean in the same way that the mix shader sort of automatically forces you into that workflow you don't have to use it for now the fresnel you can make and we will in just a moment we will make some really nice looking for now you can do it in cycles but it's not there by default and that's what this video is really all about so let's talk about the first one fresnel um a lot of you probably already familiar with this or at least heard of it before certainly seen it if you've ever stood at a lake and looked out across the surface you'll notice that far off in the distance um it looks like a mirror essentially and then as you move closer towards your feet you're often able to see through the water and the reason for that is fresnel um fresnel basically works like this when a light is at uh is hitting an a hitting a surface at an extreme enough angle um it bounces off it but at a more steeper angle like if it was you know pointing straight down then it would cut through it so in the case of a lake um way out there in the distance where the light's sort of bouncing off it you can see that yeah you're just able to see the mounds and stuff it's it's essentially like a mirror but then as it comes forward and forward it's cutting through it and since water is transparent it you're basically seeing through the water and then you're able to see the lake bed underneath it but this isn't just applicable to lakes or water or anything like that it's applicable to every surface so for example this is car paint you can see the exact same effect here as the angle across this carbon changes and it becomes more steeper the light is actually able to penetrate it and you're seeing what's underneath it which in this case is a diffuse material so it's sort of cutting through that clear coat you can really see the gradient especially from like up to here down to here the reflection just it's yeah it just it's a gradient effect it just tapers off and you're able to see more and more of the red car paint underneath it whereas up there it's basically like a mirror i love this photo here of this little teacup [Music] yeah you could see that on the edge of this teacup it's essentially a mirror it's i i think it must be 100 reflection i mean usually can't see it because it has to be that exact angle but pretty close to it and you're seeing what is next to the teacup you're seeing what's yeah left over there whereas as it goes comes around and the angle changes to point you more face on you're seeing less and less of that reflection there that is for now so this is this is how it looks in blender essentially so this is a sphere right and we're looking at this sphere this is just the fresnel effect so white is 100 reflection and then black would be zero reflection so at its most extreme point at a 90 degree angle it's 100 reflection and this is on every surface remember regardless of the material it's 100 reflection it has to be that's just how the real world works but then as it tapers off towards the center it slowly slowly becomes less and less reflective to the point that in the center if it's at zero angle sometimes called fresnel zero or f zero it's at a range of two to five percent reflection and this is yeah it calculates that whether it's a two or a five or anywhere in between it it's based on its index of refraction which it's getting complicated you don't have to worry about it we'll get to it later but essentially blunder will automatically calculate that that value there for you now the first time i made this tutorial i got in trouble because this was the biggest problem with that tutorial was that i said that the the middle of your material should be zero reflection um but in actual fact the uh the the fresnel node in blender automatically calculates it at the exact amount that it should be which for a dielectric material at an index of refraction of 1.45 which it pretty much always is it's 3.34 reflection anyway you don't need to know any of that we're going to do it when we get to blender in a second just letting you know that was the biggest problem with that tutorial was that i said that this should be zero which it absolutely should not that was a hideous mistake so um so that that is for now um and remember everything has fresnel every single surface has fresnel it has to that's just and you think of like the most diffused surface you can think of like cardboard for example that has for now um this guy here from filmicgames.com um if you just type into google everything has fresnel his post will come up at the top there and he basically he used a polarizing filter on a camera to separate the specular effect of materials like the shininess effect of it and then he shows a comparison of it so you're able to see what the diffuse material looks like and then the specular layer of that looks like and it's really awesome because like you can see absolutely everything has fresnel even bricks um he's got a whole bunch of different materials there very interesting to see um and if you need even further reminder um vivre actually put out this funny little short film um it's kind of a dumb little film but you can check it out if you want to click here or whatever and uh they mentioned in it like everything has for now you got it everything has for now like in a bank robbery or something and now you can buy a shirt that says everything has for now yeah nerd nerd level 1000 um anyways so what we're going to do is we're going to jump over to blender and we're going to add the fresnel effect fresnel effect very easily um taking it from the usual method to the correct method um now before i jump there i do want to give a very quick shout out to cinecat pro he was the one who really introduced me to the topic of pbr because i was under the impression that cycles automatically did everything until i stumbled upon his youtube video and i was like that's great i've never heard anybody explain it to me like that before um i looked at a bunch of articles like google docs articles by marmoset substance a bunch of people have written about pbr and i didn't really understand it properly um until cinecat pro did so a lot of what i'm going to teach in this tutorial the methods and everything in blender basically comes straight from him and he was even helpful enough to give me pointers on twitter and everything so really really helpful and so a big thank you to him so let's go ahead and jump into blender so um this is just a very basic scene that i've set up red ball with just a completely diffuse shader and then in the the world thing i've just added an hdr it's not necessary it's just so that we can actually see the reflections otherwise this demonstration wouldn't be that helpful okay so let's imagine we're just making we want to make this look shiny okay so just like in every single tutorial that i've ever done for the history of ever unfortunately was to go like this you add in a glossy shader like this with a mix shader combine the two together and look at that yay it's lovely and shiny and you know you can see it's now a nice glossy ball and if i want to make it less glossy it's like that more etc okay great but doesn't have the fresnel effect it's the exact same amount of reflection uh on the edge there as it is in the center there so you can see now now that you know about fresnel that just doesn't look quite right so let's make this look right very easy you just go to input for now right this is super simple then you just drag this and put that into the mix shader input and it's done okay that's it yeah end of tutorial okay what that's done is if i control shift left click on this fresnel which actually you can only do if you have got the node wrangler enabled so make sure that you enable this you should just have it turned on by default always because it's just incredible it just enables you to control shift left click on any node in your setup there and just see how it's contributing to the material but if i control shift click on this you can see that on the edge there it's a white color and then as it tapers towards the center it becomes a a more gray ish color now i actually got in trouble the first time i made this tutorial because i you like i did a render of this and i got the eyedropper tool and i looked at this value in the center there and it's like 20 gray right and then you know the edge there it's it's one like for white right like 100 y so this was like 20 gray and i assumed then that wow the fresnel node is actually broken because if you remember from our theory it should be from about three to five percent right here but as somebody told me in the comments that's actually because it's trying to convert and i'm going to get in more trouble if i try and explain it but i think it's trying to convert from two different color spaces so from like an 8-bit color space to srgb values so they're not exact anyways you don't need to know any of that the point being is that even though this might look like this reflection here is higher than three or five percent it's actually accurate this value here is three point three four percent reflective right in the center that's the actual one which is going by physics um the real world accurate whatever at an ior index of refraction value um that's precisely what it should be okay so if you in if you decrease this like it becomes darker and darker which is how real world materials are so i had this in my first video i like bagged it like ah what did blender do why did they screw up this fresnel note it's actually perfect the way it is um it's not so helpful and that you can't like tweak it and like make it more reflective that intuitive but we can do that very quickly which we'll get to later but anyways by default it's set up nicely but the problem is and what you'll probably notice looking at this is like that's cool i knew about the fresnel node before and i don't like it because i can't now control how reflective i want this object to be like looking at this like in comparison to this if i want this to be more shiny i just increase this and i have all the control in the world but when i when i plug it into the fresnel node you can see i'm missing that where did that shader go where did that little slider go it's gone and that's why a lot of artists hate it i know that's the reason that i hated it for many years i'm like ah forget the fresnel node can't control anything i don't want it to be accurate if i can't make it actually look good so we'll get to that in just a second but one other thing i want to talk about before we get to that adding in a little tweaking values and stuff like next is the the next law of the universe which says that uh proper roughness as roughness increases the fresnel effect should decrease so just to give you an example of this as i increase this glossy effect just just take a note of this to see how it's working if i increase this roughness all the way you can see the fresnel effect is still in full effect there the fresnel is not impacted by this roughness value at all which is bad news so this is how the real world works you can see on the left hand side here i've got i've got a low roughness so it's basically very smooth object a cue ball and you can see the fresnel effect is very high from the edge of that ball there to the center there you can see it's going from like almost 100 reflection all the way to the center there to about three to five percent reflection or sure it should be i have no idea if it's true or not i can't read the values of the photo but you can see compare that with the one on the right hand side here this is a high rougher so a very rough ball very hard to find photos of this by the way i locked into this photo but you can see the fresnel effect is much lower like on the edge there like from the edge to the center there you can see there's not much reflection going on there at all um and that's the way things work in the real world and the reason that is is that on at the top here we've got a completely smooth this is the cuboid material here very shiny surface and then on the one on the bottom here that's the uh the wooden bore material at a microscopic level this is what roughness is doing it's adding microscopic little bumps across the surface little jagged little things that you can't really see with the naked eye it just looks like a smooth surface but that's what it's doing and then as the rays are hitting it with the completely smooth surface they're all bouncing off it and they're all hitting the camera and that's why you're able to see that really you know like 100 reflection on the edges there because it's bouncing off it into the camera but at a on a rough surface it's a rough so it's a rough nice english it's it's bouncing off some of those and they're going in other directions okay so an honor on an angled object this is another example of how it looks smooth surface it's bouncing off it it's hitting the camera but on here they're bouncing off and they're going in other directions um cinecat pro had a better way of phrasing it it's like if you're throwing a skipping scone stone across a lake um like across a completely smooth lake it's gonna bounce but if you were to throw it across an ocean like where there's lots of waves and stuff you're more likely to just hit a wave and it's not going to work so that's really what's going on with the rays there so as the roughness goes up the fresnel effect is less effective so this is what we've got the top row here is what we've just created in blender so if we were to increase the roughness here it wouldn't decrease the fresnel what it should be doing is what you could see on the bottom there now note when you look at this we are talking about what's correct not what looks good so you know when you look at this like i would totally agree that the top one here actually looks better like i like it i like that little that little fuzzy edge there it looks kind of cute kind of cartoonish right but uh but that's not accurate to the real world now you can control this later on and it's totally up to you but if you're not starting at at its default what it should be then you're going to get into trouble because looking at this like this is a powerpoint presentation we've got red balls on a screen there's nothing else going on okay so looking at this in relation to nothing else yeah just going completely inaccurate looks way better but when you're building a scene and you've got an established look like i want it to be realistic or semi-realistic or whatever if you don't know what realistic like what real world materials look like you're going to get into hot hot water because you're going to have this material over here and this one's going to have weird fresnel and super shiny and this one's going to have a little bit lower because you've been looking at them on you know in a vacuum space so that's why having this this shader that we're going to go because i'm explaining this because i know it can be a little bit confusing later on when we start adding nodes you're going to be like i don't care about any of this i think it looks better the way it was this is why we're doing it so you know what the default looks like at the start so that when you um yeah go about creating a full um scene that it's faster for you to work with and you can exaggerate things when you want all right we get it andrew cool let's actually go about doing that yay all right all right um first of all let me just i don't like the horizontal workflow i just feel cramped okay there we go all right whoo can breathe um okay so just again to demonstrate increase this roughness nothing it's not affecting this for now so what we want is we want this as this increases we want this effect here to decrease and the way we're going to do that is not the way you'd think but it is a little bit more accurate and once you've done it you can just forget about it what we're going to do is we're going to put something into this normal here to say actually i'll let's just do it okay we're going to add in a geometry node this guy right here and what this is going to do if i plug this incoming the incoming output there into the normal of this fresnel you could see that the fresnel effect has just died if i control click on it you could see what that what's happened it's made the entire thing the same value as the center there okay so if i remove it you could see and i remember that gray value in the center there go in the center there um yeah now you can see it's just made at that one solid gray value so what we've done with this geometry we've said that the incoming value this value right here let's take that and let's tell it for the entire object the entire fresnel let's pretend that we're looking at it from dead center what would the fresnel effect be and it is of course zero so it's called fresnel zero f zero sometimes they like to confuse you by putting in weird anyway f zero is what that's called right um so what we're gonna do first of all hit ctrl h on this geometry i want that that's a quick little handy shortcut it just hides every value except the one that's in use so that's pretty handy otherwise it just gets way too complicated and what we're going to do is add in a mix rgb node right here and i'm going to put this in between these two put this at the bottom input and then with this value here i'm going to try and make it so that it's the normal fresnel effect so the normal fresnel value whatever that would be now by default you can't really do that because if you have a look at this like if i set that to you know whatever you can see there's this weird effect going on here it's not having the effect that we want and that's because this value here is a color value so it's like blend is trying to convert this whatever value this is into something here so what we're going to do is uh is add in a bump node and this is going to basically tell blender like hey this is like let's just remember this is a normal that we're dealing with okay so this bump node it's not bumping anything so don't be thrown off by that value it's just it's like a reminder like blender remember we're talking about the blue values the vector values can you tell i don't know what i'm talking about yet all right this is this is a method that cinecat pro taught i really like it um and anyways what this does now is looking at this you can see if i set this to 0 we've now got one hundred percent of the standard fresnel if i just remove that you see it's the exact same thing right but then as i increase this the fresnel starts to drop off look at that lovely okay so that that's perfect that's exactly what we want so now all we need to do is we need to make it so that this value here and this value here is connected to the same value and you can do that very simply by adding in a value node and then just connect them up like so and now look at this so this now if let's just label this so that we uh don't get confused how do you label this one label i never know there's so many like name fields in blender you name it end up naming it like five times ah roughness okay so this is now our roughness field so as this drops you can see that it's it's the fresnel effect is now naturally coming into play so that let's just have a look at the mix shader and look at that see so now the fresnel effect it's like it's normal nice and glossy and then as it increases the fresnel gradually drops off and that is awesome that's the way it should be okay so we've got the basics yeah sort of laid out right now but now we want to do is we want to clean it up and start to form that one nice shady group which has got all the controls and everything that we need in it we don't have to bother with these little dangling value nodes or anything like that so what i'm gonna do first of all is just select the uh everything related to the fresnel and i'm gonna hit control g okay which if you're not familiar with node groups they're really handy it just makes a nice little no group there which you can go in and out of just by hitting the tab button and then if you want to expose a value an exposing value means to put it here so you can see if i was to take this ior and then put that down there you can see that this is now labeled ior okay and then if you want to delete or rearrange them you can hit the n key and then just go here and delete them or whatever so first things first you want to start labeling it so this one here is called the roughness value okay so we want to name it from i change the name from fact to [Music] roughness okay so that now there's no confusion whatever what this little gray value there is the other one i want to expose is this normal value right here okay now the reason i want to expose that is that when we start if we were to make a proper material out of this we'd add a texture maybe some bump mapping or whatever when we drag the normal like you know if this was uh let's just do it okay i think it's a quick example uh noise you know and i'd feed the noise through a bump node like this okay yada yada that looks horrible um okay this is the way you would go about doing it but if you don't have that normal value there then this fresnel effect won't take into account any bot mapping that you've got but now that we've got that i can now drag that into there and now it should affect it okay sorry for this really horrible demonstration um it'll make sense when we do a proper material anyways just wanted to expose that one all right okay uh the rest of it is fine i think for now um what i'm going to do is i'm just going to rename this node where is the name so many name fields this one we'll call it fresnel okay now this is really handy because whenever you make another material if you want to bring up this this node group again you just hit shift a and then go to group and there you've got a bunch of them here this must be an old file of mine anyway you can see it's right there called fresnel okay so you can just add them in like that okay the other one i want to do is i want to make a reflection node okay so we could if we want we could make this like one big node group and that's fine but if we wanted to use something that wasn't a diffuse like say i wanted to make it like a skin like i wanted to use a subsurface node instead of a diffuse node i'd have to go into that node group delete the diffuse node add in a subsurface it's just a little bit more annoying so what we're going to do instead is just create copy these values here or sorry select these values here then hit ctrl g like that and then this one i'm going to call reflection i think i've done that twice let's just call it ref dot reflection little trick i learned again from cinecat pro [Laughter] um so what i'll do now now that we're in this we want to make sure that we're not we haven't got duplicate you know inputs you can see this looks pretty messy we've got two roughnesses right so just make sure that we're using just the one roughness um so i'm going to hit the n key go here and delete this roughness okay so there we go we've got one roughness um and then i want to get the the normal value again so copying that normal value right in there so that both of these are now using this one normal value which is good um same as the fresnel okay good now now we want to do is we want to add in one more thing and this was to give us the control that we had before so remember when i was talking about why most people don't really like the fresnel node is that normally you have you have this value here which controls how glossy your material is this this factor value but the moment you connect the fresnel node to it you lose that so what we're going to do to add that control back in again is by adding in a mix rgb node okay we're going to drop this in here and put the fresnel into the top input here now what this is going to do is actually let me just how can i do this i just want to because you can't control shift click with inside a node group it's kind of annoying um just so that because it's kind of important to understand emission emission node this is how i preview what's going on okay there we go um so what this is doing here so this is the fresnel node black and white right actually let's just we don't want you anymore okay so now that roughness this that's the good thing about node groups is you've got these little values here on the outside of it now so really handy so i'll turn that roughness down so this this is the fresnel node this feeding into the factor input of this mix node means that the bottom input here is going to become the white value and the middle input is going to become the black value so if i put this into here you can see if i made this red and then this one here like blue you can see that that's what it's doing so it's just converting it from grayscale into these two colors so what that means is we don't want to create a 2d fruity uh weird look what we want to do instead is we want to make this solid white so that it is exactly the fresnel node what's going on there but then this black value here we can then use that to control the dark value which means every value that is not the edge of that fresnel the center okay that's confusing just follow along so you can see now this set that to black that is now the exact copy of that fresnel node right there but then if i increase this value here it's now it's just increasing that black value okay and that is now going to now allow us to add more reflection because remember the darker it is the less reflection it has so as we increase that it increases that particular amount of reflection very very cool so what we're going to do is we're going to take this value here and then expose it but before you do that if you do this if you expose it like that you can see that it takes that whatever this value was which in this case is a yellow dot for a color and then it puts it outside okay because it just copies that value like that if we want a slider like this one here then what we have to do is we have to make sure that we are copying it from a slider value so what i just normally do this is just something i do i just add a mix rgb node then i just take the factor put that in there like that and then i just delete the mix node and then now i've just got that slider there so now let's just delete those two that i created for the demonstration i'll call this one reflection let's move it up the list so that it's next to the roughness and then i'll take this value and put it into that black value there and now look at this see now we have full control over how much will be reflective and let's just delete that so it is actually there we go so now i increase this and look at that so we got it back we've got the reflection property back again haha full control nice looking good all right so this is looking a lot tidier than it was you know inside here um but we still do want to have just one node where we can control everything so i'm going to select both of these the diffuse and the reflection note and i'm going to hit ctrl g to make another node group out of it and this is now our final node this guy right here so what we want here is we want there to be just the values that we want to have full control over so for example what values do we want that is a very loud plane anyway so we want to have for example the color okay so on the outside of this node here i don't want to have to go inside and change the color i could do it right here yeah make a blue ball yeah um so another value uh roughness okay so i want to be able to control the roughness from outside of it now the the diffuse roughness as well as the roughness for our reflection fresnel and everything else should be the same as well so that was another thing i had to learn like the roughness also goes to the diffuse as well as the gloss okay um okay so that's outside it now okay another one we want to control is the reflection put that in there and there we go and then one final one i want to control is the normal value so the normal input is used for bump mapping of course so it has to be used for the diffuse as well as the reflection make sure it's going to everything like it should it's going into the fresnel good good good going into the gloss good oh also one final note here make sure you're a glossy shader by default like the values are like 0.8.8.8 which i learned is because in the real world nothing is 100 reflective but if we're using it in a pbr workflow so we're actually taking fresnel into account you can actually set this to one which is what it should be so go ahead and increase the gloss to one as well um and there we go okay cool so you can see now i can control the reflection i can control the roughness and it's all well and good now this is one other cool thing that i've just learned was not really cool it just it's another thing we have to do but since releasing the bad tutorial i'm redoing now um i learned about something uh which i found on this guy's website okay so i discovered that blender's roughness value as well as its reflection values it's inconsistent in that you can see on this little slider here going from zero roughness to 0.1 look at that jump there like see how like it's sharp reflection and then just goes completely blurry and then the rest of it it's really negligible changes from like 0.5 upwards and the reason for that is that it's just the way actually i won't even try and explain because i don't quite understand it myself but basically there's linear there's different values and i think it's working between two color spaces i have no idea essentially what we need to do though is in here okay between the roughness we need to add in a math node right here drop it in right there and then this goes into your roughness value there and what we're going to do is change this from add to power and then set this to the value of 2. okay now what this is going to do let's go out of this and now let's tweak this roughness value again you can see now as we increase that roughness you can see we're now up to like point two point three whatever and it's it's it's still quite sharp okay in contrast that if we go back into it and hit the m button to mute it you can see look how rough it is when we don't have that power value to it so you can see like 0.5 it's pretty much solid roughness okay um so that is what this is doing is it's converting it to the the what do you call like the value scheme that it should be so that it's yeah like between point one from zero to point one or whatever it's uh it's still staying quite sharp so really handy tip um and this guy was helpful for me like on reddit helping me out as well um but yeah just awesome to discover that so big thank you to him for posting this up there it's really awesome and we're also going to use that exact same one for the reflection value because the exact same thing like you want it to have slight increments of reflection not what it was doing currently which was i think sort of like blowing it out like from point there to point here or whatever like it just seems to have the exact same problem it just sort of jumps up i'm not sure if that's entirely accurate but you know it's inconsequent sequential it doesn't really affect it that much anyway but anyways so that's just another little handy tip for you and there we go okay um so one thing you'll want to do right now is now that you've finished your node is give it a name right there pbr dielectric or if you want to call it like something more useful you could call it like pbr non-metal or something like that because that's what it is it's a non-metal material and uh yeah you are done so now if you want to go and add this to another uh like opening up a new blend file actually let's do that let's just save this so make sure you save your dot blend if you want to use this in another uh blender scene let me load up a new file here ah get out of here new okay you would go to file append then find your file which is saved here tutorial whatever you've just named it nodetree right there and then you'll find it under whatever it is you've just called it forget all these ones i don't know what they're doing there and then hit append from library and then now when you go to your node group into your material oh it's already added it oh because i set up it as my default blender file whoops preempted it there but uh you you should see it right there so then you just go to group pbr dielectric and then you can just add it in so you've now got it and then you could do what i just did which is why it loaded up when i open the new file just click save startup file and then now whenever you create a new scene in blender whatever you've already got a pbr or a prb [Laughter] ah that's terrible uh material already loaded in so pretty cool um so i know that looking at this red bull it's like ah cool we're very successful at making red balls you must be pretty keen to see how it actually works um for a proper material so i'm going to give you an example right now um forget my my tabs that are open there um let's see so we're going to go to polygon polygon shout out to polygon.com my own website um so polygon for those who don't know what it is new texture website that includes all of the maps so you don't have to go and generate them so it's got the normal the reflection the roughness maps all included here so say you downloaded a material right so you download it like this one bricks 22. open it up you've got all the values here so you would download it all in one material and i'll show you now how we're going to use that for our pbr material so what we're going to do is go to texture image texture and the first texture that you load in of course is your color material that color texture so let's just load in this one is the albedo map which if you're not familiar with it's the diffuse minus the shadows so it's a little bit more physically accurate let's use it why not sometimes it can look a little weird but let's just try it i'm going to load that into the color input which is terrible because it isn't uv unwrapped yet so let's do that right now front view go to u sphere projection and now i don't know why but it's like it makes these squares here rectangles so i just stretch this out until it actually looks like squares and then i just scale it up a bit yeah anyway i'm sure there's a reason i'm not going to bash blender again since last year twilight i'm like look how awful the fresnel node is and then i came out with egg on my face um anyways let's look at this now okay cool so now we want to have the bump map so the normal map so how would we do that um add another image texture go to open and bump map the normal map there we go so i'm going to load this in and feed it through a normal map node plug that in there this value in here and this always happens whenever you do this make sure that you set it from color to non-color data for anything that is not your color so anything reflection roughness another crazy plane outside um set it to non-colored data okay just so that it knows what's going on is my window shut it is shut that is why i'm moving folks this area is too loud um now what we're gonna do is the roughness the roughness map okay so actually no duplicate this one it's already set to non-color data load this in gloss so that's the other thing so gloss depending on what software you're using there's not apparently they've messed up the conventions i think there's probably two companies discovered at the same time sometimes it's called gloss sometimes it's called roughness and apparently they're inverted so if one if it's gloss which is what it is on polygon then what you need to do is invert it okay because blender will be looking for it will make the black values rough and the white values clear whereas other programs will be the opposite so anyway you put it through invert then plug that into the roughness input and there we go there and then let's add in another node here and then this one is going to be our reflection node reflection drop that in and put that in there okay so you can see that the maps are connected which is good and um it is true it's like it's behaving the way it should but we don't have any control over this so we have the same problem that we had at the start like with the fresnel you're not able to control the glossy amount or whatever so before we had maps we had these values here and if i wanted to make it more rough i could do it very easily with a slider and that's what we want as ours we want a slider but when you add a map you no longer have that control anymore and that that's a pain and i know that if it's not there then i'm just not going to use it um so maps are good because it adds variety like um there's no like if you want to watch the original photo realism explained tutorial we talk about it but with the material there's no way that it can be solid roughness in everywhere or solid reflect reflection everywhere so a map is useful it's necessary but sometimes you want to tweak it you don't want these default values here controlling how it is so if i want to make this you know more reflective what i would do is i would add a color ramp node in here and i would have a look at this and then i go yeah make it you know increase the white values like that and you can see it's now becoming more reflective but it's it's fiddly so this color amp node it works great but you've got to fiddle around with these sliders you've got to go back in and check it out again and it's it's not as intuitive as having one slider so i thought long and hard about what sort of solution would work best brightness and contrast nodes are no good because you start to lose values if you go up or down in some ways that was a terrible explanation but you know what i mean um and this was the method that i came up with um and what we're going to do is uh we're going to add so we're going to create one little no group which is going to give us one slider to make it brighter or darker than what it is and this is the way we're going to do it so we're going to add in a mix rgb node drop it in here and then we're going to set this to overlay and what overlay does is it allows you so that if i set this to 1 if this value is solid gray which it is right now even though that's it should be 0.5 whatever anyway it should be the exact same value as it was at the start so it's this but because this is gray it's not adjusting it but if you make this brighter than what that gray value is it makes it brighter but then if you go darker then it slowly makes it darker like that um actually i think okay i just got them around the wrong way but it was the exact same demonstration so brighter goes there and then darker goes there now what you could do is you could add in a value here set this like that and then now whenever if you want to make this say this is the roughness right i could go alright i want to make it less rough so i just turn it down so anything minus 0.5 would make it sharper and then anything more than 0.5 would make it more rough right because it's just changing that to become more white or more dark but again i didn't like the fact that then as an arch you have to think like okay 0.5 is the default you always have to remind yourself point five is the default uh anything higher goes brighter yada yada i just wanted one slider so i wanted to be even simpler than this so again this is just this is math but you don't have to you do this once and then you forget about it all right this is what we're going to do all right and again i have to give credit to uh cinder cap pro because i spent ages trying to do the math myself for this like how do you do it and i was getting into like researching on wikipedia the different calculations it's actually quite simple um so cinecapro help me out on twitter again this is what you do so you add a math node sorry i did that quickly converter math and then you set this to multiply and then you duplicate that yeah and then you set this to add and you leave the default values at 0.5.5 and what it's going to do is essentially it is going to convert it from a 0 to 1 scale to a minus 1 to 1 scale so now having a look at this if i set this to 0 it's now the exact same what the map was at the start which is good so that's our baseline and then as i go minus slowly towards minus one and then should go solid black on minus one perfect back to zero and then as i go all the way up to one it should go solid white when we reach one which it does perfect hey so now all we need to do is select those three nodes right there and hit control g and then this is going to become our less more slider okay and now we can delete this value here and then this is that thing so now looking at this with this invert node like it's like uh and yeah if i want there to be more roughness so the default should be set to zero and then now this is this is doing that so really really handy only thing i don't like is that this is a numerical value instead of a slider so i'm just going to do what i've done in the past which is to take a mix igb node steel that little factor slider there and then i just go in here delete that convert that back into where it was the top input and then i'll just call this the less more default value is 0 because that's the the baseline and then the minimum value is minus one and the maximum value is one so it just sort of keeps you inside that range so then here now we've finally got that's oh actually there's also it's got two little color points here so just make sure that you've delete anything that's not necessary so there we go look at that a less more slider so if i want that i'm looking at this i go i want it to be a sharper looking reflection than what we've got currently so i will decrease the roughness look at that becomes shinier i can now reuse this wherever so whenever i've got a black and white map i can just drop that in right there so i'm looking at my reflection now and i go um okay so the default reflection is like that i want the reflection to be a little bit shinier or i want to be a little bit less and there you go so that that was the solution that i came up with for wanting to have that slider control whilst also using texture maps because i think texture maps are really handy but because you lose control over it i think a lot of people are like reluctant to use it you know what i mean so this this slider sort of fixed that fixes that um but there you go so that is it so this is the this is the base pbr dielectric material which you should have at the end of this and by the way if you've followed along with this and you're still a little confused or maybe you just want to don't bother having to make it all yourself you can download this dot blend file on blender guru so if you click the link you just click here i'll put the link there so you can go and download it from the from the tutorial page yeah so you don't have to go and assemble it yourself but this is the good thing once it's done now you understand how it was built you understand why we went through all this this struggle the struggle of a blender artist to uh to make this material you understand why it's done now and now in the future you've just got one nice little node so whenever you're making anything in the future you don't have to worry about it being inaccurate and if you want to exaggerate it you've got the controls for that as well and then with these little sliders here you can also add your own maps and things so i'm hoping that with this little setup here you'll be able to make some really cool materials and hopefully a lot faster like think look at this now how many nodes we've got like they're all inside this one little group so now you just you add this and you're done so um there you go thank you for watching um if you liked it please give it a like so other people can find it too and if you want to see more tutorials um go ahead and click subscribe there is part two which should be coming out next week and yeah that's it
Info
Channel: Blender Guru
Views: 894,508
Rating: undefined out of 5
Keywords: blender, tutorial, cycles, PBR, realistic, photorealism
Id: V3wghbZ-Vh4
Channel Id: undefined
Length: 57min 18sec (3438 seconds)
Published: Tue Jun 28 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.