TU Wien Rendering #18 - Coming Up Next: BVH, Tone Mapping, SSS

A rendering lecture previews ray-tracing optimization using BVH structures to reduce intersection checks from linear to logarithmic time, then covers tone mapping, Monte Carlo sampling, participating media like volumetric caustics, and subsurface scattering with examples including marble and jade.
Chapters
Next time, what you will see is something that was missing from many of the big O notations of many assignments. What is the complexity of the ray tracing algorithm depend on? Well, it depends on the resolution. The bigger the image, the longer it takes. Got 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 a 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 your triangle meshes, and then you just grab a nice triangle mesh, a nice seam from somewhere, load it to your ray tracer, and you very excitedly run the ray tracer and you don't get anything in your whole lifetime. If you load something with millions of polygons, which is not much nowadays, why someone else? Yeah, it just takes too long. That's true. But why does it take too long? Because you have to do a lot of intersection tests. Exactly. So if I have 1 million objects, I have to do 1 million intersections every single time. That's too much. That'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 whatever is 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 KD trees, smart tricks, smart data structures, you can go from linear, while linear, 1 million objects, 1 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 like 1 million objects with about 4 or 5 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 1 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 rendering 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 radiance and converts it 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 non trivial and a good tone mapping method really breathes life into your rendered images. Now, we haven't talked about filtering. This is a bit more sophisticated recursive ray tracing. You shoot one sample through the midpoint of the pixels to the scene. You computed this, you're done. With Monte Carlo integration, we are going to have many samples. So we are going to have a metric that's called samples per 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 random samples over the surface of the pixel. And we are going to integrate the radiance 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 call filtering. And 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 raytracer you will shoot one ray through the midpoint of the pixel. Your images, unless they are super high resolution, they are going to be aliased. A completely straight line is going to be pixelated, the edges are going to be pixelated. What can you do? Trivial things like super sampling. Let's split one pixel into four other pixels, four smaller pixels and compute the rays through all of them. And average. That's the trivial method that gives you anti aliasing by super sampling. But this is super expensive. I mean you have HD resolutions and you have to bump this up by even four times. It's too much. There's better solutions. You can get this for free in global illumination if you do filtering right? So this is what filtering is about. Thomas is also going to talk. This is not one lecture, this is the next three lectures. He's going to talk about participating 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, heat, case. Many of these effects where a Ray of light can not really hit an object, but just a smoke and get scattered. And if you do your simulation in a way that it supports such a participating medium, then you can get volume caustics. And that's amazing because I just have shown you the ring and whatever else kind of caustics 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 caustics and shadows are planar. They are 2D things, but they are in fact volumes. So the shadows exist not only the plane, but but they have a volume because the set of points that are obstructed from the light source are not on the plane. They are in 3D. And you can get volumetric caustics and volume shadows with participating media because there will be a medium in there of which light can scatter. So therefore you will see these boundaries. You can also get God rays, beautiful phenomena in nature. If you compute. 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 medium which can give you this effect, the scattering effect. And another example of God rays. Well, apparently we have this do not disturb piece of paper. So there is some lux renderer rendering going on in this room. You better not enter. Who knows what you will see. And you can get not necessarily such pronounced effects, but a more subtle effect. You can feel that there is some haze in this image, but it's not so pronounced. 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 we call 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, a portion of light. And we don't simulate that because when we hit the surface of the object, we bounce the impact. 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 marble. It seems heavily exaggerated to me, or either there is a really, really strong backlighting, but this is not a surface anymore. You can see the nose of the LED 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 jade dragon 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. Doesn't this look amazing? This is incredibly awesome. We can write computer programs that can compute this reasonable amount of 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 awesome. And another example of a beautiful jade dragon with just a bit of subsurface scatter. So that's going to be it for today. And there's 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 lied to you. Exactly. And how to use mathematics to see through these lies. And then we will write our Global Illumination Program. Thank you.










