You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 12: Monte Carlo Integration (28)

I've noticed in many video games that the shadows are aliased or very pixelated. Is this just to save on computation or does this have something to do with monte carlo integration?


Shadows can be very dynamic structures, so it might just be more efficient to have them very rough around the edges. I'm not totally sure.


That's actually a really interesting point. I feel like as opposed to something like the image on the left for a shadow, if you're trying to save computation power, wouldn't it be better to cut off around the edges a bit? Even if it's sharper it wouldn't look nearly as rough.


i think that monte carlo integration can be used in certain cases especially for multidimension. It cana help to limit noise and make things soother. It could also be related to mipmaps which we learned


Is there a metric we can use to measure how realistic the shadows are in order to determine many shadow rays to cast for each point?


@SeanW0823 If your Monte Carlo estimator is unbiased, then your shadows will be physically realistic in expectation. What we are looking at is noise on top of our estimate, which decreases with the number of shadow rays.

A simple metric is to estimate the variance at each sample point, and then use more shadow rays until your variance is below some threshold.


@keatonfs @Spectato54 @joeyzhao123 Video games don't typically have the compute budget to calculate shadows with Monte Carlo integration (RTX Minecraft is an exception).

There are some real-time approaches that video games use ( but they produce artifacts like you mentioned. For scenes without changing lighting, game developers can also simulate shadows with many samples during development then "bake" the results into the texture.


is the direction of the shadow ray also randomized?


The shadow ray should be aimed at a randomly selected point on the area light source.


So the point in the scene that the shadow ray comes out isn’t randomized right?(i.e. we are not taking random samples from points in the scene)


We’re interested in estimating the lighting at a pixel. We project a ray from this pixel to an 3D point and then sample shadow rays from that point.


@Keatonfs, I believe thats because the shadow map (that is typically used for shadows in non-path traced games or games that use ray-traced shadows) has limited resolution. Typically in these games, turning up the shadow setting turns up the resolution of the shadow map itself, which allows for much sharper and less pixelated looking shadows, at the cost of computation.

As a side note, I believe that as @mcallisterdavid mentioned, Minecraft RTX uses monte carlo simulation. I believe the game is fully path-traced, so this makes sense.

You must be enrolled in the course to comment