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

What's the difference between path tracing, ray tracing and photon mapping?

I'd never heard of path tracing before now and the video makes it sound the same as ray tracing/casting, but what I've read implies otherwise (but I'm not sure how). Clearly it's different to photon mapping, but what ever happened to that: Was it too computationally expensive for the pay-off?




Ray tracing is a more generic term that covers rendering techniques which trace rays between a camera and a scene. Back in the day everyone used Whitted style ray tracers to render shiny metal blobs because secular reflections are trivially handled with ray tracing. Unfortunately other physical aspects of light like diffuse reflections were not handled by early ray tracing algorithms.

Kajiya introduced the rendering equation, a mathematical formulation of global illumination (takes diffuse, secular into account). It's a multidimensional integral equation. Unidirectional path tracing is an algorithm he introduced to solve the rendering equation. It uses several rays traced from pixels in the camera bouncing randomly through the scene. It's a Monte Carlo integration algorithm for solving the nasty integrals.

Photon mapping involves a pass algorithm tracing light from light sources into the scene, then a pass (like path tracing) gathering that light back at the camera. It better handles more complex light effects like caustics.


> It better handles more complex light effects like caustics.

I wouldn't say better. I would say it provides an approximation to the rendering equation more quickly than path tracing does. However, photon mapping is a biased algorithm, which means that if you average many independent renderings together, they won't converge on the correct (exact) image. Path tracing methods (bi-directional, Metropolis, etc.) converge on the exact solution, regardless of how noisy each individual rendering is. (However, it may be the case that an unwieldy number of samples is required for tricky caustics, so in practice, path tracing may fail to produce a correct result because of high variance.)


Photon Mapping might be biased, but it's extremely easy to make it consistent by using the method outlined by Knaus and Zwicker [1]. Using that method photon mapping will converge to the right result. Even without progressive photon mapping you can choose a photon radius that won't cause visible errors.

[1] http://cgg.unibe.ch/publications/2011/progressive-photon-map...


Stupid phone: secular-specular


Ray tracing is the art of tracing rays and detecting collision.

Ray tracing is used in photon mapping and path tracing.

With photon mapping you trace a ray from a light source and store the light energy for the area where the light hits an object.

With path tracing you ray trace a ray from the camera and every time you hit an object you check if you can see a light source from that spot. If true you return all the gathered energy back to the camera (pixel).


The other answers here are correct, but to shed a little more light on it, the main development of path tracing over ray tracing is that path tracing involves Monte Carlo integration to simulate many effects, the big one being Global Illumination, but depth of field and soft shadows as well. What this means is that at every step along a ray path, you carefully pick a new direction for the next ray segment that is randomized according to whatever effect that segment corresponds to, whether it's the surface material there, or the camera lens or the area/volume light source, or something else. The implication of this randomizing / Monte Carlo integration is that it typically takes many ray paths to get the color for a single pixel. (You can use only one or just a few, and your result will be very noisy.)

When people talk about ray tracing as something different than path tracing, they usually mean the first form of ray tracing that only did direct diffuse lighting, point light sources, simplistic materials, and multiple bounces of perfect specular reflections. (Aka recursive ray tracing.)

Note that not everyone makes a distinction between path tracing and ray tracing, you can easily find lots of examples of people referring to ray tracing and talking about GI and Monte Carlo techniques. "Ray tracing" is evolving to incorporate modern developments.


The way I understand it; ray tracing and path tracing are the same conceptually except for how so called 'global illumination' (GI) is calculated. Ray tracing uses a short cut that computes the value with an equation that can be applied efficiently to the entire image. Path tracing on the other hand calculates the GI by tracing not only direct rays from the camera lens bouncing off an object to the light sources but also follows indirect rays that bounce around multiple objects in the scene on their path from the camera to the light source.

Practically speaking path tracing is going to give you a more real to life image at the expense of a slower rendering process.


This is wrong. Ray tracing simply is a way to determine visibility between two points, just like the Z-buffer. Ray tracing won't produce a color on its own. Path tracing on the other hand is a method which uses ray tracing to solve the light transport integral. It creates paths between the camera and the light using ray tracing and then it calculates the contribution of that path to the image. Most toy ray tracers only handle specular reflection and transmission, and direct illumination. This is called Whitted ray tracing and is probably what you're referring to.


You're probably right, but nobody I know calls it "Whitted ray tracing" unless Turner is there in the room, or some point is being made about or in reference to his paper specifically. ;) In my experience, graphics people generally do mean producing colors for pixels when they say "ray tracing". But I think physicists would assume "ray tracing" means visibility queries and nothing more.

When someone says 'ray tracing' to me today, before they elaborate on what they mean, I assume they're talking about using straight line segment visibility tests probably to make some kind of picture, probably using Monte Carlo techniques, probably for global illumination. So, they might mean path tracing, or one of the (many) other ways to simulate lighting, or my assumption might be wrong, but that's okay because language is fun, and vague, overridden and imperfect terms allow us to have longer conversations. :)


Is the light transport integral isomorphic to what Heckbert's paper [1] refers to as "gratuitous partial differential equations [2]," as explained by Fuller [3]?

>The “begetted” eightness as the system-limit number of the nuclear uniqueness of self-regenerative symmetrical growth may well account for the fundamental octave of unique interpermutative integer effects identified as plus one, plus two, plus three, plus four, as the interpermuted effects of the integers one, two, three, and four, respectively; and as minus four, minus three, minus two, minus one, characterizing the integers five, six, seven, and eight, respectively [3].

[1] http://www.ecse.rpi.edu/~wrf/Teaching/graphics-s2005/heckber...

[2] https://wattsupwiththat.files.wordpress.com/2012/01/bg-equat...

[3] Fuller. R.B. Synergetics. MacMillan, New York, 1975,~. 125.




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

Search: