Difference between revisions of "PhotonGI"

From LuxCoreRender Wiki
Jump to navigation Jump to search
 
Line 21: Line 21:
 
|}
 
|}
  
On the left is a render done without PhotonGI. When analyzing the direct and indirect light separately, it becomes clear that all the noise stems from the indirect light, which PhotonGI can accelerate. The last image to the right shows the result computed with the cache. At the same number of samples per pixel, the image is far cleaner and is faster to render, however the preprocessing of the cache prolongs the startup phase before the actual rendering starts.  
+
On the left is a render done without PhotonGI. When analyzing the direct and indirect light separately (with a node setup like [https://wiki.luxcorerender.org/File:Compositor_setup.PNG this]), it becomes clear that all the noise stems from the indirect light, which PhotonGI can accelerate. The last image to the right shows the result computed with the cache. At the same number of samples per pixel, the image is far cleaner and is faster to render, however the preprocessing of the cache prolongs the startup phase before the actual rendering starts.
  
 
=Technical Parameters=
 
=Technical Parameters=

Latest revision as of 13:16, 11 September 2019


Overview

The PhotonGI cache is a way of pre-calculating light by tracing photons in advance. LuxCoreRender can then use the result as a guide to render the image much more efficiently. It supports both a Indirect light cache and a Caustic cache, making it useful for a large variety of scenes. PhotonGI is only supported by the unidirectional "Path" engine.

Example

On the left is a render done without PhotonGI. When analyzing the direct and indirect light separately (with a node setup like this), it becomes clear that all the noise stems from the indirect light, which PhotonGI can accelerate. The last image to the right shows the result computed with the cache. At the same number of samples per pixel, the image is far cleaner and is faster to render, however the preprocessing of the cache prolongs the startup phase before the actual rendering starts.

Technical Parameters

  • Photon Count (Millions):
  • A total limit on the number of photons used to build the cache.
  • Photon Depth:
  • How many times a photon can bounce. Low values may speed up the cache building, but give lower quality. We recommend using a depth of 6-12.

Indirect Cache Settings


  • Indirect Cache:
  • Toggles the usage of indirect global illumination caching.
  • Quality:
  • Controls the threshold for the acceptable "messiness" of the cache. The Final preset is a high quality option but may take longer to build, while the Preview option prioritizes speed. When using a Custom value, a lower percentage forces the cache to reach a high quality while high percentage lets the cache finish at a lower quality. But remember, the cache will not trace more photons than the Photon Count allows, so photonGI may stop the calculation at a lower quality if the maximum number of photons is reached.
  • Brute Force Radius Scale:
  • PhotonGI can make splotches and bleeding artifacts in corners and complex areas, so the Brute Force Radius Scale is used to disable the cache in those spots and use brute force global illumination instead. Brute force is the typical global illumination method and is slower than PhotonGI but produces accurate results. Smaller values shrink the radius scale, meaning less brute force GI and faster renders. Larger values increase the size of the radius, which leads to larger areas using brute force. As a user, try to find a small value that does not give light splotches.
  • Normal Angle:
  • When 2 faces have a normal difference less than this angle, PhotonGI treats them as a single surface. The default value of 10° is generally fine.
  • Glossiness Threshold:
  • The cache only includes materials with a roughness greater than this value.
  • Lookup Radius:
  • The size of cache pieces that can be referenced when a ray hits a point. Large values can degrade rendering performance. Using the Automatic Lookup Radius option is generally ideal, because it finds the most efficient value based on the scene size.

Caustic Cache Settings


  • Caustic Cache:
  • Toggles usage of the caustic cache.
  • Max. Size (Millions):
  • Maximum number of photons stored in the caustic cache. This does not necessarily affect the number of caustic cache entries however because a photon can contribute none, one, or multiple entries.
  • Lookup Radius:
  • Similar to the previous Lookup Radius settings, this controls the distance a ray can reference the in cache when it hits a point. The default setting is sufficient for most uses but may need to be adjusted if the scene is very large or very small.
  • Lookup Max. Count:
  • The maximum number of photons to consider per lookup. Higher values can give more accurate results, but may decrease rendering efficiency.
  • Normal Angle:
  • Similar to the Normal Angle of the Indirect Cache, when 2 faces have a normal difference less than this angle, PhotonGI treats them as a single surface. The default value of 10° is alright for most usage.
  • Merge Caustic Photons:
  • Toggles whether to merge clumped photons to increase rendering performance. The Radius Scale controls maximum distance apart that they will be merged, and the default value is generally a good baseline. If you are noticing blurry caustics where they should be crisp, turn the radius down. If the caustics are deliberately unfocused and you would like a speed increase, you can turn the radius up.
  • Periodic Update:
  • Rebuild the caustic cache periodically to clean up photon noise. The step samples parameter controls how often the cache is rebuilt (e.g. every 100 samples, the render will pause and a new caustic cache is built. Afterwards, rendering resumes until the next cache rebuild, and so on).

    Misc. Settings


    • Debug:
    • These options display elements of the PhotonGI cache in the render result. Very useful for finding the right parameters, because it directly displays how the cache is behaving. Caustic Cache displays the results of the Caustic Cache and Show Indirect displays the indirect global illumination cache. Show Indirect/Path Mix displays a map of where brute force pathtracing and PhotonGI are being used. An area colored in red means that brute force will be utilized in that region instead of the PGI cache. Turning the Debug mode to Off (Final Render Mode) will let LuxCore display the render result as normal.
    • Compute and save:
    • When no cache file has been created yet, leaving Compute and save off will neither save nor use a .pgi file, essentially throwing away the cache after the render is complete. Once a cache file exists, turning Compute and save on will recompute the cache and overwrite the old .pgi file, whereas turning Compute and save off will not compute a new cache and use the saved one instead.