33 votes

Is Russian Roulette really the answer?

In order to understand Russian Roulette, let's look at a very basic backward path tracer: ...
RichieSams's user avatar
  • 3,742
13 votes

Is Russian Roulette really the answer?

Just to expand on some of the other answers, the proof that Russian Roulette does not give a biassed result is very simple. Suppose that you have some random variable $F$ which is the sum of several ...
Pseudonym's user avatar
  • 771
12 votes
Accepted

Does cosine weighted hemisphere sampling still require NdotL when calculating contribution for indirect light?

You always need to multiply by the cosine term indeed (that's part of the rendering equation). Though when you do indirect diffuse using ray-tracing and thus monte-carol integration (which is the most ...
user18490's user avatar
  • 656
11 votes
Accepted

What effects does path tracing capture that recursive ray tracing does not?

Generally speaking, path tracing removes a number of assumptions that ray tracing makes. Ray tracing usually assumes that there is no indirect lighting (or that indirect lighting can be approximated ...
John Calsbeek's user avatar
10 votes

Is Russian Roulette really the answer?

The Russian roulette technique itself is a way of terminating paths without introducing systemic bias. The principle is fairly straightforward: if at a particular vertex you have a 10% chance of ...
John Calsbeek's user avatar
9 votes
Accepted

Full Monte-Carlo Volumetric Scattering

First of all, a good reference for Monte Carlo path tracing in participating media is these course notes from Steve Marschner. The way I like to think about volume scattering is that a photon ...
Nathan Reed's user avatar
8 votes
Accepted

Rendering equation in terms of paths rather than directions

This is a very good question. There is a common misconception that Monte Carlo, or integration is applied "recursively" on the rendering equation. That is not what's happening. Numerical integration ...
lightxbulb's user avatar
  • 2,161
7 votes
Accepted

Why random monte carlo sampling instead of uniform sampling?

Sample locations with a uniform pattern will create aliasing in the output, whenever there are geometric features of size comparable to or smaller than the sampling grid. That's the reason why "...
Nathan Reed's user avatar
6 votes

Why random monte carlo sampling instead of uniform sampling?

Monte Carlo methods rely on the law of large numbers, which states that the average of a random event repeated a large number of times converges toward the expected value (if you flip a coin a ...
Julien Guertault's user avatar
6 votes
Accepted

Path Tracing With Multiple Lights

It's not that hard. If you have just planar or angular light sources, you can think of them as one light source split into multiple chunks and the only thing to deal with is how to sample this multi-...
ivokabel's user avatar
  • 1,454
5 votes

Is there ongoing research on Markov Chain Monte Carlo algorithms (other than Metropolis-Hastings) for use in ray tracing?

Overview Here is a short overview of the most used space representations, MLT variants and mutation strategies for these MLT variants. As you can see, there are quite some papers dating back to 2017 (...
Matthias's user avatar
  • 1,064
5 votes

Generation of stratified cosine weighted samples on hemisphere

The classic method is to uniformly sample the disc at the base of your hemisphere and to project your samples upwards on the hemisphere (eg. compute z from x and y). This yields a cosine weighted ...
Olivier's user avatar
  • 1,585
4 votes
Accepted

How does everyone count "Rays per Second"?

I've seen both, unfortunately. I'm not fond of rays per second as meaning exclusively primary rays and I'd suggest "paths per second" or better yet "samples per second" instead. "Complete ray" is not ...
Karl Schmidt's user avatar
4 votes
Accepted

Is this Russian roulette code correct?

I think you're right and the subtraction is a mistake. The code should rather be multiplying the fraction of photons not absorbed into the weight. Something like: ...
Nathan Reed's user avatar
4 votes
Accepted

The variance for the Monte Carlo estimator

I don't have that book to check the context of this, but from the equations you posted, yes, it looks like you're right. The $1/N$ factor should be applied to both terms. That agrees with the formula ...
Nathan Reed's user avatar
4 votes
Accepted

Multiple Importance Sampling in Path tracer produces Dark Images

Throughout my answer I'll sometimes refer to some results in https://sites.fas.harvard.edu/~cs278/papers/veach.pdf by using [MIS,section_number]. You can skip the following derivation if you don't ...
lightxbulb's user avatar
  • 2,161
4 votes
Accepted

Transforming between solid angle and spherical angle distribution in PBRT

As lightxbulb mentioned in the comments, one confusing thing here is that two different functions are being called $p$. Kind of like function overloading in C++, the $p(\omega)$ and $p(\theta, \phi)$ ...
Nathan Reed's user avatar
3 votes
Accepted

Path tracer isn't converging

I can find two possible reasons for the image not converging. #1. Every sample is the same For every sample, you generate random rays. You do that when you shoot the ray through a pixel (for anti-...
bram0101's user avatar
  • 1,595
3 votes
Accepted

Monte Carlo Integration

In Monte Carlo integration, the samples $x_1, x_2, \ldots x_N$ are independent, identically-distributed random variables. This implies they all have the same expectation value. The derived quantities $...
Nathan Reed's user avatar
3 votes
Accepted

Troubleshoot half vector sampling from a distribution (cook-torrence, trowbridge-reitz, etc)

The general idea for sampling half vector based distributions is that you generate $H$ and then compute $w_i$ by reflecting $w_o$ about $H$. This is so $H$ will be the half vector of your $w_i$ and $...
Olivier's user avatar
  • 1,585
2 votes
Accepted

Generation of stratified cosine weighted samples on hemisphere

If you have a deterministic mapping function which transforms uniformly distributed samples into the desired PDF (cosine shaped in your case), just feed it directly with stratified uniformly ...
ivokabel's user avatar
  • 1,454
2 votes
Accepted

Direct illumination, specular surfaces, and MIS

Specular surfaces which use MIS are not perfectly specular like a mirror. They have a small amount of blur, otherwise there is indeed no point in sampling the light as all the samples will evaluate ...
Olivier's user avatar
  • 1,585
2 votes

In bidirectional path tracing, is a camera subpath with $n$ vertices determined by a fixed number of random numbers?

For a fixed strategy, you can end up consuming a different number of samples depending on your mutation. This can happen for at least two reasons. If your perturbation changes some material along the ...
Hubble's user avatar
  • 334
2 votes

BDPT - How to handle deterministic ray PDF?

Sorry about leaving it for so long but I was so busy implementing the goddamn algorithm, I forgot about this :) So after reading up on Veach's thesis pretty closely, I understood what was going on. ...
gallickgunner's user avatar
2 votes

Energy redistribution sample re-integration

It sounds like you yet have to adjust the importance function of the Markov Chain according to the way you assign paths to each of the two estimators, path tracing and ERPT. If you think about it in ...
Tobias Zirr's user avatar
2 votes
Accepted

Integrating BRDF using Importance Sampling

Think of this way: when integrating uniformly over the hemisphere, it's like you are importance-sampling with a constant pdf of $1/2\pi$. The multiplication by $2\pi$ at the end, then, can be seen as ...
Nathan Reed's user avatar
2 votes

importance sampling rectangular light

From looking at the equations, it looks to me like alpha must be the angle between the surface normal of the light source, and the ray direction. This is the "projected area" factor: the ...
Nathan Reed's user avatar
2 votes
Accepted

Confusion about the bias during Monte Carlo integration

I think so. I did some numerical experiments using Monte-Carlo intergation. discard no-discard within-range uniform GT $x^2,x\in[0, 2)$ 14.705318 2.66772274 2.6668968 2.666666 $\sin x, x\in[0, \pi)$...
Raven's user avatar
  • 36
1 vote
Accepted

How to calculate the PDF of a multi-lobe BSDF

The summation doesn't include the BxDF that was picked for sampling. Look again at this line: if (bxdfs[i] != bxdf && bxdfs[i]->MatchesFlags(type)) ...
Nathan Reed's user avatar
1 vote
Accepted

Monte Carlo Importance Sampling

During the implementation, the way rays are scattered does not actually change and remains random. Actually the way rays are scattered does change, specifically when you sample a light. In chapter 8 ...
lightxbulb's user avatar
  • 2,161

Only top scored, non community-wiki answers of a minimum length are eligible