HOME

TheInfoList



OR:

Path tracing is a computer graphics
Monte Carlo method Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The underlying concept is to use randomness to solve problems that might be determin ...
of rendering images of three-dimensional scenes such that the
global illumination Global illumination (GI), or indirect illumination, is a group of algorithms used in 3D computer graphics that are meant to add more realistic lighting to 3D scenes. Such algorithms take into account not only the light that comes directly from ...
is faithful to reality. Fundamentally, the algorithm is integrating over all the
illuminance In photometry, illuminance is the total luminous flux incident on a surface, per unit area. It is a measure of how much the incident light illuminates the surface, wavelength-weighted by the luminosity function to correlate with human brightness ...
arriving to a single point on the surface of an object. This illuminance is then reduced by a surface reflectance function (
BRDF The bidirectional reflectance distribution function (BRDF; f_(\omega_,\, \omega_) ) is a function of four real variables that defines how light is reflected at an opaque surface. It is employed in the optics of real-world light, in computer ...
) to determine how much of it will go towards the viewpoint camera. This integration procedure is repeated for every pixel in the output image. When combined with physically accurate models of surfaces, accurate models of real light sources (light bulbs), and optically correct cameras, path tracing can produce still images that are indistinguishable from photographs. Path tracing naturally
simulate A simulation is the imitation of the operation of a real-world process or system over time. Simulations require the use of models; the model represents the key characteristics or behaviors of the selected system or process, whereas the ...
s many effects that have to be specifically added to other methods (conventional ray tracing or
scanline rendering Scanline rendering (also scan line rendering and scan-line rendering) is an algorithm for visible surface determination, in 3D computer graphics, that works on a row-by-row basis rather than a polygon-by-polygon or pixel-by-pixel basis. All of t ...
), such as soft shadows,
depth of field The depth of field (DOF) is the distance between the nearest and the furthest objects that are in acceptably sharp focus in an image captured with a camera. Factors affecting depth of field For cameras that can only focus on one object dis ...
,
motion blur Motion blur is the apparent streaking of moving objects in a photograph or a sequence of frames, such as a film or animation. It results when the image being recorded changes during the recording of a single exposure, due to rapid movement or l ...
, caustics,
ambient occlusion In 3D computer graphics, modeling, and animation, ambient occlusion is a shading and rendering technique used to calculate how exposed each point in a scene is to ambient lighting. For example, the interior of a tube is typically more occluded ...
, and indirect lighting. Implementation of a renderer including these effects is correspondingly simpler. An extended version of the algorithm is realized by
volumetric path tracing Volumetric path tracing is a method for rendering images in computer graphics which was first introduced by Lafortune and Willems. This method enhances the rendering of the lighting in a scene by extending the path tracing method with the effect o ...
, which considers the
light scattering Scattering is a term used in physics to describe a wide range of physical processes where moving particles or radiation of some form, such as light or sound, are forced to deviate from a straight trajectory by localized non-uniformities (including ...
of a scene. Due to its accuracy,
unbiased Bias is a disproportionate weight ''in favor of'' or ''against'' an idea or thing, usually in a way that is closed-minded, prejudicial, or unfair. Biases can be innate or learned. People may develop biases for or against an individual, a group, ...
nature, and algorithmic simplicity, path tracing is used to generate reference images when testing the quality of other rendering
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
s. However, the path tracing algorithm is relatively inefficient: a very large number of rays must be traced to get high-quality images free of
noise Noise is unwanted sound considered unpleasant, loud or disruptive to hearing. From a physics standpoint, there is no distinction between noise and desired sound, as both are vibrations through a medium, such as air or water. The difference aris ...
artifacts. Several variants have been introduced which are more efficient than the original algorithm for many scenes, including bidirectional path tracing,
volumetric path tracing Volumetric path tracing is a method for rendering images in computer graphics which was first introduced by Lafortune and Willems. This method enhances the rendering of the lighting in a scene by extending the path tracing method with the effect o ...
, and
Metropolis light transport Metropolis light transport (MLT) is a global illumination application of a variant of the Monte Carlo method called the Metropolis–Hastings algorithm to the rendering equation for generating images from detailed physical descriptions of three-di ...
.


History

The
rendering equation In computer graphics, the rendering equation is an integral equation in which the equilibrium radiance leaving a point is given as the sum of emitted plus reflected radiance under a geometric optics approximation. It was simultaneously introduced ...
and its use in computer graphics was presented by
James Kajiya James Kajiya is a pioneer in the field of computer graphics. He is perhaps best known for the development of the rendering equation. Kajiya received his PhD from the University of Utah in 1979, was a professor at Caltech from 1979 through 1 ...
in 1986. Path tracing was introduced then as an algorithm to find a
numerical solution Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods th ...
to the integral of the rendering equation. A decade later, Lafortune suggested many refinements, including bidirectional path tracing.
Metropolis light transport Metropolis light transport (MLT) is a global illumination application of a variant of the Monte Carlo method called the Metropolis–Hastings algorithm to the rendering equation for generating images from detailed physical descriptions of three-di ...
, a method of perturbing previously found paths in order to increase performance for difficult scenes, was introduced in 1997 by Eric Veach and Leonidas J. Guibas. More recently,
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
s and
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobil ...
s have become powerful enough to render images more quickly, causing more widespread interest in path tracing algorithms. Tim Purcell first presented a
global illumination Global illumination (GI), or indirect illumination, is a group of algorithms used in 3D computer graphics that are meant to add more realistic lighting to 3D scenes. Such algorithms take into account not only the light that comes directly from ...
algorithm running on a GPU in 2002. In February 2009, Austin Robison of
Nvidia Nvidia CorporationOfficially written as NVIDIA and stylized in its logo as VIDIA with the lowercase "n" the same height as the uppercase "VIDIA"; formerly stylized as VIDIA with a large italicized lowercase "n" on products from the mid 1990s to ...
demonstrated the first commercial implementation of a path tracer running on a GPU , and other implementations have followed, such as that of Vladimir Koylazov in August 2009. This was aided by the maturing of
GPGPU General-purpose computing on graphics processing units (GPGPU, or less often GPGP) is the use of a graphics processing unit (GPU), which typically handles computation only for computer graphics, to perform computation in applications tradition ...
programming toolkits such as
CUDA CUDA (or Compute Unified Device Architecture) is a parallel computing platform and application programming interface (API) that allows software to use certain types of graphics processing units (GPUs) for general purpose processing, an approach c ...
and
OpenCL OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), field-prog ...
and GPU ray tracing SDKs such as
OptiX Nvidia OptiX (OptiX Application Acceleration Engine) is a ray tracing API that was first developed around 2009. The computations are offloaded to the GPUs through either the low-level or the high-level API introduced with CUDA. CUDA is only avai ...
. Path tracing has played an important role in the film industry. Earlier films had relied on scanline renderers to produce CG visual effects and animation. In 1998,
Blue Sky Studios Blue Sky Studios, Inc. was an American computer animation studio based in Greenwich, Connecticut. It was founded on February 22, 1987 by Chris Wedge, Michael Ferraro, Carl Ludwig, Alison Brown, David Brown, and Eugene Troubetzkoy after their em ...
rendered the
Academy Award The Academy Awards, better known as the Oscars, are awards for artistic and technical merit for the American and international film industry. The awards are regarded by many as the most prestigious, significant awards in the entertainment ind ...
-winning short film ''Bunny'' with their proprietary CGI Studio path tracing renderer, featuring soft shadows and indirect illumination effects.
Sony Pictures Imageworks Sony Pictures Imageworks Inc. is a Canadian visual effects and computer animation studio headquartered in Vancouver, British Columbia, with an additional office on the Sony Pictures Studios lot in Culver City, California. SPI is a unit of Sony P ...
' Monster House was, in 2006, the first animated feature film to be rendered entirely in a path tracer, using the commercial Arnold renderer. Also,
Walt Disney Animation Studios Walt Disney Animation Studios (WDAS), sometimes shortened to Disney Animation, is an American animation studio that creates animated features and short films for The Walt Disney Company. The studio's current production logo features a scene fro ...
has been using its own optimized path tracer known as Hyperion ever since the production of '' Big Hero 6'' in 2014.
Pixar Animation Studios Pixar Animation Studios (commonly known as Pixar () and stylized as P I X A R) is an American computer animation studio known for its critically and commercially successful computer animated feature films. It is based in Emeryville, Californ ...
has also adopted path tracing for its commercial
RenderMan The name RenderMan can cause confusion because it has been used to refer to different things developed by Pixar Animation Studios: * RenderMan Interface Specification (RISpec), an open API (technical specification) developed by Pixar for a standard ...
renderer.


Description

Kajiya's
rendering equation In computer graphics, the rendering equation is an integral equation in which the equilibrium radiance leaving a point is given as the sum of emitted plus reflected radiance under a geometric optics approximation. It was simultaneously introduced ...
adheres to three particular principles of optics; the Principle of global illumination, the Principle of Equivalence (reflected light is equivalent to emitted light), and the Principle of Direction (reflected light and scattered light have a direction). In the real world, objects and surfaces are visible due to the fact that they are reflecting light. This reflected light then illuminates other objects in turn. From that simple observation, two principles follow. I. For a given indoor scene, every object in the room must contribute illumination to every other object. II. Second, there is no distinction to be made between illumination emitted from a light source and illumination reflected from a surface. Invented in 1984, a rather different method called radiosity was faithful to both principles. However, radiosity relates the total illuminance falling on a surface with a uniform
luminance Luminance is a photometric measure of the luminous intensity per unit area of light travelling in a given direction. It describes the amount of light that passes through, is emitted from, or is reflected from a particular area, and falls withi ...
that leaves the surface. This forced all surfaces to be Lambertian, or "perfectly diffuse". While radiosity received a lot of attention at its invocation, perfectly diffuse surfaces do not exist in the real world. The realization that scattering from a surface depends on both incoming and outgoing directions is the key principle behind the
Bidirectional reflectance distribution function The bidirectional reflectance distribution function (BRDF; f_(\omega_,\, \omega_) ) is a function of four real variables that defines how light is reflected at an opaque surface. It is employed in the optics of real-world light, in compute ...
(BRDF). This direction dependence was a focus of research resulting in the publication of important ideas throughout the 1990s, since accounting for direction always exacted a price of steep increases in calculation times on desktop computers. Principle III follows. III. The illumination coming from surfaces must scatter in a particular direction that is some function of the incoming direction of the arriving illumination, and the outgoing direction being sampled. Kajiya's equation is a complete summary of these three principles, and path tracing, which approximates a solution to the equation, remains faithful to them in its implementation. There are other principles of optics which are not the focus of Kajiya's equation, and therefore are often difficult or incorrectly simulated by the algorithm. Path tracing is confounded by optical phenomena not contained in the three principles. For example, * Bright, sharp caustics;
radiance In radiometry, radiance is the radiant flux emitted, reflected, transmitted or received by a given surface, per unit solid angle per unit projected area. Radiance is used to characterize diffuse emission and reflection of electromagnetic radiati ...
scales by the density of illuminance in space. *
Subsurface scattering Subsurface scattering (SSS), also known as subsurface light transport (SSLT), is a mechanism of light transport in which light that penetrates the surface of a translucent object is scattered by interacting with the material and exits the surf ...
; a violation of principle III above. *
Chromatic aberration In optics, chromatic aberration (CA), also called chromatic distortion and spherochromatism, is a failure of a lens to focus all colors to the same point. It is caused by dispersion: the refractive index of the lens elements varies with the wav ...
,
fluorescence Fluorescence is the emission of light by a substance that has absorbed light or other electromagnetic radiation. It is a form of luminescence. In most cases, the emitted light has a longer wavelength, and therefore a lower photon energy, tha ...
,
iridescence Iridescence (also known as goniochromism) is the phenomenon of certain surfaces that appear to gradually change color as the angle of view or the angle of illumination changes. Examples of iridescence include soap bubbles, feathers, butterfly ...
; light is a spectrum of frequencies.


Algorithm

The following
pseudocode In computer science, pseudocode is a plain language description of the steps in an algorithm or another system. Pseudocode often uses structural conventions of a normal programming language, but is intended for human reading rather than machine re ...
is a procedure for performing naive path tracing. The TracePath function calculates a single sample of a pixel, where only the Gathering Path is considered. Color TracePath(Ray ray, count depth) void Render(Image finalImage, count numSamples) All the samples are then
averaged In mathematics and statistics, the arithmetic mean ( ) or arithmetic average, or just the '' mean'' or the ''average'' (when the context is clear), is the sum of a collection of numbers divided by the count of numbers in the collection. The col ...
to obtain the output color. Note this method of always sampling a random ray in the normal's hemisphere only works well for perfectly diffuse surfaces. For other materials, one generally has to use importance-sampling, i.e. probabilistically select a new ray according to the BRDF's distribution. For instance, a perfectly specular (mirror) material would not work with the method above, as the probability of the new ray being the correct reflected ray – which is the only ray through which any radiance will be reflected – is zero. In these situations, one must divide the reflectance by the
probability density function In probability theory, a probability density function (PDF), or density of a continuous random variable, is a function whose value at any given sample (or point) in the sample space (the set of possible values taken by the random variable) can ...
of the sampling scheme, as per Monte-Carlo integration (in the naive case above, there is no particular sampling scheme, so the PDF turns out to be 1). There are other considerations to take into account to ensure conservation of energy. In particular, in the naive case, the reflectance of a diffuse BRDF must not exceed \frac or the object will reflect more light than it receives (this however depends on the sampling scheme used, and can be difficult to get right).


Bidirectional path tracing

Sampling the integral can be done by either of the following two distinct approaches: * Backwards Path Tracing, where paths are generated starting from the camera and bouncing around the scene until they encounter a light source. This is referred to as "backwards" because starting paths from the camera and moving towards the light source is opposite the direction that the light is actually traveling. It still produces the same result because all optical systems are reversible. * Light Tracing (or Forwards Path Tracing), where paths are generated starting from the light sources and bouncing around the scene until they encounter the camera. In both cases, a technique called ''Next Event Estimation'' can be used to reduce variance. This works by directly sampling an important feature (the camera in the case of ''Light Tracing'', or a light source in the case of ''Backwards Path Tracing'') instead of waiting for a path to hit it by chance. This technique is usually effective, but becomes less useful when specular or near-specular BRDFs are present. For ''Backwards Path Tracing'', this creates high variance for caustic paths that interact with a diffuse surface, then bounce off a specular surface before hitting a light source. ''Next Event Estimation'' cannot be used to sample these paths directly from the diffuse surface, because the specular interaction is in the middle. Likewise, it cannot be used to sample paths from the specular surface because there is only one direction that the light can bounce. ''Light Tracing'' has a similar issue when paths interact with a specular surface before hitting the camera. Because this situation is significantly more common, and noisy (or completely black) glass objects are very visually disruptive, ''Backwards Path Tracing'' is the only method that is used for Unidirectional Path Tracing in practice. Bidirectional Path Tracing provides an algorithm that combines the two approaches and can produce lower variance than either method alone. For each sample, two paths are traced independently: one using from the light source and one from the camera. This produces a set of possible sampling strategies, where every vertex of one path can be connected directly to every vertex of the other. The original ''Light Tracing'' and ''Backwards Path Tracing'' algorithms are both special cases of these strategies. For ''Light Tracing'', it is connecting the vertices of the camera path directly to the first vertex of the light path. For ''Backwards Path Tracing'', it is connecting the vertices of the light path to the first vertex of the camera path. In addition, there are several completely new sampling strategies, where intermediate vertices are connected. Weighting all of these sampling strategies using Multiple Importance Sampling creates a new sampler that can converge faster than Unidirectional Path Tracing, even though more work is required for each sample. This works particularly well for caustics or scenes that are lit primarily through indirect lighting.


Performance

A path tracer continuously samples
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the sm ...
s of an
image An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensiona ...
. The image starts to become recognisable after only a few samples per pixel, perhaps 100. However, for the image to "converge" and reduce noise to acceptable levels usually takes around 5000 samples for most images, and many more for
pathological Pathology is the study of the causes and effects of disease or injury. The word ''pathology'' also refers to the study of disease in general, incorporating a wide range of biology research fields and medical practices. However, when used in th ...
cases. Noise is particularly a problem for animations, giving them a normally unwanted "film-grain" quality of random speckling. The central performance bottleneck in path tracing is the complex geometrical calculation of casting a ray. Importance Sampling is a technique which is motivated to cast fewer rays through the scene while still converging correctly to outgoing luminance on the surface point. This is done by casting more rays in directions in which the luminance would have been greater anyway. If the density of rays cast in certain directions matches the strength of contributions in those directions, the result is identical, but far fewer rays were actually cast. Importance Sampling is used to match ray density to
Lambert's Cosine law In optics, Lambert's cosine law says that the radiant intensity or luminous intensity observed from an ideal diffusely reflecting surface or ideal diffuse radiator is directly proportional to the cosine of the angle ''θ'' between the direction ...
, and also used to match BRDFs.
Metropolis light transport Metropolis light transport (MLT) is a global illumination application of a variant of the Monte Carlo method called the Metropolis–Hastings algorithm to the rendering equation for generating images from detailed physical descriptions of three-di ...
can result in a lower-noise image with fewer samples. This algorithm was created in order to get faster convergence in scenes in which the light must pass through odd corridors or small holes in order to reach the part of the scene that the camera is viewing. It has also shown promise in correctly rendering pathological situations with caustics. Instead of generating random paths, new sampling paths are created as slight mutations of existing ones. In this sense, the algorithm "remembers" the successful paths from light sources to the camera.


Scattering distribution functions

The reflective properties (amount, direction and color) of surfaces are modelled using BRDFs. The equivalent for transmitted light (light that goes through the object) are BSDFs. A path tracer can take full advantage of complex, carefully modelled or measured distribution functions, which controls the appearance ("material", "texture" or "shading" in computer graphics terms) of an object.


See also

*
Arnold (software) Arnold is a computer program for 3D rendering, rendering three-dimensional, computer-generated scenes using Unbiased rendering, unbiased, physically based rendering, physically-based, Monte Carlo path tracing techniques. Created in Spain by Marco ...
*
Blender (software) Blender is a free and open-source 3D computer graphics software tool set used for creating animated films, visual effects, art, 3D-printed models, motion graphics, interactive 3D applications, virtual reality, and, formerly, video games. Blen ...
– 3D program that integrates Cycles, a path tracing GPU accelerated rendering engine *
Octane Render Octane Render is an unbiased rendering application with real-time capability developed by graphics software company OTOY Inc. It was created by Terrence Vergauwen of the New Zealand based startup company Refractive Software LTD before being sol ...
*
Pixar RenderMan Pixar RenderMan (formerly PhotoRealistic RenderMan) is proprietary photorealistic 3D rendering software produced by Pixar Animation Studios. Pixar uses RenderMan to render their in-house 3D animated movie productions and it is also available as ...
* LuxCoreRenderer


Notes

# # Lafortune, E
Mathematical Models and Monte Carlo Algorithms for Physically Based Rendering
(PhD thesis), 1996. # Purcell, T J; Buck, I; Mark, W; and Hanrahan, P, "Ray Tracing on Programmable Graphics Hardware", ''Proc. SIGGRAPH 2002'', 703 – 712. See also Purcell, T
Ray tracing on a stream processor
(PhD thesis), 2004. # Robison, Austin
"Interactive Ray Tracing on the GPU and NVIRT Overview"
slide 37, I3D 2009. #
Vray demo
Other examples include Octane Render, Arion, and Luxrender. # # Veach, E., and Guibas, L. J
Metropolis light transport
In SIGGRAPH’97 (August 1997), pp. 65–76.
SmallPt
is an educational path tracer by Kevin Beason. It uses 99 lines of C++ (including scene description). This page has a good set of examples of noise resulting from this technique. {{DEFAULTSORT:Path Tracing Global illumination algorithms