 Now there's another fundamental question which is what makes the difference between different materials? And the other question is how do we model it? Well different materials reflecting coming right to different directions and they absorb different amounts of it in different wavelengths. That's the answer. We are going to talk a lot about this, but this is an example. These are different material models. So the specular case, there is one incoming direction and there is one possible output in direction. That's it. This is what always happens. This is for instance a mirror because I see exactly the reflection of myself. There's no other thing that I see in the mirror. But for a diffuse surface, for one incoming direction, there is many possible outcomes in many possible directions. And this gives a diffuse surface. We are going to see examples of that. It writes spread. Please forget this term. Let's call this go or see instead because this is what it is. This is like the mixture of these two. So these are some basic material models that we are going to see in our renderers later on. Now to formalize this in a way, let's create a function that's a probability density function with three parameters. So this is a three-dimensional function. One variable is the incoming light direction. The other variable is a point on the surface. And what I'm interested in is how much light is flowing out from this point in different directions. Now a bit more formalized. This FR is going to be this function. I'm interested in the incoming direction and the point in space. This is true is what I have. And I would be interested in the outgoing directions. What is the probability of different outgoing directions? And this is how we will write formally. Omega is an incoming direction. The x is the point in space that we choose. And omega prime is the outgoing direction. And this we call the BRDF or by direction or reflect as distribution of function. So this is a very complicated name for something that's very simple. BRDF. Now what about materials that don't reflect all incoming light? There are some materials that transmit some of it. So for instance glass, water, gemstones and such. But it could look like that. And here above you can see some BRDFs and below you can see some things because it's not reflected. It's transmitted. There are some materials that let them flew. So here's an example. Well everyone had seen windows and things like that. Well, the question is why, like just a physical question, why are these objects transparent? Sorry? Yes, they transmit the light. But what is happening here exactly? So just some physical intricacy that the most fundamental question, you know, what is inside of an ever? And the best answer is nothing because an atom is 99% empty space. There is the nucleus, which is the whole atom is the size, for instance, of a football field. If you imagine that. Then the nucleus is a small piece of rice in the middle of the football field. That's the nucleus. And the electrons are also very small things like small rises, which are orbiting the nucleus from very far away, like the side sides of the football field. And in between, there's nothing. Absolutely nothing. So the more interesting question will be why is not everything transparent? I mean, there is absolutely nothing in there that would divert the or absorb the light. Right? Everything just everything should go through. Why is not everything transparent, not only glass, but everything. And the reason is absorption. So these electrons are orbiting the nucleus. And what essentially is happening is that electrons can absorb hormones. Phonons are, if you imagine, light as much rays or not waves, but particles, then the phonon is the basic particle of light. So electrons, they absorb hormones. And if they do, they go from an inner orbit, like a lower energy level. They jump to a higher energy level. Because it's basically you after lunch, you eat something, you get more energetic, you get more jumpy. So it jumps to an outer orbit from the nucleus. It's a bit further away. So it absorbs the light so the light doesn't go through. So this is why most things are not transparent. But the question is why is 10 glass transparent? And the answer is that these orbits, these different places around the nucleus, they are so far apart that in the visible light spectrum, if the electrons absorb a photon, they don't get enough energy to jump to the next orbit. This is why most of the light is going through these plastic materials. And the interesting thing is that this is not always the case. This is the case for visible light spectrum. There is another spectrum, which is absorbed. So if you have a spectrum that gives that is a higher energy spectrum, then it may give enough energy for this electron to jump to a different orbit. And we can easily find out what spectrum it is. Because for instance we use glass for a number of different beneficial things. Well, for instance, you cannot get sunburn if you are inside of the house and you have your windows closed. And we are wearing sun glasses in order to protect our eyes from something. So is there someone who tells me what this spectrum is? That is exactly just a bit louder. Ultraviolet. So ultraviolet is a spectrum with a higher amount of energy. And if you absorb it, then this jump is possible. So this is why it is absorbed. So just some physical intricacies. So lights may get reflected. If we have a material that most of the time reflects light, then we call it the BRDF. The BR is the interesting part. That is the reflection. And if it transmits, it is possible with the material model. We have the BTDF, which is the bidirectional transmittance distribution function. And as an umbrella term for both of these, this is basically the whatever term is BSDF. So bidirectional scattering distribution function. I am not saying this because this is lots of fun. I am saying this because you are going to find these terms in the literature all the time. So BSDF is basically things that reflect and things that transmit. Okay, what are the properties of BRDS? And after this, we will suddenly put together something beautiful, very rapidly. So there is handholds reciprocity. It means that the direction of the ray of light can be reversed. What it means mathematically is that I can swap the incoming and outgoing directions. And I am going to get the same probabilities. So the probability of going here to there is the same probability as coming from there to here. If I look at things from both sides, I will get the same probabilities. So that is often useful in physics. Positivity, this is a suffix for a Tory. Well, it cannot be less than zero. A probability cannot be less than zero. For every outgoing direction, there is some positive probability or there is zero. That is it. Nothing else is really possible. So formally this is how it looks like and it makes some additions awfully happy. And there is energy conservation, perhaps the most important probability. An object may reflect or absorb incoming light, but it is impossible that more is coming out than the incoming amount. Well, obviously we have light sources and things like that, but we are talking about street interior models. So this means that if I integrate this function for all possible incoming directions, then I get, if I take into consideration light attenuation that we have talked about, this is why it is so hot and known and why it is so cold at night, then I am going to get one or less. And this is because if it equals one, then this means that this kind of material reflects all light that comes in. And if it is less than one, then this means that some amount of light is absorbed. Okay, we are almost there at the rendering equation. Generally what we are going to do is that we pick a point x and this direction is going to point towards the camera or my eye. This basically means the same thing. It is just an abstraction. And what I am going to be doing is I am going to sum up all the possible incoming directions where light can come to this point and I am interested in how much is reflected towards my direction. And let us not forget that objects can emit light themselves. And we will also compute this reflected amount of light. So just intuition, light exiting the surface towards my eye is the amount that it emits itself, it is a light source, and the amount that it reflects from the incoming light that comes from the surroundings. And this is how we can formally write this with this beautiful integral equation. Let us see, let us tear it a some and see what means what. This is the emitted light. So this is light from point x going towards my eye. How much of it? Well the amount that is in point x emitted towards my eye, if it is a light source like that one, then I definitely have this amount. And there is an amount the battery left that is reflected. Let us see what is going on. This is what I just told you. And again, and this is the integration. This is the interesting part. So I am integrating this omega prime. So all possible incoming directions. What you have seen the hemisphere on the previous image. hemisphere means basically half the one half of the sphere. We are integrating over a hemisphere not over a full sphere because if we take into consideration the cosine, if the light comes from above that cosine 0 degrees is 1. And as I rotate this light source around this point, then this cosine will get to 90 degrees. So from here to there. And the cosine of 90 degrees is 0. Therefore there is going to be no throughput if it comes from that direction. And if I have something that is higher that would be negative. We don't deal with these cases. So this is why I am integrating over a hemisphere. So some light is coming to this point in different directions. And what I am interested in is how much is this of this light is reflected towards my eye. This is multiplied by the incoming radiance. There is the PRDF and light attenuation. That's it. This is still a bit difficult. This is still a bit conducive. So first we are going to train ourselves like bodybuilders on smaller weights. So we are going to create an easier version of this. Because apparently this is terribly difficult to solve. If you take a look and if you sit down and try to solve it for a difficult scene where you have objects and geometries and different PRDFs, different material models, you will find that this is impossible to solve analytically. And one of the first problems is yes. This is the equation is just for one point. So we are looking at one point and then we want to calculate. Yes. And here comes the catch. So I am interested in how much light is going towards my eye from this point. How much is it? Well it depends. If I turn on other light sources then this point is going to be brighter. Because the radiance coming out of this point depends on its surroundings. Is the window open? Are the curtains cool or not? So x, this point x depends on this other point y, for instance. All other points. Then we can say let's not compute this x first. Let's compute this y point instead first because then I will know x. But this y also depends on x because how bright light is on the other side of the room also depends on how bright it is in this side of the room. So there is some recursion in there. And if you don't think out of the box this is impossible to solve because you don't know where to start. This integral is hopeless to compute in closed form because there may be shapes of different objects in there and this will make integration immensely difficult. The integral is infinite dimensional. Later you will see that if I compute 1 bounce this x that I have been talking about that's okay. But I need to compute multiple bounces. I need to start tracing rays from the camera and see how much light is entering the lens of the camera. But 1 bounce is not enough. Is 2 bounces enough? So after the x I continue somewhere else. Is this enough? Say something. It's not enough. Okay. But I think maybe 3 is enough. It's 3 enough. It's not enough. Okay. Well, you guys are very picky. Okay. Is 10 bounces enough? Okay. Why not? Because there is still some amount of energy left. If I would continue this light path I would encounter other objects and I don't have any knowledge of that. We need to compute an infinite amount of bounces. Even 1000 is not enough. So and this rendering equation is going to be 1.1 bounce. And if I want to compute the second bounce that's going to be embedded there's going to be embedded another integration another rendering equation. And this goes on infinitely. This is the biggest equation in the whole universe. It's impossible to solve. And it is often singular. I will later show you why. So even if you would want to integrate it you could. So this is far a bit difficult. This seems impossible. And apparently at this point we cannot solve it. So this is the end of the course. And we have an impossible problem. There is no reason even to try. And goodbye. See you. Never because there's never going to be any more actors. But in order to understand what's going on first we're going to put together a simple version of this equation that we can understand and we can work our way up. There is another formulation of the rendering equation and not going to deal with this too much. You can imagine this other version as moving points around. So there is a light source in P3 and there is the sensor at P0. And this is one example light path. And what I'm doing is I'm not stopping at one point and integrating all possible incoming directions. Because this is what I did with the original formulation. What I do is I compute one light path. I compute how much light is going through. I add that to the sensor. And then I move this P2 around. I move it a bit. I compute the new light path. How much is going through? I move this P2 around again. So imagine this moving everywhere. And imagine also P1 moving everywhere. So all these points are moving everywhere. And I compute the contribution of this light source to the sensor. So this is another kind of integration. I'm not going to go through this. What is interesting is that there is a geometry term in there. And this describes the geometry relation of different points and light attenuation between them. I'm not going to deal with this too much. I just put it here because if you are interested then true your way through it. In literature they often write it this way.