How to change the Lightmap step distance for the indirect lighting cache?

Hello,

On my current project the default distance of Lightmass for generating the Indirect Lighting Cache samples doesn’t suit my level ( Indirect Lighting Cache in Unreal Engine | Unreal Engine Documentation ). The samples are too far away from each other producing incorrect lighting interpolation on my dynamic actors.

I dug a bit inside the source code but unfortunately I didn’t found something that could have helped me. Is there an hardcoded distance somewhere of maybe a console variable to change this default step distance ?

Nevermind, I found it ! :slight_smile:


The values that I was looking for were stored inside the BaseLightmass.ini file (I suggest creating a custom DefaultLightmass.ini file inside your project).

[DevOptions.PrecomputedDynamicObjectLighting]
bVisualizeVolumeLightSamples=False
bVisualizeVolumeLightInterpolation=False
NumHemisphereSamplesScale=2
SurfaceLightSampleSpacing=75
FirstSurfaceSampleLayerHeight=16
SurfaceSampleLayerHeightSpacing=32
NumSurfaceSampleLayers=3
DetailVolumeSampleSpacing=25
VolumeLightSampleSpacing=1000

Those are my edited values, the variables names are mostly self-explanatory. FirstSurfaceSampleLayerHeight define the first sample height from the ground, then SurfaceSampleLayerHeightSpacing the incremented step size for the number of additional samples (defined by NumSurfaceSampleLayers).

For the horizontal spacing, you simply need to change SurfaceLightSampleSpacing.


In 4.5 there will be a new property VolumeLightSamplePlacementScale in the world settings to do this, so you don’t have to edit ini’s.