Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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

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

  1. kristijonas_unity


    Unity Technologies

    Feb 8, 2018
    Notice that when using Russian Roulette optimization, the output is almost identical. Yet the bake time is much faster.

    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


    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 - We are looking forward to hearing your feedback!
    Last edited: Mar 13, 2020
  2. unit_dev123


    Feb 10, 2020
    Thank you sir for speed improvements
    AntonioModer and BATTLEKOT like this.
  3. Jesper-Mortensen


    Unity Technologies

    Mar 15, 2013
  4. atomicjoe


    Apr 10, 2013
    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


    Unity Technologies

    Feb 8, 2018
    Adaptive sampling feature will do just that. We are working on it.
  6. JohnPontoco


    Dec 23, 2013
    Is there any benefit to allowing more than 4 bounces for rays? We work primarily with indoor scenes lit up by reflected sunlight (ie. no extra indoor lighting). 4 seems a bit low, but it's naturally hard to tell without being able to test higher values.
    Salvador-Romero likes this.
  7. Cascho01


    Mar 19, 2010
    Bakery plugin allows 5 bounces and I can see better/more realistic results than rendered with 4 bounces.
  8. ADufay


    Unity Technologies

    Jan 2, 2020
    Hello there !
    A bounce unlock has been added to both CPU and GPU Lightmappers, in 2020.2. You will be able to set up to 100 bounces.
    But, be careful with this, more than 10 bounces is not recommended since it can take a while to compute a 100 bounce light path.

    Note also that transparent materials aren't restricted to this 4/100 bounce limit (depending on unity version before or after 2020.2).

    JohnPontoco and Cascho01 like this.