TU Wien Rendering #27 - Russian Roulette Path Termination
10:27

TU Wien Rendering #27 - Russian Roulette Path Termination

Two Minute Papers 15.05.2015 4 960 просмотров 53 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
To be faithful to mother nature, we would need a to trace an infinite number of bounces for every ray (of course this depends on the attenuation of the energy of the photon bounce after bounce). Since we only have finite resources, this sounds impossible. To our surprise, this is possible to solve with a statistical trick call Russian roulette path termination. We can easily prove that the estimator converges to the right quantity, though it has its own variance that recedes over time as more samples are added. Warning: it will boggle your mind! 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

Оглавление (3 сегментов)

Segment 1 (00:00 - 05:00)

quick question we will discuss the rational and then we're done when do we start tracing array well what we did so far is we did the cutoff so we said that there's a maximum number of bounces that i'm going to compute and the rest of it i'm not interested in the problem is that this is a bias solution and we are missing some energy in the image because if i would compute many more subsequent bounces i would accumulate more radiance so i will get perhaps a brighter but a more faithful image to reality and we can do much better than that what's more there is a technique that can compute an infinite amount of samples depth and that bottles the mind a bit because what is really happening if i would need to compute physical reality have a maximum depth of infinity i couldn't even compute one sample per pixel because i would have to bounce the array indefinitely but there's a mathematical technique that can give you the results as if you computed an infinite number of bonuses and this is against statistics and probability it's usually very difficult to wrap one's mind around what is happening but we can actually solve this problem so how can we overcome this what we're looking for is an estimator that converges to the expected value of the integral and okay that's fine i'm looking for the expected value but having the expected value or looking for the expected value of something is one thing but there's not only expected value there is variance so i may have multiple estimators and what i'm looking for is one that has the lowest possible variance what i can do here is after each step by step i mean each bounce i decide whether i will terminate the path so i would stop this like that or i would continue but if i continue i multiply the collected gradients with something and the question is what should be something now this i would like to relate to for instance freda's law in frenet's law we could compute what is the probability of reflection and refraction i hit that glass window and with some probability i will continue my rate through the window and with some other probability i will get a radiant factor now what i could do is i could run many samples and add them together or what i could also do is that i don't run many samples i enter the window and i compute that there is an 80 chance of reflection and 20 for refraction and i will send out only one ray in each direction but i would multiply these by the relative probability of the event so i'm not tracing 10 000 raised i will i would send out one and i would multiply it by 2. 8 in one direction and 0. 2 in another direction and then if i would do this yes i would compute more and more samples but statistically this is sound so what this means is that this converges to the expected value of the integral and russian roulette does the exact same thing but it gives you an infinite number of boxes so with a given probability i start continue but i will multiply the collected gradients with a factor and this factor for the fresnels example could be the probability of reflection and reference what does the algorithm look like i choose a random variable let's call it c on zero one and with the given probability that's bi i continue the right path after hitting something every bounce i throw a dice and if i have this probability i will continue my right path but i will multiply the connected radius with something i won't give you the end results as what you would see in the textbook i'll try to show you the thought process on how i will need to multiply it by something i don't know what this something should be we will find out together and if i don't hit this probability then i will terminate the right path so we could imagine this as if i continued the light path but i multiplied

Segment 2 (05:00 - 10:00)

multiplied all the subsequent gradients by zero i spoiled the zero for the second question mark so damn it but you would have found this out in a second anyway okay so i'm looking for the expected value of something l i the hat means an estimation an estimator and on the right side this is the actual error so whatever happens in the middle is some magic but the constraint is that the expected value of the estimator should be the same as the original quantity that i'm looking for there's a probability of continuation and if i don't hit this probability then i will stop the stopping part is trivial if i stop then i will multiply this term with zero so imagine that i continue my line path i won't because it's wasted time until infinity but it's multiplied by zero now the question is what is the other question mark what i know is that on the right side i would want to get l i so forget this right term what do i need to do with this expression on the left in order to get l i on the right side raise your hand if you know the answer i think i wanted to i want you to take a few seconds and think about it what do i need to do to get l i from this expression the rest is multiplied by zero so this doesn't matter raise your hand if not okay maybe okay yes please first okay uh i think is yes okay so i kill the pi because i don't see any pi here so there's gonna be a fraction and the denominator is going to be pi so i killed this guy but there's no one in there and i want someone in there and that someone is the li so i kill the pi with my fraction and in the numerator there is going to be l so if i do this then what i am doing is going to be statistically sound and i'll try to give you the intuition again this takes time to wrap your head around it is almost like in the fret out equation that what you could do is you could send out one ray in one direction so you can send out 800 rays in one direction and sum them up what you could do is that i send out only one ray and i multiply it with 800 and no i would not get the same result but i will get the same expected value and over time the variance around this expected value would shrink if i do this many times so this is the intuition behind the whole thing what is a good choice for the pi because this has been a parameter so far what should i put in there well with a little scratch i could say it doesn't matter you could put many sensible choices in there and it would work but quickly let's review the cases where it would not work well obviously the two very stupid options if you put p i equals zero then this would mean that you would never continue your path you would always stop so this is obviously correct what if i say pi equals one but this means that i would always continue i would never stop well you could say mathematically this is sound but you could never compute one sample per pixel if you're a mathematician you would say i have a turing machine that would never stop it doesn't make too much sense if you're looking for a practical solution now anything in between the two is completely fine the only difference is because i i've showed you that the expected value is the same as the actual quantity done that i'm looking for but the variance is different so it is oscillating around the very same number but the magnitude of the oscillation depends on this choice and what you can prove but it is actually very easy to visualize that the good choice for the pi would usually be something that would sample brighter paths longer and darker paths i would want to terminate faster because this is the same as matching the green function with the blue function with the green bars i want to reconstruct the brighter regions more faithfully than darker regions because this is what gives me the smaller error so what you can plug in there is for instance the albedo of the material so if you have a really bright

Segment 3 (10:00 - 10:00)

white wall then you would with a super high probability you will want to continue your power but if you have really if you encounter a really dark object like the curtains in the other side of the room you would want to stop with a much larger probability so this is how russian roulette works we will also code this so in the next lecture you will see the whole thing that we've studied in code

Другие видео автора — Two Minute Papers

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник