Path Tracing

From Chunky Wiki
Jump to: navigation, search

Path tracing is a rendering technique for digital computer graphics similar to ray tracing in that rays are cast from a virtual camera into a digital scene. The cast rays are chosen at random, and at each intersection with a diffuse object in the scene a new reflection ray is picked at random. The random components in path tracing cause the rendered image to appear very noisy at first. The noise is reduced the longer the image is rendered, and the more samples per pixel (rays per pixel) are simulated.

Chunky uses path tracing to render high quality images of Minecraft worlds.

Contents

Render Quality & Samples Per Pixel

The defining factor for render quality is the number of samples per pixel (SPP). A simple way to understand SSP is to imagine you are in a dark room with a flashlight. The flashlight quickly turns on then off, giving you a glimpse at what it is pointing at. The flashlight also points in random directions. Each of the points the flashlight illuminates is a sample. The more samples you let the light get, the better idea you get about how the room looks. Using that metaphor, the higher SPP you have in a rendered image, the lower the graininess will be. However after a certain point, there will be diminishing returns. Using the metaphor again, if the flashlight keeps shining on something you can already see pretty well, it doesn't really improve your perception of the room. In other words, the difference in the image between, for example, 20,000 SSP and 21,000 SSP will not be as noticeable as between 1,000 SSP and 2,000 SSP.

Sunlight does not require high SSP to have a nice image. Outdoor scenes can be rendered with very low SPP if sunlight is enabled. Emitters (torches, lava, glowstone, pumpkins, etc.) require a lot of SSP to reduce graininess, so indoor scenes and similar scenes in low-light environments take a much higher SPP number to look good.

An indoor scene rendered with increasing SPP. The white numbers show SPP:

Cornell-spp-comparison.png

An outdoor scene with sunlight and emitters:

Day-light-spp-comparison.png

An outdoor scene with sunlight and disabled emitters:

Day-spp-comparison.png

Render Time

There is no definite answer to how long it will take to render a scene. The general guideline is that the longer you render an image, the better it will become. Take into account the diminishing returns explained above.

The time required to render a nice looking image depends on how well-lit the scene is, how many samples per second the renderer can produce, how powerful your CPU is, and how large the canvas is (in pixels).

Scaling the canvas has an effect on render time proportional to the pixel area of the canvas. An image of 800 by 800 pixels will take four times as long time to achieve the same quality as an image of 400 by 400 pixels since the total number of pixels has quadrupled. So, if your renders are taking too long, you can try to reduce the canvas size for quicker results.

SPP calculator

There is a handy online calculator available that will show you an estimate of how long time it takes to reach a required SPP value here: SPP Calculator

Noise from torches

Small but bright light sources, such as torches, add a lot of noise to a scene. It takes especially long time to render a scene that is lit mainly by a few torches. This is an unfortunate and unavoidable disadvantage of the Path Tracing rendering method.

Spp-demo.gif

See Also

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox