Gradients, Poisson's Equation and Light Transport | Two Minute Papers #20

A Two Minute Papers episode that explains gradient-domain rendering for photorealistic image synthesis. It introduces the gradient concept with intuitive height/heat-map analogies, describes solving Poisson's equation to reconstruct an image from gradients, and explains how gradient-domain rendering focuses sampling on illumination changes (edges) to reduce noise and improve efficiency.
Chapters
Dear fellow scholars, this is two minute papers with this is going to be a more in depth episode of the series. Photorealistic 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 in 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 you sure 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 photorealistic 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 bluer 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 ones 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 renderer. 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 previous 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 white 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 example 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 white 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 would be a large red arrow pointing from the white to the red dot. And 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 tried 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 rays 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 in 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 F2XN 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 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 comment section below. Thanks for watching and I'll see you next time.










