# TU Wien Rendering #13 - Easter, BRDF++, Depth of Field

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

- **Канал:** Two Minute Papers
- **YouTube:** https://www.youtube.com/watch?v=AUKLBdyvFxw
- **Дата:** 29.04.2015
- **Длительность:** 14:18
- **Просмотры:** 7,080
- **Источник:** https://ekstraktznaniy.ru/video/14999

## Описание

After some ramblings on the the differences of the Easter break in Hungary and Austria, we continue our journey and discuss how the f-stop works and how the well-known depth of field effect of cameras can be reproduced in our program. Then, finally we get to know the "real deal" BRDF models that we will use in our global illumination renderer.

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 te

## Транскрипт

### <Untitled Chapter 1> []

how was the easter break nice too short come on we discussed this already but what would be an appropriate length for it so every time by just two more weeks or something yeah well uh i don't know about uh austria but in hungary people usually go to their friends you know many people are coming over and we are hanging out with other people and you always have to drink their stuff so you go there and and we have this drink that's called the piling cup it's something like the schnapps but way stronger and i told this to some austrian people and they were like oh my god stronger than the schnapps how can that be very easily at least in hungary so that's how it works and you go to the very first place and you have to drink from their home brewed awful palinka usually it's very awful and you even have to say something good about it so you drink it and it's like ah but you have to say something good about this because they are they're looking at you know what will be the reaction so you say that that's really strong and then most people seem to be satisfied with that so like this is usually what i say but then when you are at like the fifth station for that day and some people just don't take no for an answer unfortunately so this is how it goes is it any better in austria it's more of a family holiday okay yeah the family part is actually the nice part so we can decide if we drink our own stuff or not i mean my fiance's grandfather attempted to make some brew some palinko at home and well he did something so i mean something was created in the process but after tasting it even the postman didn't want to drink it i don't know about postman in austria but in hungary they are like really hardy people so they drink whatever they find because obviously you don't give the good stuff for the post menu you give them the leftovers it's like no one drank oh so it will be good for the postman and he's happy with that imagine they seem to like alcohol according to my experiences so yeah and even the postman didn't want to drink that anymore so he like next time we have seen him around the house and he just came like in front of the main main door and and we wave to him hey come we have some for you and he was like no i'm just gonna put them in here immediately okay so regarding the assignments uh you guys and girls have done really well so i'm very happy to see that people realize that there's some exponentiality with respect to the depth of the simulation so the more deep we go then the more exponential things become but this is after like i mean it's exponential all along but you don't know this because it starts out slow but after like 10 to 15 bounces you can you can see a very uh italian characteristic of this exponential distribution and many of you have recognized correctly that this is because refraction and reflection are sampled all the time so whenever i have a bounce i am going to compute an intersection and then there's going to be two rays perhaps that continue their way because one is going to be in the reflection direction and one is with refraction and this quickly gets out of hand because forever ray you have two more that's the definition of something exponential so well done let's proceed a bit i'm going to talk just a bit about some advanced a bit more advanced brdf models that are

### Brdf Models [4:39]

mostly used with rate phasing so you remember this conversion brdf that you see on the right and this is the scalar product between l and then so the light vector and the normal and obviously you can scale this with kd which is some kind of diffuse albedo now if you put it next to a real image of a diffuse material obviously it is a question you know what do we call a diffuse material or where was this photograph how exactly but let's disregard this and let's accept that we have this difference between the two and if you take a good look then it becomes apparent that in grazing angles the simulated diffuse material seems to be completely dark and if you take a look at the formula up there then this this is a self-explanatory because the normal and the light direction and can get perpendicular and then you will see this darkness so there are some advanced prdf models that try to be a bit more realistic in this regard such example is the oren layer model which is much closer to what you would measure in real life but let's note that all of these simplified brd are small drdf models these are all texts this is not what physical reality is people write up the actual equations that relate to physical reality and try to simplify in a way that a simple brain tracer can capture and we are going to talk about global effects and what a real diffuse material looks like in humans so this rna or model seems much better and what's even more it can take into consideration these microsoftic in different materials and you can get a roughness parameter that can model these imperfections

### Specular Models [6:47]

what about specular models well the font model this v dot r that we have talked about is not the only way to do it there is also the

### Font Blend Model [6:57]

font blend model which is a more advanced model and uses this h is half vector between l and v and it produces different results i think this image is maybe not the best because yes the highlights are different but one of the main advantage advantages of this material model is that the shape of the specular reflections can get a bit more elliptic depending on the viewing direction and the surroundings so here you have the very same circular thing so it's not the best example but you can see that it's different it looks more realistic and we still have to think about the fact that these are still really good models but hacks there's also the cook torrence model that's basically foam blend that can model also microsoft roughness and here maybe with the projector maybe it's not so visible but you can see that the specular reflection here is a bit more easier so it's not a completely round sphere it's not a perfect sphere there are these small imperfections that are characteristic to realize materials so this is what this model can capture and there are some other advanced brdf models some of which are more easy to understand and implement than it is to pronounce the name of the authors of the brdf models this is one of those examples and this is some kind of a multi-layer model where you have a diffuse substrate and you have like a coating a specular coating so there are also brdfs for car paint where you can have these sparkly effects and there are many brdf models that capture given effects okay what if one would like to play with these the disney guys have implemented this program called the brdf explorer and you can load many local brdf models and change the light source positions look at the actual brdfs and impulse responses give it a try so we have always been talking about cameras so we are trying to model real world cameras if you have a handheld camera you will see a setting that's called the f-stop and the f-stop is related to the size of the aperture is the opening of the camera where the light goes in and you can set this to different values and you will notice that if you set this f-stop to a high value then the aperture of the camera is going to become smaller and if it's smaller then this means that less light is let in and more of the image that you get is going to be in focus and vice versa so if you have a low f-stop setting then you will have a bigger aperture more light is let in and more regions will be out of focus and this is what gives you this depth of field effect because whatever images we have seen and created with ray tracers yet don't have this depth of field effect but if you use a handheld camera then somehow you have to model this effect as well because this is how an image would be created on the field so this is a nice chart made by photographers to see how exactly these f-stops relate to aperture size what are the typical settings and all of these interesting things and an actual example so let's take a look at the bottom right here you can see that the whole image is in focus and as you adjust the f-stop accordingly you can see the top left you can see here immediately that the background is heavily blurred so this is a more pronounced depth of field effect and it would be wonderful to have a ray tracer that can take this effect into account and this is another maybe a bit more beautiful and a bit more visible example so on the left side you can see a very pronounced up for field effect and on the right everything close to everything is in focus yes do you also use the word okay for commuter graphics yes and there is also a bunch of papers on how to simulate this effect so people even try to compute this in real time so you have like a computer game you would like to see this bokeh effect how do you do this and you have to take into consideration the depth like if you know what objects are where exactly how far away then you can do a bunch of tricks to to get something like that an approximation in real time and if you do this something that i'm going to show you in a second and you will have the very same effect in your a tracer so on the left completely all in focus image on the right you can see again the depth of field effect especially in the background the further away you go the more you see so how do we do this very simple let's skip the text and i just put this here because people who read this at home would know about this so mostly most of what we do is we shoot a rate through the midpoint of the pixel in our range racer and this is going to touch this focal point and then hit an object well what we could do is that we would also take samples from nearby so not only this pixel and not only the midpoint but from nearby and shoot all of these ways through the same focal point and compute the very same samples but these samples will be nearby what we do with these samples is we average them and this is what is going to give you this depth of field so this is already some kind of integration this means that which if you run a ray tracer you're going to get a completely converged image without any noise without any problems that image you can consider done but this will not be so with global illumination this is a speciality of raytracers but if you have such an effect then you may have to wait until more and more of these samples are computed and the more smooth image you will get we will talk about this effect extensively it's going to be very important and just an important question what kind of material model can this be obviously this is some quick perhaps opengl preview but it's very apparent what i see in here what kind of shading is this is it specular these are definitely not mirrors okay what else yes exactly so this is a lamborghini model and you can also see this effect that it goes completely black in these spacing cables
