https://youtu.be/t_tT7pwO_j8

Modifying the Lightmass.ini File for Higher Quality Light Baking

If you go to your Unreal Engine config file, you can find BaseLightmass.ini. Make a copy of the original. Load it up in Notepad++ (or another text editor). The part that we are interested in is as follows.

[DevOptions.StaticLightingMediumQuality]
NumShadowRaysScale=2
NumPenumbraShadowRaysScale=4
ApproximateHighResTexelsPerMaxTransitionDistanceScale=3
MinDistanceFieldUpsampleFactor=3
NumHemisphereSamplesScale=2
NumImportanceSearchPhotonsScale=1
NumDirectPhotonsScale=2
DirectPhotonSearchDistanceScale=.5
NumIndirectPhotonPathsScale=1
NumIndirectPhotonsScale=2
NumIndirectIrradiancePhotonsScale=2
RecordRadiusScaleScale=.75
InterpolationMaxAngleScale=1
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.5
AdaptiveFirstBouncePhotonConeAngleScale=1
AdaptiveSkyVarianceThresholdScale=1

[DevOptions.StaticLightingHighQuality]
NumShadowRaysScale=4
NumPenumbraShadowRaysScale=8
ApproximateHighResTexelsPerMaxTransitionDistanceScale=6
MinDistanceFieldUpsampleFactor=5
NumHemisphereSamplesScale=4
NumImportanceSearchPhotonsScale=2
NumDirectPhotonsScale=2
DirectPhotonSearchDistanceScale=.5
NumIndirectPhotonPathsScale=2
NumIndirectPhotonsScale=4
NumIndirectIrradiancePhotonsScale=2
RecordRadiusScaleScale=.75
InterpolationMaxAngleScale=.75
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.25
AdaptiveFirstBouncePhotonConeAngleScale=2
AdaptiveSkyVarianceThresholdScale=.5

[DevOptions.StaticLightingProductionQuality]
NumShadowRaysScale=8
NumPenumbraShadowRaysScale=32
ApproximateHighResTexelsPerMaxTransitionDistanceScale=6
MinDistanceFieldUpsampleFactor=5
NumHemisphereSamplesScale=8
NumImportanceSearchPhotonsScale=3
NumDirectPhotonsScale=4
; Decrease direct photon search distance so that we will have more accurate shadow transitions. This requires a higher density of direct photons.
DirectPhotonSearchDistanceScale=.5
NumIndirectPhotonPathsScale=2
; Need a lot of indirect photons since we have increased the number of first bounce photons to use for final gathering with NumImportanceSearchPhotonsScale
NumIndirectPhotonsScale=8
NumIndirectIrradiancePhotonsScale=2
; Decreasing the record radius results in more records, which increases quality
RecordRadiusScaleScale=.5625
InterpolationMaxAngleScale=.75
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.25
AdaptiveFirstBouncePhotonConeAngleScale=2.5
AdaptiveSkyVarianceThresholdScale=.5

Update the ProductionQuality (or medium) to Architecture Visualization quality as follows:

[DevOptions.StaticLightingProductionQuality]
NumShadowRaysScale=32
NumPenumbraShadowRaysScale=64
ApproximateHighResTexelsPerMaxTransitionDistanceScale=9
MinDistanceFieldUpsampleFactor=7
NumHemisphereSamplesScale=64
NumImportanceSearchPhotonsScale=6
NumDirectPhotonsScale=32
DirectPhotonSearchDistanceScale=.5
NumIndirectPhotonPathsScale=32
NumIndirectPhotonsScale=64
NumIndirectIrradiancePhotonsScale=32
RecordRadiusScaleScale=.45
InterpolationMaxAngleScale=.75
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.25
AdaptiveFirstBouncePhotonConeAngleScale=2.5
AdaptiveSkyVarianceThresholdScale=.5

Alternatively, you may use these settings as utilized by Koola.

[DevOptions.StaticLightingProductionQuality]
NumShadowRaysScale=32
NumPenumbraShadowRaysScale=64
ApproximateHighResTexelsPerMaxTransitionDistanceScale=9
MinDistanceFieldUpsampleFactor=7
NumHemisphereSamplesScale=64
NumImportanceSearchPhotonsScale=6
NumDirectPhotonsScale=32
DirectPhotonSearchDistanceScale=.5
NumIndirectPhotonPathsScale=32
NumIndirectPhotonsScale=64
NumIndirectIrradiancePhotonsScale=32
RecordRadiusScaleScale=.45
InterpolationMaxAngleScale=.75
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.25
AdaptiveFirstBouncePhotonConeAngleScale=2.5

In the ConsoleVariables.ini you should add the line below to the bottom of the file.

r.LightPropagationVolume=1

This enables the real time global illumination light propagation profiles. Restart your editor afterwords.


An explanation of how the in-engine options reflects changes to the baselightmass.ini file was written by DanielW, Epic Games, Unreal Engine Developer.

"As for ini settings vs UI settings, we try to make the UI settings have the same results as tweaked ini settings but with much more intuitive settings. In other words, you should not have to tweak *ini'*s to get best results.

IndirectLightingQuality

Scales many of the things that are scaled up in Koola's ini settings. In particular, it will increase the base resolution of the adaptive solver (how many rays are initially traced in the final gather, NumHemisphereSamples) and then it will also increase the maximum adaptive depth (how closely we look in one direction where brightness differences are found, NumAdaptiveRefinementLevels and AdaptiveBrightnessThresholdScale). Increasing this will of course explode build times.

IndirectLightingScale

Controls the size of the shadow details that Lightmass tries to solve. This was originally intended to speed up lighting in large levels where you are just flying through and not looking at the details. I haven't tested with values smaller than 1 much but I've seen guys like Koola get good results. The main thing that can be improved here is that Lightmass will compute indirect lighting at a finer granularity with smaller IndirectLightingScales instead of just interpolating it from neighbors through Irradiance Caching.