Search Unity

Unity [2020.1] New Feature - Russian Roulette and Sampling Improvements

Discussion in 'Global Illumination' started by kristijonas_unity, Mar 2, 2020.

  1. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    439
    ETR05-RR0vsRR2.gif
    Notice that when using Russian Roulette optimization, the output is almost identical. Yet the bake time is much faster.

    Overview
    These features were developed by Arthur Dufay (@ADufay).

    Russian roulette
    During the bake, we launch rays in the scene that bounce on the surfaces, creating a light path. This is a fundamental step for GI calculation. The more the ray bounces, the longer the path, and the more this said path is compute expensive. One cannot rely on the fact that a path will end by not intersecting any geometry. This is especially true in indoor scenes, so at some point the lightmapper needs to end the path. There are two ways of doing this: by setting a max bounce count, or in a random way by using Russian Roulette.

    Russian Roulette method takes into the account how meaningful the path is to the GI. The chances of a path ending early increases each time it bounces on a dark surface. This reduces the total bake times. Bright surfaces have an opposite effect, as they increase the importance of a path. This in turn increases the bake times.

    Note that Russian Roulette is not a noise reduction method. Aggressive Russian Roulette values will likely introduce noise in the lightmaps.

    Improved sampling
    We implemented a better decorrelation method for CPU and GPU lightmappers. This results in results in better lightmap convergence and less artifacts.

    Also, we have increased the sample count limits from 100.000 to one billion samples.

    Setup instructions

    LightingSettings.png

    You can find Russian Roulette option in the Lighting Settings window. Choose the value appropriate for your use case, and you are good to go. This option is available for both CPU and GPU lightmappers.

    Decorrelation improvements are active by default, and do not need any user input.

    Feature access & feedback
    You can get access to the feature by downloading the latest 2020.1 and 2020.2 alpha builds via the Unity Hub, or via this link - https://unity3d.com/alpha/2020.1a#downloads. We are looking forward to hearing your feedback!
     
    Last edited: Mar 13, 2020
  2. unit_dev123

    unit_dev123

    Joined:
    Feb 10, 2020
    Posts:
    626
    Thank you sir for speed improvements
     
    BATTLEKOT likes this.
  3. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    212
    BATTLEKOT and kristijonas_unity like this.
  4. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    673
    So, in practice, this technique is reducing samples on low light zones, killing rays earlier.
    Could we have the opposite feature?
    INCREASE sample count the darker it gets?
    (or DECREASE sample count on lighter surfaces)

    I always have grainy lightmaps on zones of low indirect light and that forces me to push sample count to astronomical levels globally, when I would only need it on low indirect light zones.
    I'm talking horror games here ;)
     
  5. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    439
    Adaptive sampling feature will do just that. We are working on it.
     
    atomicjoe and valarus like this.
unityunity