 Let's talk about just briefly about the PBRT architecture. PBRT is not exactly the renderer that we are going to use. We're going to use LuxRender, but LuxRender was built upon PBRT and therefore the basic structure remained completely intact and this is a really good architecture that you would see that many of the renderer engines out there, globally illumination rendering engines out their use. Most of them use the very same architecture. So we have a main sampler render test that asks the sampler to provide random samples. So the sampler you can imagine as a random number generator. We need a lot of different random numbers because the pixel that we are sampling, some techniques choose it deterministically going from pixel to pixel. Some techniques take pixels randomly. I mean which pixel we choose to be sampled is usually deterministic but the displacement because we would be sampling the pixels not in not only in the midpoint like recursive ray tracing but you you would take completely random samples from nearby and use filtering to send them up in a meaningful way. Now this requires random numbers they come from the sampler. You would also send outgoing rays in the hemisphere of different objects. You also need random numbers for this. So in this sample these random numbers arrive and this sample you would send to the camera and the camera would give back to you array. So you tell the camera please give me a array that points to this pixel and this camera would give you back array which starts from the camera starting point and points exactly there. Now all you need to do is give this ray to the integrator and the integrator will tell you how much radiance is coming along this ray. And what you can do after that is write it to a film and this is not necessarily trivial because for instance you could just simply write it to a ppm or a png file and be done with it. In contrast what what LuxRender does is it has a film class and what you can do is that you can save different for instance different contributions in different buffers. So what you could do is for instance separate direct and the indirect illumination into different films, different images. And then you can in the end sum them up but maybe you could say that I don't need postics on this image and then you would just talk that image. So you can do tricky things if you have a correctly implemented film class. Okay so LuxRender just what I have been talking about is built upon VBRT and uses the very same architecture. This is how it looks so it has graphical user interface and you can also manipulate different tone wrapping algorithms in there, different denoising, image denoising algorithms in there and you can even manipulate light groups. This is another tricky thing with the film class. Basically what this means is that you save the contributions of different light sources into different films by films you can imagine. Image files. So every single light source has a different png file if you will and they are saved into there and the final image would come up as a sum, a sum of these individual films but you could say that one of the light sources is a bit too bright. I would like to tone it down but if you want to tone it down then you would have to revender your image because you changed the physical properties of what's going on. Now you can do this if you have this light groups option because they are stored into individual buffers so you can just dim one of these images and just add them up together and then you would have the effect of that light source a bit dimmer. You can for instance completely turn off sunlight or television that you don't that you don't want to use in the scene. It sounded like a good idea but it wasn't. You can just turn it off without rendering the scene. You can operate all of these things in the through the Luxor under GUI. Now before we go into algorithms let's talk about algorithm classes what kinds of algorithms are we interested in. First what we are interested in is consistent algorithms. Consistent means that if I use an infinite number of Monte Carlo samples then I would converge exactly to the right answer. I would get back the exact interval of the function. Intuitively it says if I run this algorithm sooner or later it will converge. It also is important to note that no one said anything about when this sooner or later happens. So if an algorithm is consistent it doesn't mean that it is fast it doesn't mean that it's slow it can be anything absolutely anything. It may be that there is an algorithm that's theoretically consistent. So after an infinite amount of samples you would get the right answer but it really feels like infinity. So it may be that after two weeks you still don't get the correct image. There are algorithms like that and theoretically that's consistent that's fine because you can prove that it's gonna converge sooner or later. The more difficult class that many people seem to mess up is unbiased algorithms. Now what does it mean? If you just read the formula then you can see that the expected error of the estimation is zero and we have to note that this is completely independent of n. n is the number of samples that we have taken. The expected error of the estimation is zero. It doesn't mean that the error is zero because it's independent of the number of samples. It doesn't mean that after one sample per pixel I get the right result. It says that the expected error is zero. I will give you many intuitions of this for this because it is very easy to misunderstand and misinterpret because in statistics there is a difference between expected value and variance and this doesn't say anything about the variance. This only tells you about the expected values. So for instance if you are a mathematician and think a bit about this and you could say that if I have an unbiased algorithm and I have two noisy images you render something on your machine. I render something on my machine that's two noisy images. I could merge them together. I could average them because they are unbiased samples. It doesn't matter where they come from. I would add these samples together every step and I would get a better solution. We will see an example for that. My favorite intuition is that the algorithm has the very same chance of over and underestimating the integrand. So it means that if I would try to estimate the outcome of a dice roll the expected value you can you can roll from 1 to 6 with equal probabilities. The expected value is 3.5. So this means that I would have the very same probability of saying 4 as I would have the probability for saying 3. So it's the very same chance to under and overestimate the integrand. And I'll give you my other favorite intuition. This is what journalists tend to like the best. It means that there is no systematic error in the algorithm. The algorithm doesn't cut corners. And if there are errors in the image then this can be only noise and this noise comes because you don't have enough samples and if you add more you're guaranteed to get better. Now let's take another look at this really good intuition. So I can combine together two noisy images. So this means that I should be able to do network rendering without actually using a network which sounds a bit mind-boggling. I really like the parallel to this which is a famous saying of Einstein from long ago where they talked about sending electromagnetic waves out and they talked about the telephone and people could not grasp the idea of a telephone. And he said that we would have a super super long cat. One the tail of the cat would be in Manhattan and if you would just pull the tail of the cat in Manhattan then the front of the cat would be in New York and if you pull the tail in Manhattan then she would say meow in New York. And he asked the people is this understandable? Yes this is understandable. Okay perfect we're almost there. Now imagine that there's no cat. And this is the exact same thing. So this is network rendering without an actual network. Well okay mathematical theories okay but let's actually let's give it a try. So what I did here is I rendered this interior scene and this is how it looks like after two minutes. It's really noisy right? Now what I did is I ran 10 of these rendering processes and saved the images 10 times. So I didn't run one rendering process for long. I ran many completely independent rendering processes for two two minutes and what I did is I merged the images together. What it means is that I averaged the images. I added them together and averaged them. Now basically this means that you could do this on completely independent computers that have never heard of each other. And now let's take a look. This is the noisy image that we had and now let's merge 10 of these together. This is what we will get. Look closely. Look at that. Now one more time. This is the noisy after two minutes and this is merging some of these noisy images together. So this is unbelievable that this actually works. So if you have unbiased algorithms you can expect this kind of behavior and you don't need to sophisticated networking to use your pathfacer for instance in a network because you don't need the network at all and this is really awesome. No because if you don't add any kind of seed to your computations then you're computing completely independent samples and it doesn't matter if the sample is computed on the same machine or in a different machine. If you have some kind of determinism then it may be possible that the same paths are computed by multiple machine and that's indeed wasted time. But otherwise it works just fine. Now let's practice a bit. Instead there's a question. Yeah. Just how's the biggest difference between one picture of renders 20 minutes and 10 pictures rendered two minutes each and then combined? Nothing. In terms of samples nothing. The only difference is that you actually need to fire up that scene on multiple machines. So if there is like 10 gigabytes of textures then it takes longer to load it up on multiple machines and and maybe transfer the data together but if you think only in terms of sample it doesn't matter where it comes from. Okay let's practice a bit. We have different techniques and this is how the error is evolving in time. Now the intuition of consistent means that the error tends to zero over time so if I render for long enough then the error is going to be zero. Is this black one a consistent algorithm? Nope because it converges here to the dashed line and not to zero. Now what about the other two guys? Are they consistent or not? Okay. The error seems to converge to zero. Okay now what about these techniques? Are they biased or unbiased? Which is which? What about this one? This is the darker gray. Is this biased or unbiased? Now if we have this intuition that if we render for more the image is guaranteed to get better or at least not worse then this darker is definitely not unbiased because it is possible that I'm rendering for 10 minutes that's this point for instance and I say okay I almost have a good enough image and I render for another five image and expect it to be better and then I get this maybe a completely garbled up image full of artifacts and errors and that is entirely possible with biased algorithms. No one said that it's likely but it is possible so you cannot really predict how the error would evolve in time and if you take a look at the other two lines you can see that they are unbiased algorithms so as you render for longer you are guaranteed to get a better image.