 Next time, what you will see is something that was missing from many of the bigger mutations of many assignments. What is the complexity of the ray tracing algorithm depend on? What depends on the resolution? The bigger the image, the more it takes, got it? It is exponential with respect to the depth. At least this implementation is, if you shoot out two rays, there is always a branching. Then this is going to be exponential. So we have taken into consideration resolution, we have taken into consideration depth. But we haven't taken into consideration how many objects there are in the scene. And if you start running the same ray tracer on huge scene because you don't want to see spheres, you want to do ray tracing like real men do, then what you do is you implement a function that can load you triangle meshes. And then you just grab a nice triangle meshes and I've seen from somewhere loaded to your ray tracer and you're very excited the run the ray tracer and you don't get anything in your whole lifetime. If you load something with millions of hours, it's not much nowadays. Why? Someone help you out. Just face to wrong. That's true, but why does it take a lot? Because you have to do a lot of intersection tests. Exactly. So I have, if I have one million objects, I have to do one million intersections every single time. That's too much. It's just way too much. So what we can do is that we can do some kind of space partitioning, which means that simple optimizations I can do. For instance, I really don't care what is behind me because I'm going to intersect something that's in front of me. So whenever it's behind me, I can immediately throw this all of those polygons out. That's immediately half of it. And if you use smart tricks and key details, smart tricks, smart data structures, you can go from linear, while in here, one million objects, one million intersections. So that's linear complexity. You can go to logarithmic complexity, which is amazing because the logarithm after a point doesn't really increase too much. And you will learn about techniques that will make you able to compute this intersection with one million objects with about four or five intersections on average. Obviously, obviously it depends on the distribution of the triangles and all of that. But on average, you can do it in four or five intersections instead of one million. So it's a huge, huge speed up. This is going to be on the next lecture. And again, it seems that I have been lying to you all along regarding this as well, because I told you that we are measuring radians for the random equation. Now, radians, I cannot really display on my monitor. What can I display on my monitor? RGB values. So there has to be some transformation that comes from radians and conversing to RGB in a meaningful way. This process is called tone mapping. And Thomas is going to tell you all about tone mapping as well. You can do it in a number of different ways. It's heavily going to be built. And a good tone mapping method really breathes life into your render images. Now, we haven't talked about filtering. This is a bit more sophisticated. Recursivariating, you should one sample through the midpoint of the pixels. For the scene, you computed this year down. With Monte Carlo integration, we are going to have many samples. So we are going to have a metric that's called samples for pixel. And these samples will not go through the midpoint of the pixel. These are going to go through the surface of the pixel, like a random samples over the surface of the pixel. And we are going to integrate radians over the whole surface. Now, you can do this differently because you have many samples over the pixel surface. And you can take into consideration them into consideration in different ways. And you can see that different filtering methods, this is what we both filtering. A different filtering methods will give you different results. And the interesting part is that you will get anti aliasing for free if you do filtering well. Because in a ray tracer, you will shoot one ray through the midpoint of the pixel. Your images, unless they are super high resolution, they are going to be elious. The completely straight line is going to be pixelated. The edges are going to be pixelated. What can you do? Fibial things like supersampling. Let's split one pixel into four other pixels, or smaller pixels, and compute the rays through all of them and average. That's the Fibial method. That gives you anti aliasing by supersampling. But this is super expensive. I mean, you have HD resolutions, and you have to bump this up by even four times. Too much. There's better solutions. You can get this for free in your preliminary examination if you do filter. So this is what filtering is about. Thomas is also going to talk. This is not one lecture. This is the next three lectures. It's going to talk about participating in media. What is this about? Well, in our simulation so far, we have taken into consideration that rays of light only bounce off of surfaces. But in real life, there's not only surfaces. There's volumes. There's smoke. Hayes. Many of these effects, where ray of light can not really hit an object, but just a smoke, and gets carried. And if you do your simulation in a way that it supports such a participating medium, then you can get volume costings. And that's amazing because I just have shown you the ring. And whatever else kind of costings you will look at, you will think of those as some 2D things that I see it on the table. This diffuse material that diffuses this radiance back to me. So you would think that costings and shadows are play hard. They are 2D things. But they are, in fact, volumes. So the shadows exist not only the plane, but they have a volume. Because the set of points that are extracted from the light source are not on the plane. They are in 3D. And you can get volumetric costings and volume shadows with participating in media. Because there will be a media in there of which light can scatter. So therefore, you will see these boundaries. You can also get god rays, beautiful phenomena in the nature if you compute the participants. You can also get something like this. This is an actual photograph just to make sure that you see the difference that the first ray is traversing air or vacuum. And the next ones have a participating video, which can give you this effect, this scattering effect. And another example of god rays, while apparently we have this do not disturb a piece of paper. So there is some luxur under and then going on in this room. You better not enter. Who knows what you will see? And you can get not necessarily set for now's effects, but the more subtle effect. You can feel that there is some haze in this image. But it's not so perfect. Now, we don't stop there because don't just think of smoke and atmosphere. You can just look at your own skin if you would like to see some participating video. Now, this is a phenomenon called subsurface scattering. And this means that some of the things that you would think are objects, are surfaces, are in fact volumes. This is your skin, for instance. Light goes through your skin, the portion of light. And we don't simulate that because when we hit the surface of the object, we bounce during the back. And if we write a simulation that makes us able to go inside these objects, then we have a simulation with subsurface scattering. And we can account for beautiful, beautiful effects like this. These are some simulations. So for instance, on the left side, you can see probably marble. There is subsurface scattering in Marwood. It seems heavily exaggerated to me. Or either there is a really, really strong backlight thing. But this is not a surface anymore. You can see the nose of the lady light, lots of the radiance, actually gets through the nose. This is one more example. This is not so pronounced. This is not so exaggerated. But you can see this j-dragum clearly has some subsurface scattering. Look at the optically thin parts. Like the end of the tail. You can see that it's much lighter. And this is because some of the light is going through it. And the optically thick parts, like the body of the dragon, have less subsurface scattering. So you can see that this is a bit darker. It's a beautiful phenomenon. And we can also simulate this. And look at this one. Absolutely amazing. That doesn't just look amazing. This is incredibly awesome. We can write computer programs if we compute this. It's reasonably well known this time. So absolutely beautiful phenomenon. Let's look at this as well. This is a fractal with subsurface scattering. I mean, how cool can someone get its fractals and subsurface scattering? It's like two of the best foods mixed together. It has to be something also. And another example of a beautiful j-crag. Well, just a bit of subsurface scattering. So that's going to be it for today. And there is going to be the next three lectures with Thomas. These are all the exciting things that are going to be discussed. And then we will complete the Monte Carlo integration. I will tell you how I like to use exactly and how to use mathematics to see through these lines. And then we will write our global illumination program. Thank you.