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)
keatonfs

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?

Spectato54

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.

joeyzhao123

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.

ClaireLiu123

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

SeanW0823

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?

Staffjamesfong1

@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.

Staffmcallisterdavid

@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 (https://en.wikipedia.org/wiki/Shadow_mapping) 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.

estherc123

is the direction of the shadow ray also randomized?

Staffjamesfobrien

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

estherc123

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)

Staffmcallisterdavid

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.

orenazad

@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