# TU Wien Rendering #11 - Recursion and Heckbert's Taxonomy

## Метаданные

- **Канал:** Two Minute Papers
- **YouTube:** https://www.youtube.com/watch?v=Qgsos_kz6pM
- **Дата:** 30.03.2015
- **Длительность:** 12:12
- **Просмотры:** 7,095

## Описание

We now know how to intersect a ray with a scene and how to perform simple shading operations. However, this only means one bounce. In real life, rays of light bounce many more times than one. We handle this problem with recursion by reflecting the ray of light off of the surface and start the process again as if the new surface were the camera. We also discuss Paul Heckbert's taxonomy to classify different light transport algorithms based on what kind of light paths they can compute.

About the course:
This course aims to give an overview of basic and state-of-the-art methods of rendering. Offline methods such as ray and path tracing, photon mapping and many other algorithms are introduced and various refinement are explained. 

The basics of the involved physics, such as geometric optics, surface and media interaction with light and camera models are outlined. 

The apparatus of Monte Carlo methods is introduced which is heavily used in several algorithms and its refinement in the form of stratified sampling and the Metropolis-Hastings method is explained. 

At the end of the course students should be familiar with common techniques in rendering and find their way around the current state-of-the-art of the field. Furthermore the exercises should deepen the attendees' understanding of the basic principles of light transport and enable them to write a simple rendering program themselves.

These videos are the recordings of the lectures of 2015 at the Teschnische Universität Wien by Károly Zsolnai and Thomas Auzinger

Course website and slides → http://www.cg.tuwien.ac.at/courses/Rendering/
Subscribe → http://www.youtube.com/subscription_center?add_user=keeroyz
Web → https://cg.tuwien.ac.at/~zsolnai/
Twitter → https://twitter.com/karoly_zsolnai

## Содержание

### [0:02](https://www.youtube.com/watch?v=Qgsos_kz6pM&t=2s) Recursion

now let's jump back to recursion so if i would like to compute multiple bounces i need to handle this somehow and we have talked about this briefly if i intersect the first object i need to reflect the ray off of this object in some way and after the shading is done diffuse specular ambient shading then we can trace the light further and this tracing step can be both reflection and refraction you remember frener's law and snell's law we're going to put them in use in a second but what i need to tell you is something super weird but you won't feel why this is weird so in a ray tracer in a recursive ray tracer not global illumination with the indirect elimination and these goodies that we're going to start next lecture in a ray tracer if you encounter a mirror an ideal specular reflector you will bounce the ray back in the ideal reflection direction so exactly what you would see in the mirror if it's 45 degrees it is 45 degrees back and you do the same with diffused surfaces as well so you continue the way in ideal reflection direction and now this sounds reasonably okay but when you will study global illumination and how the whole thing is done how real men compute the rendering equation and images you will see that this is a super huge simplification i remember the faces of students when they think back when they know all about global illumination and we talk about simple recursive rate racing and i asked them how is this reflected and there is silence because they will know that in global illumination it's going to be so natural that the diffuse surface means that it will reflect light in every direction with the very same probability so the perfect reflection direction has the same probability as coming back the same direction where it entered the surface they all have the same probability all directions and then suddenly a ray tracer says that even a diffuse object i'm going to treat as a mirror so this is going to be super weird and please remember when i say this later on if you take a look at ray tracers after global illumination now how does the recursion work i hit something i reflect away for a ray tracer always the perfect reflection direction and i'm going to restart the whole process i'm going to start to trace a new ray that starts on the object remember this is when you get the self intersection t equals zero i increment this maps maximum ray depth value to show how many bounces i have computed so far and i start again so i start a new way i imagine that this object is now the camera and this is where the ray is starting from is there a question or okay so we got everything how does it look like in terms of mathematics this is the illumination equation without recursion but now i need to add one more term let's quickly recap this the first term is the ambient term this is to warming up the completely black shadows this is basically a bunch of hacks but it looks good so we are going to be okay with this for now then we scale the amount of incoming light with the material properties so a diffuse and a specular shading model these are weighted by kd and ks these are values that tell you how diffuse or how specular this object is and not only how specular it is but what color does it absorb what colors does it reflect so what is the color of the object what is the diffuse and specular albedo of the object i'm using so many terms not because i'm inconsistent but because people use all of these terms and therefore you should be familiar with this and there's some weird stuff that i now added and this is the recursion part so kt is the fresnel transmission coefficient

### [4:27](https://www.youtube.com/watch?v=Qgsos_kz6pM&t=267s) Transmission Coefficient

this is the probability of refraction because you remember that i hit this air glass interface from different directions and if i hit them from different directions then the probability of reflection and refraction is different so depending on the incoming direction you have seen this laser is stronger in one direction than the other and we have to account for this with these transmission coefficients and the i t is the intensity that is coming from that direction the k r and i r are the other way around so if there is reflection not refraction then i'm going to go in that direction and i'm going to scale this with the intensity of the incoming light from the reflection direction a quick example what if i have a glass that's blue so some kind of glass that looks almost entirely blue then this fresnel transmission coefficient is going to describe a color that's bluish therefore all the energy that comes through this ball is going to be colored to blue and the fresnel reflection coefficient can be whatever so we are now interested in the transmission so this is how i can define materials like that this is the recursion part and for this i need to start perhaps multiple rays so if i hit this object and i say that hey but this is a transmissive object this is glass what do i do because there is a probability positive probability usually for reflection and refraction do i start two recursions new rays what do i do exactly and in the assignment that i'm going to talk about you will see a piece of code that does something and then you will see the effect of something i'm not going to spoil anything and just a quick introduction to hepburn's

### [6:33](https://www.youtube.com/watch?v=Qgsos_kz6pM&t=393s) Introduction to Helpers Notation

notation this is important because if you know this kind of notation then you will be able to discuss what kind of ray tracing algorithm can render what kind of light paths so as a status quo all light paths go between light sources and the eye if it doesn't hit the lens of the camera it's not going to be recorded in the image so every light source is every light path is going to be written as l something e or as this is bi-directional you can imagine the other way around so you can say e something l the denotes runs one diffuse into reflection during the way s is one specular inter-reflection during the way and the asterisk means any amount of diffuse bounces perhaps even zero so lde means that either i hit the i from the light immediately or there is one diffuse bounce or maybe an arbitrary number of diffuse bounces this is what the asterisk tells you and we can also denote the choice means that there is only one either specular or one diffuse bounce and with this small but powerful notation we can discuss all the algorithms there are to render photorealistic quality images so for now some of this will be intuitive not so intuitive because we don't know global illumination yet but

### [8:11](https://www.youtube.com/watch?v=Qgsos_kz6pM&t=491s) Ray Casting

first raycasting means that we hit at most one diffuse object that's all it can render no recursion nothing i just hit one diffuse object i do the diffuse shading and goodbye radiosity can compute something like indirect illumination because multiple diffuse bounces are possible so remember the example the light comes in to the classroom through the window hits the right wall and then hits the over and therefore the umbra is not going to be perfectly black this is called indirect illumination

### [8:43](https://www.youtube.com/watch?v=Qgsos_kz6pM&t=523s) Indirect Illumination

radiosity it's got that covered recursive ray tracing what we are doing with this fennel transmission and reflection thing we know that what we can do is indirect illumination definitely not because we treat a diffuse object also as a mirror we just use a different shading function for it so we don't trace rays all along the hemisphere of the object because it collects light from every direction this is why it doesn't change if i move my head this is why the side of it doesn't change but we cannot account for that this would be a huge dimensional integration problem that we're going to solve in the rendering equation so at most one diffuse bounce but you may have as many specular bounces as you need so this is why recursive ray tracers usually show you mirrors and glass balls and reflective things like that because it is capable of rendering it but not so much more and global illumination that's the full package an arbitrary number of diffuse or specular bounces this can also be glossy whatever kind of complicated material model you have here this ds can be anything and in any amount well let's take a look at an

### [10:05](https://www.youtube.com/watch?v=Qgsos_kz6pM&t=605s) Example with the Hagbard Notation

example with the heck bird notation so here we have light paths and they start out from the light source so on the right i have something like ldde that's exactly what i have been talking about so i start from the light source i hit a diffuse wall i hit the diffuse ground and then i hit the camera afterwards so that's ldd let's take a look at for instance lsse so i start from the light source i hit the glass ball from the outside this left glass ball and then i go inside the ball there's going to be refraction at least let's imagine that there's going to be a refraction and then i hit it on the other side as well and i come out so this is two specular bounces lsse so we can denote light paths and understand what algorithms can render what exactly so here if we imagine that this is a ray tracer this is an image with a ray tracer the question is what did they do this is a rather low quality image but let's it seems to me that the shadows are not completely black therefore in their shading models they definitely used what kind of term raise your hand if you know the answer okay that's still not too many so normally this would be completely black because i shoot a shadow ray towards the light source and it is going to be occluded by the table so intensity zero imagine that like all possible shadow rays are blocked but this is still not completely black because i'm adding a turn to it in order to warm it up and make the image a bit more realistic so this would be which term this would be the ambient term excellent

---
*Источник: https://ekstraktznaniy.ru/video/15001*