[Music] hi my name is Eric Haynes I'm with NVIDIA and this talk is about ray tracing effects it's got all the eye candy you would ever want I like to start with a quote and I promise I won't try to sing it this is from Queen and it's from Bohemian Rhapsody is this the real life is this just fantasy and I like to say that because which one is real of these two images one is a photo and one is a simulation turns out the one on the left is the photo and the one on
the right is the stimulation this is the famous Cornell box the Cornell box was actually made in 1984 I believe I was actually at the lab at the time in fact though not part of that group and it was pretty funny because Dan Greenberg comes in and he goes okay guys we're gonna make a box and they're like yeah sure I can do that with you know the little computer graphic no no we're gonna get some plywood and you're gonna get some paint and they were all like what are we doing but eventually the you
know they got with the program and the rest is history so with the Cornell box what you can do is start with a really simplified system and look at the various effects so we're gonna start with just hard shadows here and so instead of an area light source overhead we have just a point light source a single point where light's admitting you can see that what you get is these very sharp shadows and a sharp shadow is just going from some intersection point some point we're looking at to the light and some of those will
be blocked and those are in shadows and some are illuminated if you want soft shadows you have to go with an area light where you're sampling on various points on the light so this is that more stochastic ray tracing kind of a feel where you're shooting a bunch of rays and you're figuring out what percentage of the light you see if you're fully in light great if you're partially in light that's called the penumbra and that's sort of the soft shadow is or if every ray is blocked then you're in the Umbra the full shadow
area the next step is to start bouncing that light around to let the light percolate through the environment so instead of just looking directly at the light we're gonna have light that bounces around this is called by a lot of different names there's into reflection because the lights reflecting off of a bunch of surfaces or indirect lighting or color bleeding which is sort of specifically where color comes off of one wall and illuminates something else and they all have this group term called global illumination so in this case we can see a is going from
the floor where there's a green spot and hits the wall and it goes to the light that are in fact tons of passing this is one of many many paths that could hit the wall and go towards the light and all of them contribute a green color to that floor area and that last scene everything was diffuse Matt didn't really have any kind of reflection to it you can also go with glossy reflections where again you're doing a stochastic kind of process where you're shooting a ray in a burst like you're shooting a burst of
rays from your reflective surface and that gives you this fuzzy softer reflection in it so those are a bunch of different kinds of effects and here's another example of glossy reflection it's very shiny on the left and goes to more and more rough as we go to the right so here's your quiz question this image has a number of effects in it which affects that we've talked about do you see in this image the three that I see are there's glossy reflections on the ceiling and on the floor and on the wall to the right
there's inter reflection throughout and there's soft shadows and I especially want to note the inner reflection throughout the point of this is that if you were to just have this scene lit by just the Sun you would only have a few small portions of the interior that would actually get any light at all the rest of the interior would just be entirely dark so by having this light bouncing around the interior we get a realistic look to things there are other operations you can do with ray tracing where it's not particularly physically based but it's
physically plausible so this is called ambient occlusion where there's no particular light source in this scene but what we're doing is we're shooting out little bursts of rays from every location in the scene and trying to see if things are in crevices or could be occluded by other objects so let's look at that scooter in particular with ambient occlusion what you do is you take a point and you shoot out a burst of rays and you shoot them a certain distance you may shoot them say 3 feet or whatever scale makes sense for your scene
if a bunch of rays hit something like underneath the scooter or the tire or whatever then we can say that well this area is kind of dark like odds are that if a light were to be shone upon this scooter that area would be in shadow on the other hand if you're out in the open you have a burst of rays and stall the Rays get to that maximum distance like three feet or whatever it is and maybe a rare to hit something but overall you're kind of in the light and you can see it
all so that area gets a no shadow at all so notice that it's a term that's not physical in that if you actually shone a light underneath the scooter it would still look dark using ambient occlusion but it's a really good approximation of how crevices darken up and so on and so it's commonly used in games and it's been used in rasterization for a long time but with ray tracing you can get a better answer basically another cool thing you can do with ray tracing is depth of field you can get a background blur as
in this shot or you can get a foreground blur or you can get foreground and background blurs for that matter the idea is that by using depth of field it's a very cinematic effect and you can read the users eye to whatever point you want to focus on so the character on the right in this case the other thing you can do is motion blur instead of varying where the rays go what you're doing is varying where the model is in time and you just kind of add up the Rays at various points during the
frame and you get this blurry effect and again this is a cinematic effect and it's actually quite important to have in games or films because what you want to do is you want to sort of not have this kind of stroboscopic effect where if you just had a single flat frame with very sharp edges and so on it animates as if someone's flashing a strobe light on the scene this could actually be used in various films like gladiator for effect but generally it's not the effect you want and when the film is actually running you
don't tend to see this motion blur so much it just looks natural you can also do atmospheric effects so if you have say a beam of light you can do a thing called Ray marching where the ray hits the beam and marches through it and it looks at light scattering in and light scattering out and so on and you just kind of walk through that thing and sample it as you go and you can get these nice beams of light Gadre kinds of effects so I'm going to just show this short clip from Minecraft RTX
a demo we're making in conjunction with Microsoft of bringing ray tracing to Minecraft and I'll just leave it as sort of a quiz question for you as to figure out which effects are happening in this little demo [Music] one last effect I want to talk about is caustics which sounds dangerous it sounds like acid or something and they are dangerous and and not because of the octopus in the picture here what caustics are is the reflection of light off the surface of water or refraction of the light and through water or through glass or through
other transparent media so here we have light reflecting off the water and you can see it underneath and above in this next picture you can see beams of light and you can see the caustics on the ground underwater and this is a little clip from the justice demo which shows how these caustics are underneath the bridge and how they really sort of bring that area to life it gives it a real vibrancy now as far as the danger of caustics it's a real life danger so this is a picture of my office and on my
windowsill like a lot of computer graphics people have little tchotchkes of different cool materials and things I can stare at one of them was this little crystal ball on a wooden platform and if you zoom in on that crystal ball you'll see oh gee there's there's funny little marks on the wooden platform and I hadn't realized this for quite a while I was once in one office then I moved to another office and you can see the effect there are these burn marks in two different areas and it just depended on which way the ball
was facing and luckily I did not burn down our office that would not have been so good but anyway this this is actually a real problem like people will if you google it you'll find someone has their house can in light on fire due to snow globes so beware of caustics so I like to keep my caustics virtual I like to keep them in the computer graphics world and so these are just two shots from the physical based renderer by Matt Farah and others and it gives these gorgeous effects of light and refracting through these
various class and so on surfaces and that's it for further resources see the link for all kinds of free books and whatnot and one free book in particular like to point out is ray tracing gems which is a modern book about ray tracing theory and practice and is free to download [Music] you