 Well, it has like a big influence on the game industry because there are a lot of differences between physically based shading and non-physically based shading. So here's another definition. So I would say that physically based shading are the shading techniques providing better representation of interactions between light and matter. Now, okay, we are talking about set of rules, so let me enumerate them. The first one, we have to work in linear color space, which means that we shouldn't use the values of the colors that are encoded in pixels that are in the sRGB color space. We have to convert them to linear color space, which means that the values will then represent the real intensities of light. But in Blender, we don't have to worry about it because Blender does it for us. And the second rule, rule of energy conservation, this is a pretty simple one. It's like no object that doesn't emit its own light can be brighter than the light that hits it. So in Blender, when we are creating our materials, we don't have materials like wood, copper, I don't know, plastic, whatever. We have to build the shaders from individual behaviors. So we combine behaviors, like in this case we are combining the diffuse behavior with glossy behavior, and we somehow had to add those influences together. I said add because we add light, and we have the little node that is called add shader, but we shouldn't use it because this way we could have the situation where the object is brighter than the light that hits it. So we should use the mixed shader, and simply into the factor socket we put the reflectivity, something that we define. Into the bottom shader we put the glossy shader, so this way we know what the reflectivity will be. For example, when it sets to 20%, this material will be 20% glossy, 80% diffuse, so everything will work just fine. Another rule is that we have to know that reflectivity is dependent on the viewing angle, so somehow we have to model this somehow. So you can see on the pictures, like here, when we are looking almost dead on, we see through the water, and back there it acts like a mirror, and of course it applies not only to water, but to almost everything, even copper has some reflectivity. Here it is not copper, but you can see on the desk how reflectivity increases when the viewing angle increases, and here as well. So to manage this, we have to use some formula, some equation, and there is an equation that is called Fresnel, and Fresnel is just a mathematical formula that calculates what is the probability of reflection on the given viewing angle, and it is also dependent on so-called IOR index of refraction. Just a very simplified definition of index of refraction is just the, this is wrong, but anyway, let me say that it is true. So it is the speed of light in the medium in comparison to speed of light in the vacuum. So in vacuum, light travels at the speed 300,000 kilometers per second. So if I am characterizing this medium, it has an index of refraction 1.45, so I should divide the speed of light by this number, and I will have the speed of light in this medium. Okay, this doesn't matter, but, well, we have, this is the graph of the Fresnel for a different media. We can see that we always have something, when the viewing angle is zero degrees, we have some reflectivity, sometimes lower, sometimes higher. When the angle is 90 degrees, no matter what the medium is, the reflectivity is always one, and it's, there are graphs, so you can see how it goes. Some media have different Fresnel lines for, reflectivity lines for red, green, and blue channels. And the other important thing that we have to take care of is the approach to roughness. First, let me tell you what the roughness is. Those are the small bumps. So in general, roughness shouldn't be treated as the shading property, but it should be rather treated as, it is, in fact, the geometrical property. We are not talking about how light interacts with matter, but we are talking about what is the shape. Sorry, let me have a drink. Okay. So this is geometrical property, but we are talking about the bumps on the microscopic level, something that cannot be modeled through mesh. It even cannot be modeled through normal maps or bump maps. And we are talking about so small bumps that we cannot see them. When we touch the object, we cannot feel them, but they are large enough to have great influence on how light behaves. So, of course, we are, so we treat roughness as the shading property. And we, of course, don't model this, but we treat it statistically. How many micro-faces will point to certain directions? And here is how I tend sometimes to handle roughness in blender, because there is a relation. If the roughness is higher, generally, reflectivity is a little bit lower. So here is the function. And I didn't write any function, mathematical function, but just use the RGB curves and just set the curve like this. Is it correct? Well, I don't know. It works. I can change it if I want to. I have the great control over it. So as you can see, the reflectivity is defined by the Fresnel that is multiplied by this factor that is dependent on the roughness. This is one solution, maybe not the best solution. There are many other. OK, so this light, how does light behave? It's the light. OK, I maybe won't tell you what the light is. Light is light. It's traveling, and it hits the surface of the object. What may happen to it? The first thing that may happen, it may get reflected. The second thing that may happen, it may get refracted. I can say that it is probable that this will happen or this will happen. Or I can say it's a little bit differently. I can say light will get split into two directions, reflection and refraction. Here are the angles. So this is something very familiar, I think, to everybody. The angle of reflection is the same as the incidence angle. But we have something weird going on with the refraction. It's the light turns. So I don't know how to explain why is it happening. Mainly because I don't know. Secondly, it probably would be difficult. So let me use a little analogy. I like analogies because they don't explain anything. But they put something into another context. We can observe something that we understand and think, OK, so maybe light behaves the same. So let's imagine a little tank. So we have a tank and how a tank moves. The engines are putting forces onto both trucks. So here's our tank from the top. And it is, for example, traveling on the road or on some surface that has a very good traction. So equal force is put onto both of the trucks. And then the tank enters the mud. And as you can see, the left truck of it enters it as the first. So it loses traction. It encounters resistance. So now equal force is put on both of the trucks. But this one, the left one slows down. So what happens when it slows down? The tank turns. Then the second truck enters the mud. Now they have equal resistance. So it will continue going on a straight line. OK, so this is just an analogy. We can also look at it a little bit differently. We have air. We have glass. We have point A in point B. And what is the fastest route from A to B? Well, somebody may say the straight line between A and B. This is not the fastest route. This is the shortest route. But if we simply draw a line between A and B, the light would spend too much time in glass where it moves slower. So if the light takes this path, it will move from A to B the fastest. So OK, now reflection, refraction. Some of the light gets reflected. The rest of it breaks the surface and goes into the object. What happens to this portion of light? The first thing that happens is absorption. So simply some of the light, or all of it, just disappears, vanishes. Well, technically, nothing can simply vanish. The energy of light is converted to heat. But for us, it doesn't matter. So we say, OK, it vanishes. This vanishing, this absorption, may be selective. So some color gets absorbed, some don't. So when blue light gets absorbed, we have the yellow appearance of the object. And the rest of the light gets scattered. And of course, we can have a different amount of this scattering. And this is scattering. So we see that the light goes into the object and begin to somehow bounce off the particles inside of it, so-called scattering particles. And so those atoms, molecules, groups of molecules, whatever. So there is some interaction. And when the scattering is strong enough, it prevents the light from going through the object. But the light will escape pretty close to the entry point. And it will escape in various directions. This thing is so chaotic that when we sum all of those behaviors, we have a very, very even distribution of light. So we have reflection, absorption, scattering. So let's translate it into the shader. So reflectivity, I talked about reflectivity. So it's governed by this function that I put into the factor. And I simply use the glossy shader. And this gives me the reflectivity. Now, what about the rest of the stuff, so scattering and absorptions? Here, we can see different objects. And we have growing scattering to the right, growing absorption to top. And now we model this by putting some shader or some mixture of the shaders into the first socket of our mixed shader. So for example, we want to create this one, so the water or glass. We can put the refraction node with a white color here. And we have it. Of course, someone can say, well, we have the glass nodes, don't we? So we can simply use this. Yes, we can. But I simply wanted to show you a different way. Here, we have maybe a little bit better control, maybe change some behaviors a little bit easier. In the glass shader, we don't have so many sliders. We all love sliders. Now, let's create this one. So it's also zero scattering, but some absorptions. So again, refraction. But this time, I gave it a color. Here, this one, I would say that maybe it's translucent. This one, maybe this is a subsurface scattering, something like that. OK, let's create a snooker bowl. So this is diffuse. So this is how we do it. So we have several nodes that simply govern exactly the same physical phenomenon scattering with absorption. But there are many of them. Why don't we have just one node with two sliders scattering absorption? Well, in some cases, there is no use to calculate several things. When we have the material that is diffuse, that acts like a diffuse, we don't need index of refraction. We don't need many other things. So we simply choose those shaders having in mind how intensive it is to compute. So for example, let's say we have to choose between diffuse and subsurface scattering. How do we choose between the two? Let's once again take a look at the physical behavior of the light and the scattering. So we see that the light enters the object, scatters, and then exit. And we have some distances, various distances, between the entry-exit point. And let's imagine that we are really, really zoomed in right now. And this circle that is drawn here represents the area that we sample, something really, really tiny, smaller than the pixel. And if it happens so that those outgoing lights, the distances between entry-exit points are pretty close, are shorter than the radius of the circle, then we should simply use diffuse. So we simply say that those distances are zero and everything becomes pretty simple. In other case, here this sampled area is small compared to the distances. So in this case, we should use the subsurface scattering. How do we decide normally when we are building shaders? We see that it depends on, it is relative. It depends on the distances. So when we are close to something, sometimes even if we normally wouldn't use subsurface scattering like in plastic, we should use it because some of this behavior should be visible. And on the other hand, normally when you're creating skin, well, subsurface scattering, we should use it. But when the person is very, very far away, those relative distances are just so small that it's no use. You can freely simply model this using diffuse shader. Okay, Fresnel. What is this? Again, the graph of the Fresnel, we have reflectivity and angle of incidence. Now, generally Fresnel is the mathematical function. And as you can see, it's pretty simple. Okay, it's not that simple because I didn't want to throw at you any complicated equation at the start. It's half of the sum of the reflectors of the light S polarized and of the light P polarized. What does it mean? Doesn't matter. We have RS and we have RP. Okay, so those are RS and RP, so those are monsters. Just imagine, it's even for a computer. It's like impossible to compute. Okay, so that's why for ages, many render engines was using some simplified versions of it. Something that is called Schlick's approximation. And this is the equation much simpler. And what is important here? We don't have, let me go back. Here, all of the letters N, for example, N1 is the index of refraction of the medium that we are coming from. And two is the index of refraction of the medium that we are coming in. So those are indices of refraction. And it's not that easy to author the material when we are using those scientific values. We would rather want to control it by colors, by some simple sliders that behave as we expect. So here, as you can see, R0, R0 is the reflectivity when we look at the object that on, zero degrees angle. And this is, of course, the combination of N1 and N2 and so on. But in the main equation, we simply use this reflectivity at zero degrees. So we can say, okay, 4% reflectivity. And the rest of it will be governed by the equation. Here, what I wanted to show you is this is the approximation. So Schlick's approximation doesn't give you the correct results. The correct results, the proper results are those lines and dotted lines is the Schlick approximation. So we see differences. And we can say that it's okay, those differences are so small that we can ignore them. Maybe when we look up there on this thing that represents aluminum, we see that this difference may seem huge. But all this is happening in the range of angles between, I don't know, 70 to 90 degrees. So pretty, pretty small area. So we can somehow live with this. What is used in Blender? Well, Blender, in Blender, we decided not to go the easy way. So this monster is used. So it's okay, we should be happy because, well, we are using proper Fresnel. Now, and it is fine, really fine, when we are operating in the ranges of index of refraction from, I don't know, 1.1 to two or three. So this is the reflectance, 1.2, 1.45, 1.6, 2.5. It's fantastic. But we can, and this is good that we can find those real world data. We can find indices of refraction somewhere. This is, in my opinion, the best source to find the real world values. So let's, for example, here we are going into trouble a little bit. Let's, for example, check the silver. Silver, and we see we have refractive index, 0.15 something. Well, I said at the beginning that index of refraction is the speed of light in relation to speed of light in vacuum. And we know there was a guy, Einstein. We know that there is no speed greater than speed of light in vacuum, and this would mean that in silver, light travels faster, impossible. So technically speaking, index of refraction is not the speed of light in the medium, but it's so-called phase velocity. What is phase velocity? I have absolutely no idea, but it is something different. What has been proven is that no information can travel faster than the speed of light in vacuum. But when we are talking about phase velocity, the only thing that I know about it is that, well, it doesn't carry information. That's why it can move faster. But let me not go too much into it. But fine, we found the index of refraction for silver. So we know what to use in our shader. So whoa, and it's a complete disaster. So now what can we do? How do we cope with such situation? This is crazy, this simply doesn't fit. Well, what we can do, we can for example set this index of refraction to something ridiculous. So we will have reflectivity that somehow resembles reflectivity of silver maybe, but it's completely wrong. Why? Because, well, we must know that index of refraction in nature, let's say, it's not just this thing, this n thing. But unfortunately, index of refraction, who is a complex number? So what is a complex number? So this is the complex number. So we have this n plus k times i. It doesn't look very scary. So we have n, we have k. So what is i? Generally, we don't have to know this, but anyway, I will tell you. This is something like this. i squared gives us minus one. Crazy. This is why the complex number, we have the real part and imaginary part. This is imaginary number, mathematicians are aliens. We don't have some solutions to something they figure out. Okay, so let's create a new number. So this is a number and it solves some problems. Anyway, even though the index of refraction is the complex number, we can derive reflectivity that will be the real number. But in Blender, we don't have for now note that has n and k things. So there is one solution, not the easy one. We can use OSL. Here you can see we have the template and the template that is called for now conductive. I will tell you that this doesn't work very well. I made my own version of it because it's not precise. It has some errors, but okay, let's say that it doesn't. So we can use this. So this is how the script looks like. So in order to be able to use open shading language, we have to enable it and then add the script notes to choose our script. And here we have n and k and those look as if they were colors, but we don't care. Those are just three values, okay? So into the end, we simply put the values for red, green and blue channel of n. And here we put something, we put the k values that we read from the sources from refractive index.info. So we may, for example, make gold and we may make gold that is really, really physically correct. So for example, 18 carat gold. What does it mean, 18 carats? So it's 75% of gold and silver, rest, silver and copper in the same proportions. But there's a problem. I want to really be physically correct. I want to do everything exactly as it should be done. Those percentages are measured as a mass, okay? But I'm more interested in the volume, right? So, well, I checked what is the mass of gold of silver of copper and so on and somehow translated those things into the volumes. I checked all of the values, all of the indices of refraction for copper, for silver, for gold, for each of the channels, R, G, B and then combine them together and I was really, really happy because I created a pretty awesome shader. This is a real gold. Wow. And it looks like this. It's real gold now. Let's say that I don't like this color very much. So where do I change it? I don't know. So what I wanted to show you here was don't overdo this. Physically based shading is okay, but don't overdo this. Here is a comparison, okay? We have golden Suzanne and second golden Suzanne. And believe it or not, one of them uses this crazy material that I showed you and the other one uses this. So this or this, sorry. Well, so, well, just let me just sum up. Physically based shading is just a set of rules and the most important thing is to properly handle reflectivity. Base it on the viewing angle, use for now, always treat roughness properly and don't overthink it, don't overdo this. Give yourself the room for artistic input. So that would be all. Thank you very much. And I'm open to questions. Well, first of all, I appreciate very well that you showed all formulas and this carry off us with some imaginary numbers. I like it very much. It was awesome. But I would like to ask you what about temperature? Do you have some solutions for that? Well, we don't see temperature. We see colors, right? So, of course, well, we have the nodes that converts like blackbody node or something like that. Yeah, is that right? So, well, but I don't use it. So I have a question. So, Fresnel is basically about reflectivity and refraction. Why do we use it to calculate the amount of reflection based on the angle since the reflected angle is always equal to the incident angle? That's what I don't understand. It's confusing to me. It's dependent on the viewing angle. So, when you are looking dead on, you have less reflectivity. When you look like this, you have more reflectivity. So, I don't know. This is how world works. I don't know. It's just, it just is so. The surface is more reflective at the grazing angle and less reflective when we look dead on. Is that right? Oh, thank you. If you look at an object, every object will have tiny pores and holes in real life. And if you look at it straight on, then the pores and holes will basically be responsible for some sort of roughness because there's just a tiny bit of scattering where there should be in an optimum mirror if you've turned the glossiness to 100%. The roughness to 0%, there's a perfect reflection but that doesn't exist. So, usually what happens is that you have these tiny pores and holes and if the viewing angle is very flat, those will be kind of squished together. The distance, the subjective distance of the pores and holes will be smaller. So, they will form a more less rough surface, a more glossy surface because you can't really make out the difference anymore. Probably should make it drawing or something, but. No, sorry. You have black and white dots, if you imagine them, you look at them straight on, you can see black and white dots, but if you decrease the angle and you look at them like this, they will form a gray. So that smooths it out and that's why it's more reflective or less rough at the edges at a grazing angle. That's the small thing I wanted to note. You had shown the OSL version of the metal shader that has the metallic fresnel and Lukas is at the moment has a working patch to get exactly this note into cycle. So you won't need to do this crazy setup anymore because we'll get a directly a note for it for metals. That's great news, thank you. Okay, so thank you very much.