 Dear Fellow Scholars, this is 2 Minute Papers with Károly Zsolnai-Fehér. This is going to be a more in-depth episode of the series. Photo-realistic rendering means that we create a 3D model of a scene on a computer and we run a light simulation program that shows how it would look like in reality. These programs simulate rays of light that connect the camera to the light sources and the scene and compute the flow of energy between them. If you have missed our earlier episode on Metropolis Light Transport and if you're interested, make sure to watch it first, I've put a link in the description box. This time, let's go one step beyond classical light transport algorithms and talk about a gradient domain rendering technique and how we can use it to create photo-realistic images quicker. First of all, what is a gradient? The gradient is a mathematical concept. Let's imagine an elevation map of a country where there are many hills and many flat regions. And imagine that you are an ambitious hill climber who is looking for a challenge, therefore you would always like to go in a direction that seems to be the highest elevation increase. The biggest rock that you can climb nearby. The gradient is a bunch of arrows that always point in the direction of the largest increase on the map. Here with blue, you can see the elevation map with the mountains and below it with red, the gradient of this elevation map. This is where you should be going if you are looking for a challenge. It is essentially a guidebook for aspiring hill climbers. One more example with a heat map. The blue or colors denote colder, the reddish colors show the warmer regions. If you are freezing, the gradients will show you where you should go to warm up. So if you have the elevation map, it is really easy to create the gradients out of it. But what if we have it the other way around? This would mean that we only have the guidebook, the red arrows, and from that we would like to guess what the blue elevation map looks like. It's like a crossword puzzle, only way cooler. In mathematics, we call this procedure solving the Poisson equation. So let's try to solve it by hand. I look at the middle where there are no arrows pointing in this direction, only once that point out of here. Meaning that there is an increase outwards, therefore this has to be a huge hole. If I look at the corners, I don't see very long arrows, meaning that there is no real change in these parts, therefore it must be a flat region. So we can solve this Poisson equation and recreate the map from the guidebook. To see what this is good for, let's jump right into the gradient domain render. Imagine that we have this simple scene with a light source, an object that occludes the light source, and the camera looking down on this shadow edge. Let's rip out this region and create a close-up of it. Imagine that the light regions are large hills on the elevation map, and the shadow edge is the ground level below those. These algorithms were looking to shoot as many rays as possible towards the brighter regions, but not this one. The gradient domain algorithm is looking for gradients, abrupt changes in the illumination, if you will. You can see these wide red pairs next to each other. These are the places where the algorithm concentrates. If we compute the difference between them, we get the gradients of our elevation map. In these regions, the difference is zero, therefore we would have infinitely small arrows, and from the previous examples, we solve the Poisson equation to get the blue map back from the red arrows. The small arrows mean that we have a completely flat region, so we can recognize that we have a wide wall in the background by just looking at a few places, we don't need to explore every inch of it, like previous algorithms do. And as you can see at the shadow edge, the algorithm is quite interested in this change. In our gradients, there will be a large red arrow pointing from the white to the red dot, because we are going from the darkness to a light region. After solving the Poisson equation, we recognize that there should be a huge jump here. So in the end, with this technique, we can often get a much better idea of the illumination in the scene than we did with previous methods that just try to explore every single inch of it. The result is improved output images with much less noise, even though the gradient domain renderer computed much less raised than the previous random algorithm. Excellent piece of work, bravo! Now that we understand what gradients and Poisson's equation is, let's play a quick game together and try to learn these mathematical concepts from the internet like an undergrad student would do. And before you run away and terror, this is not supposed to be pleasant. I'll try to make a point after reading this. In mathematics, the gradient is a generalization of the usual concept of derivative of a function in one dimension to a function in several dimensions. If f of x1 to xn is a differentiable scalar valued function of standard Cartesian coordinates in Euclidean space, its gradient is the vector whose components are the n partial derivatives of f. It is thus a vector valued function. Now let's proceed to Poisson's equation. In mathematics, Poisson's equation is a partial differential equation of elliptic type with broad utility in electrostatics, mechanical engineering and theoretical physics. It is used, for instance, to describe the potential energy field caused by a given charge or mass density distribution. This piece of text is one of the reasons why I started two-minute papers. I try to pull the curtains and show that difficult mathematical and scientific concepts often conceal very simple and intuitive ideas that anyone can understand. And I am delighted to have you by my side on this journey. This was anything but two minutes. I incorporated a bit more details for you to have a deeper understanding of this incredible work. I hope you don't mind. Let me know if you liked it in the comments section below. Thanks for watching and I'll see you next time.