Difference between revisions of "PhotonGI"

From LuxCoreRender Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by 2 users not shown)
Line 5: Line 5:
<p>
<p>


     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. Photon GI is only supported by the unidirectional "Path" engine.
     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.


</p>
</p>


=Example=


{| class="wikitable"
|
<gallery mode="packed" widths=300px heights=330px>
Without combined.png|Without PhotonGI (250&nbsp;samples, session init: 3&nbsp;seconds, render: 20&nbsp;seconds)
Without_direct.png|Direct Light - noise free
Without_indirect.png|Indirect Light - noisy, PhotonGI can help
With_photongi_combined.png|With PhotonGI (250&nbsp;samples, session init: 14&nbsp;seconds, render: 13&nbsp;seconds)
</gallery>
|}
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=


<ul>


 
<li>Photon Count (Millions):</li>
:<li>'''Photon Count (Millions):'''</li>


:A total limit on the number of photons used to build the cache.  
:A total limit on the number of photons used to build the cache.  


:<li>'''Photon Depth:'''</li>
<li>Photon Depth:</li>


: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.
: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.
</ul>


====Indirect Cache Settings====
====Indirect Cache Settings====
Line 29: Line 43:
<ul>
<ul>


<li>'''Indirect Cache:'''</li>
<li>Indirect Cache:</li>


Toggles the usage of indirect global illumination caching.  
:Toggles the usage of indirect global illumination caching.  


<li>'''Quality:'''</li>
<li>Quality:</li>


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.
: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.


<li>'''Brute Force Radius Scale:'''</li>
<li>Brute Force Radius Scale:</li>


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.
: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.


<li>'''Normal Angle:'''</li>
<li>Normal Angle:</li>


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.
: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.


<li>'''Glossiness Threshold:'''</li>
<li>Glossiness Threshold:</li>


The cache only includes materials with a roughness greater than this value.
:The cache only includes materials with a roughness greater than this value.


<li>'''Lookup Radius:'''</li>
<li>Lookup Radius:</li>


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.
: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.


</ul>
</ul>
Line 61: Line 75:
<ul>
<ul>


<li>'''Caustic Cache:'''</li>  
<li>Caustic Cache:</li>  


Toggles usage of the caustic cache.
:Toggles usage of the caustic cache.


<li>'''Max. Size (Millions):'''</li>  
<li>Max. Size (Millions):</li>  


Maximum number of photons stored in the caustic cache. This does not nessessarily affect the number of caustic cache entries however, because a photon can contribute none, one, or multiple entries.
: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.


<li>'''Lookup Radius:'''</li>  
<li>Lookup Radius:</li>  


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.
: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.


<li>'''Lookup Max. Count:'''</li>  
<li>Lookup Max. Count:</li>  


The maximum number of photons to consider per lookup. Higher values can give more accurate results, but may decrease rendering efficiency.
:The maximum number of photons to consider per lookup. Higher values can give more accurate results, but may decrease rendering efficiency.


<li>'''Normal Angle:'''</li>  
<li>Normal Angle:</li>  


Like 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.
: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.
 
<li>Merge Caustic Photons:</li>
: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.
 
</ul>


<li>'''Merge Caustic Photons:'''</li>
<li>Periodic Update:</li>
   
   
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.
: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).


</ul>
</ul>
Line 93: Line 113:
<ul>
<ul>


<li>'''Debug:'''</li>  
<li>Debug:</li>  


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 cache. (That debug mode will be directly influenced by the Brute Force Radius Scale setting of the Indirect Cache.) Turning the Debug mode to Off (Final Render Mode) will let LuxCore display the render result as normal.
: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.




<li>'''Compute and save:'''</li>  
<li>Compute and save:</li>  


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.  
: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.  


</ul>
</ul>

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.