Hacker News new | past | comments | ask | show | jobs | submit login

I was wondering that. I don't have anything to do with 3D graphics, but that had occurred to me. What method do they use to ensure only the rays that have the camera and sun as end points are rendered?



That's very simple: if we don't end up hitting a light the path won't carry any radiance, so it won't contribute to the final image. If we start on a light and we don't end up hitting the camera the path won't carry any importance and so it won't contribute to the final image either.

Keep in mind that there is a very mathematical foundation to all this, we're not just tracing paths for the fun of it. Basically what we want to solve is a path integral (an integral over all paths), we do this using a technique called Monte Carlo integration (which basically means we use randomness). We first sample a path (using path tracing) and then we calculate the contribution of that path (which basically is the amount of radiance is carries divided by the probability of sampling the path) and then we add that contribution to the right pixel.


Bidirectional path tracing. You send rays from the sun, rays from the camera, and try to connect them. The ones that connect are the ones that get computed for illumination.


Bidirectional path tracing is one way of sampling paths (actually it combines many techniques for sampling paths and weights those using something called Multiple Importance Sampling). It's not the only way of doing it. Disney most likely uses path tracing with next event estimation. This means that they start a path as explained in the video and they end a path by sampling a point on a light and then connecting the start of the path with the point to form a full path. This is one the techniques used by bidirectional path tracing (bdpt), this technique uses n vertices on the camera path and 1 vertex on the light path, but bdpt also uses techniques with s vertices on the camera path and t vertices on the light path. This means that there are multiple ways to sample the same path, so these techniques need to be weighted using something called Multiple Importance Sampling.


How is that even possible? The beam incidence angular calculation (and multi path dispersion) creates insane complexity that must be computed on the fly to even make sense.

For instance: a beam hits some material and needs to reflect or worse, pass through via transparency. Another issue: If we are calculating on a per pixel basis, that means bundling multiple paths together to figure out what the weighted return will look like. How can this all be computed with any kind of efficiency without cheating?


Bidirectional path tracing doesn't do anything clever to "try to connect" paths from light sources and cameras. The approach is just

- Trace random paths from light sources until they terminate (usually decided with Russian roulette).

- Trace random paths from the camera (usually N per pixel, or you can use more paths in noisy areas) until they terminate.

- Try to connect each point in a camera path with each point in a light path, using a simple line test. If it succeeds, that color is added to the pixel from which the camera path originated.

At least that's my understanding; I've only implemented simpler algorithms and read a bit about bidirectional path tracing.

> If we are calculating on a per pixel basis, that means bundling multiple paths together to figure out what the weighted return will look like. How can this all be computed with any kind of efficiency without cheating?

Right, we still need to consider many paths per pixel to get a high quality image. But it converges faster than most other Monte Carlo techniques.


Shoot a ray from the camera to an object. Then 'connect' it to all light sources, by measuring the change in angle, and properties of the surface. And add up.

If the surface is refractive/reflective, recursively shoot one more ray calculating the right direction, with correctly diminished intensity and follow the same process.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: