SlideShare a Scribd company logo
Lightmass Deep Dive
#2 Practical usage of Lightmass in
Architectural Visualization
Architectural Visualizer
Kenichi Makaya
Profile
• Creating architectural perspectives since 2008 as a
freelancer.
• Started creating architectural content with UE4 soon
after its release.
CASA BARRAGAN
Practical usage of Lightmass in  Architectural Visualization  (Kenichi Makaya, UE4 Lightmass Deep Dive)
Scene Data Used in this Presentation
Forum Sample
Reference Resources
https://forums.unrealengine.com/showthread.php?
88952-Lets-make-Lightmass-EPIC-(and
-understandable)&p=413678&viewfull=1#post413678
Casa Barragan
House of Mexican Architect,
Luis Barragan
Test PC Specs
• CPU Core i7 4790K 4.0GHZ x 4 core
• Memory 16GB
• GPU GTX770
Presentation Theme
Improving
Lightmass Details and
Addressing Artifacts
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Production Settings with Normal Lighting Layout
Final Settings
Rendering Soft Indirect
Lighting
Likely differs from
optimizations for games
Procedure
1. Selecting Lights
2. Setting up the Scene
3. Testing Lighting
4. Lighting Sketch (Esquisse)
5. Final Lighting
6. Lightmass Deep Dive
1.Selecting Lights
Four Types of Lights:
•Directional Light
•Point Light
•Spot Light
•Sky Light
Light Mobility: Static or Stationary?
Designed mainly using Directional Light and Sky
Light
But encountered problems....
Insufficient diffraction of Indirect Light
Sky Light can calculate only one
bounce of Indirect Light
Drawbacks of Sky Light
Lighting from Sky Light only
Drawbacks of Sky Light
Insufficient diffraction of Indirect Light
Because no photons are
emitted
Emit Photons
• Directional Light
• Point Light
• Spot Light
Emit No Photons
• Sky Light
Need Soft Indirect Lighting from the window
Spot Light placed in window
Static Spot Light Source Radius 200
Both Light and Shadows are
hard
Used Koola-style Bounce
Card
What is a Koola Bounce Card?
Supports multiple bounces of Indirect Light while enabling Soft Lighting.
Koola Bounce Card Size 200 x 200 cm
Static Spot Light Source Radius 200
Main Lights Used in Casa Barragan
• Directional Light
• Sky Light
• Koola Bounce Card
Decided to try the above settings first
Stationary
Static
Static Spot Light
2. Setting up the Scene
Lightmass Importance Volume Placement
Specifies Area for Volume Lighting Samples
Lightmass Portal
Specifies Area of Focus for Final Gathering calculations
Improved Skylight Quality
With Portal
Improved Skylight Quality
Without Portal
Improved Skylight Quality
With Portal
Improved Skylight Quality
Without Portal
Reflection Capture Placement
Without Reflection Captures, results are poor due to Skylight reflection
Reflection Capture Placement
Better to temporarily place Reflection Captures to approximate the final image
PostProcess Off
• Auto Exposure
• Causes exposure changes
• Bloom
• Overly bright screen and poor results
• Screen Space Ambient Occlusion (AO)
Difficult to tell if results are from the light bake or from
AO
Compress LightMaps off
UMAP size 63MB
Not sure whether noise is caused by insufficient number of samples during
light bake or by compression noise. Be careful of increase in Light map size!
UMAP size 90MB
3. Test Lighting
Adjusting Lighting Balance
Preview or Medium Lighting Quality is good enough
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 0 2m54s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 1 3m41s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 2 3m35s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 3 3m46s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 5 3m39s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 10 3m55s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 20 3m42s
Adjusting Num Indirect Lighting Bounces
Num Indirect Lighting Bounces 100 3m31s
Adjusting Num Indirect Lighting Bounces
• Differences are practically unnoticeable at
around 10
• Almost no influence on build time
4. Lighting Sketch (Esquisse)
Need detail in the Lightmaps
How?
1. Higher Lightmap Resolution
• Details lower than or equal to minimum texel of light map can not be captured
LightmapResolution = 64LightmapResolution = 512
2. Decrease Static Lighting Level Scale
(Decrease RecordRadiusScale of Irradiance caching)
• Details smaller than RecordRadius can not be captured
StaticLightingLevelScale = 0.1StaticLightingLevelScale = 1
This means...
1. Decrease Static Lighting Level Scale until
required detail is present
2. Increase lightmap resolution until
detail can be captured
1. Setting Static Lighting Level
Scale
Details of shadows
and bokeh around here
need to be reproduced
in our scene.
Details in photograph
Reference source http://motokimokito.blogspot.jp/
Static Lighting Level Scale = 1 (Default)
Static Lighting Level Scale = 0.5
Static Lighting Level Scale = 0.2
Static Lighting Level Scale =0.1 We’ll use this!
At this stage,
do not worry about noise.
Check the Detail.
Setting for Final Lighting Build
Is sufficient detail reproduced?
Reference source: http://motokimokito.blogspot.jp/
Influence on Dynamic Meshes
Be careful! Decreasing Static Lighting Level Scale increases
Volume Lighting Samples.
Static Lighting Level Scale 1.0 Static Lighting Level Scale 0.1
2. Setting Lightmap Resolution
Light Map Resolution 32
Light Map Resolution 64
Light Map Resolution 128
Light Map Resolution 256
Light Map Resolution 512
Light Map Resolution 1024
Detail of Direct Shadows
Tempted to increase resolution to prevent jaggy shadows
Detail of Direct Shadows
Used Cascaded Shadows instead to avoid increasing resolution
Lightmap Resolution was set
Is it enough to simply increase
LightMapResolution for each
mesh?
Adjusting UVs for
Lightmaps is still required
Adjust to appropriate padding
Padding between UV islands for Lightmap = 0
Adjust to appropriate padding
Padding between UV islands for Lightmap = 4
Adjust padding to 4 texels
64
4
Adjusting Indirect
Lighting Smoothness
Static Lighting Level Scale = 0.1
Indirect Lighting Quality = 5
Medium
Decided on the above settings
Indirect Lighting Smoothness = 0.5 28m56s
Indirect Lighting Smoothness = 0.8 32m55s
Indirect Lighting Smoothness = 1 29m46s (Default Value)
Indirect Lighting Smoothness = 1.2 33m22s
Indirect Lighting Smoothness = 1.5 28m58s
Indirect Lighting Smoothness = 2.0 33m28s
Indirect Lighting Smoothness = 0.5 28m56s
Indirect Lighting Smoothness = 0.8 32m55s
Indirect Lighting Smoothness = 1 29m46s (Default Value)
Indirect Lighting Smoothness = 1.2 33m22s
Indirect Lighting Smoothness = 1.5 28m58s
Indirect Lighting Smoothness = 2.0 33m28s
Indirect Lighting Smoothness = 0.5 28m56s
Indirect Lighting Smoothness = 0.8 32m55s
Indirect Lighting Smoothness = 1 29m46s (Default Value)
Indirect Lighting Smoothness = 1.2 33m22s
Indirect Lighting Smoothness = 1.5 28m58s
Indirect Lighting Smoothness = 2.0 33m28s
Indirect Lighting Smoothness = 0.5 28m56s
Indirect Lighting Smoothness = 0.8 32m55s
Indirect Lighting Smoothness = 1 29m46s (Default Value)
Indirect Lighting Smoothness = 1.2 33m22s
Indirect Lighting Smoothness = 1.5 28m58s
Indirect Lighting Smoothness = 0.5 28m56s
Indirect Lighting Smoothness = 0.8 32m55s
Indirect Lighting Smoothness = 1 29m46s (Default Value)
Indirect Lighting Smoothness = 1.2 33m22s
Indirect Lighting Smoothness = 1.5 28m58s
Indirect Lighting Smoothness = 2.0 33m28s
Indirect Lighting Smoothness = 0.5 28m56s
Indirect Lighting Smoothness = 0.8 32m55s
Indirect Lighting Smoothness = 1 29m46s (Default Value)
Indirect Lighting Smoothness = 1.2 33m22s
Indirect Lighting Smoothness = 1.5 28m58s
Indirect Lighting Smoothness = 2.0 33m28s
More Detail
Increased Noise
Improved
Smoothness
Less Detail
1.0Value Decreased Value Increased
How Indirect Lighting Smoothness
works
Basically,
Indirect Lighting Smoothness=1.0
is acceptable.
The following values may be
also be acceptable:
If detail is important: 0.8
If smoothness is important: 1.2
5. Final Lighting
Addressing artifacts
Before that,
What are the Lighting Quality and
Lightmass settings doing?
In BaseLightmass.ini, we already
mentioned:
• Static Lighting Level Scale,
• Num Indirect Lighting Bounces,
and other settings including:
Indirect Lighting Quality,
Indirect Lighting Smoothness
Configuring BaseLightmass.ini
BaseLightmass.ini is in
C:Program FilesEpic
Games4.12EngineConfig
; These are tweaked defaults for various lightmass solver and export settings
; Artist-oriented lightmass settings are in the editor UI
; Documentation for all of these is in UnrealLightmass/Public/SceneExport.h
; This ini is reloaded every time a lighting build begins, no need to restart
[DevOptions.StaticLighting]
bAllowMultiThreadedStaticLighting=True
ViewSingleBounceNumber=-1
bUseBilinearFilterLightmaps=True
bCompressLightmaps=True
bUseConservativeTexelRasterization=True
bAccountForTexelSize=True
bUseMaxWeight=True
MaxTriangleLightingSamples=8
MaxTriangleIrradiancePhotonCacheSamples=4
bAllow64bitProcess=True
DefaultStaticMeshLightingRes=32
bAllowCropping=False
bGarbageCollectAfterExport=True
bRebuildDirtyGeometryForLighting=True
bUseEmbree=true
bVerifyEmbree=false
[DevOptions.StaticLightingSceneConstants]
StaticLightingLevelScale=1
VisibilityRayOffsetDistance=.1
VisibilityNormalOffsetDistance=3
VisibilityNormalOffsetSampleRadiusScale=.5
VisibilityTangentOffsetSampleRadiusScale=.8
SmallestTexelRadius=.1
; Tweaked for a good tradeoff between 'Cache Indirect Photon Paths' time and Indirect photon emitting
'Sampling Lights' time
LightGridSize=100
AutomaticImportanceVolumeExpandBy=500
MinimumImportanceVolumeExtentWithoutWarning=10000.0
[DevOptions.StaticLightingMaterial]
bUseDebugMaterial=False
ShowMaterialAttribute=None
; Material export sizes default to very small to keep exports fast
EmissiveSampleSize=128
DiffuseSampleSize=128
SpecularSampleSize=128
TransmissionSampleSize=256
NormalSampleSize=256
; Terrain materials default to much higher resolution since each material typically covers a large area in world
space
TerrainSampleScalar=4
DebugDiffuse=(R=0.500000,G=0.500000,B=0.500000)
EnvironmentColor=(R=0.00000,G=0.00000,B=0.00000)
[DevOptions.MeshAreaLights]
bVisualizeMeshAreaLightPrimitives=False
; Only emissive texels above .01 will be used to create mesh area lights
EmissiveIntensityThreshold=.01
MeshAreaLightGridSize=100
MeshAreaLightSimplifyNormalAngleThreshold=25
MeshAreaLightSimplifyCornerDistanceThreshold=.5
MeshAreaLightSimplifyMeshBoundingRadiusFractionThreshold=.1
MeshAreaLightGeneratedDynamicLightSurfaceOffset=30
[DevOptions.PrecomputedDynamicObjectLighting]
bVisualizeVolumeLightSamples=False
bVisualizeVolumeLightInterpolation=False
NumHemisphereSamplesScale=2
SurfaceLightSampleSpacing=300
FirstSurfaceSampleLayerHeight=50
SurfaceSampleLayerHeightSpacing=250
NumSurfaceSampleLayers=2
DetailVolumeSampleSpacing=300
VolumeLightSampleSpacing=3000
; Clamp the number of volume samples generated to ~15mb
MaxVolumeSamples=250000
bUseMaxSurfaceSampleNum=True
; Approximately clamp the number of surface samples generated to ~30mb (only for Landscape currently)
MaxSurfaceLightSamples=500000
[DevOptions.PrecomputedVisibility]
bVisualizePrecomputedVisibility=False
bCompressVisibilityData=True
bPlaceCellsOnOpaqueOnly=True
NumCellDistributionBuckets=800
CellRenderingBucketSize=5
NumCellRenderingBuckets=5
PlayAreaHeight=220
MeshBoundsScale=1.2
VisibilitySpreadingIterations=1
MinMeshSamples=14
MaxMeshSamples=40
NumCellSamples=24
NumImportanceSamples=40
[DevOptions.PrecomputedVisibilityModeratelyAggressive]
MeshBoundsScale=1
VisibilitySpreadingIterations=1
[DevOptions.PrecomputedVisibilityMostAggressive]
MeshBoundsScale=1
VisibilitySpreadingIterations=0
[DevOptions.VolumeDistanceField]
VoxelSize=75
VolumeMaxDistance=900
NumVoxelDistanceSamples=800
; Clamp the size of the volume distance field generated to ~15mb
MaxVoxels=3992160
[DevOptions.StaticShadows]
; Using area shadows by default instead of filtering in texture space
bUseZeroAreaLightmapSpaceFilteredLights=False
NumShadowRays=8
NumPenumbraShadowRays=8
NumBounceShadowRays=1
bFilterShadowFactor=True
ShadowFactorGradientTolerance=0.5
bAllowSignedDistanceFieldShadows=True
MaxTransitionDistanceWorldSpace=50
ApproximateHighResTexelsPerMaxTransitionDistance=50
MinDistanceFieldUpsampleFactor=3
MinUnoccludedFraction=.005
StaticShadowDepthMapTransitionSampleDistanceX=100
StaticShadowDepthMapTransitionSampleDistanceY=100
StaticShadowDepthMapSuperSampleFactor=2
; Clamp the number of shadow samples generated to ~8mb for huge levels
StaticShadowDepthMapMaxSamples=4194304
[DevOptions.ImportanceTracing]
bUseCosinePDF=False
bUseStratifiedSampling=True
NumHemisphereSamples=16
MaxHemisphereRayAngle=89
bUseAdaptiveSolver=true
NumAdaptiveRefinementLevels=2
AdaptiveBrightnessThreshold=1
AdaptiveFirstBouncePhotonConeAngle=4
[DevOptions.PhotonMapping]
bUsePhotonMapping=True
bUseFinalGathering=True
bUsePhotonDirectLightingInFinalGather=False
bVisualizeCachedApproximateDirectLighting=False
bUseIrradiancePhotons=True
bCacheIrradiancePhotonsOnSurfaces=True
bVisualizePhotonPaths=False
bVisualizePhotonGathers=True
bVisualizePhotonImportanceSamples=False
bVisualizeIrradiancePhotonCalculation=False
bEmitPhotonsOutsideImportanceVolume=False
ConeFilterConstant=1
; 400 gives a smooth enough result without requiring a very large search
NumIrradianceCalculationPhotons=400
; Allocating most final gather samples towards importance samples gives a good result as long as there are
enough first bounce photons
FinalGatherImportanceSampleFraction=.6
; 10 degrees is a good tradeoff between capturing high frequency incident lighting at final gather points and
covering the whole incident lighting domain with a limited number of importance directions
FinalGatherImportanceSampleConeAngle=10
IndirectPhotonEmitDiskRadius=200
IndirectPhotonEmitConeAngle=30
MaxImportancePhotonSearchDistance=2000
MinImportancePhotonSearchDistance=20
; Preview uses a very small number of importance directions
NumImportanceSearchPhotons=10
OutsideImportanceVolumeDensityScale=.0005
DirectPhotonDensity=350
; Same as DirectPhotonDensity, since currently direct photons are only used to create irradiance photons
DirectIrradiancePhotonDensity=350
DirectPhotonSearchDistance=200
IndirectPhotonPathDensity=5
; Need a very high indirect photon density since first bounce photons are used to guide the final gather
IndirectPhotonDensity=600
IndirectIrradiancePhotonDensity=300
IndirectPhotonSearchDistance=200
PhotonSearchAngleThreshold=.5
IrradiancePhotonSearchConeAngle=10
CachedIrradiancePhotonDownsampleFactor=2
[DevOptions.IrradianceCache]
bAllowIrradianceCaching=True
bUseIrradianceGradients=False
bShowGradientsOnly=False
bVisualizeIrradianceSamples=True
RecordRadiusScale=.8
InterpolationMaxAngle=20
PointBehindRecordMaxAngle=10
; Increase distance and angle constraints in the shading pass, which filters the interpolated result without
losing too much detail.
DistanceSmoothFactor=4
AngleSmoothFactor=4
; Sky occlusion has less noise than normal GI, don't blur away details
SkyOcclusionSmoothnessReduction=.5
; Enforce a minimum sample rate on surfaces with no nearby occluders
MaxRecordRadius=1024
CacheTaskSize=64
InterpolateTaskSize=64
[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
[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
[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
Whoa! So many settings!
When Lighting Quality is set to Production:
[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
[DevOptions.StaticLightingProductionQuality]
NumShadowRaysScale=8
NumPenumbraShadowRaysScale=32
ApproximateHighResTexelsPerMaxTransitionDistanceScale=6
MinDistanceFieldUpsampleFactor=5
NumHemisphereSamplesScale=8
NumImportanceSearchPhotonsScale=3
NumDirectPhotonsScale=4
DirectPhotonSearchDistanceScale=.5
NumIndirectPhotonPathsScale=2
NumIndirectPhotonsScale=8
NumIndirectIrradiancePhotonsScale=2
RecordRadiusScaleScale=.5625
InterpolationMaxAngleScale=.75
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.25
AdaptiveFirstBouncePhotonConeAngleScale=2.5
What do these each adjust?
Number of rays in final gathering
Shadow Quality
Number of photons and quality of
photon mapping calculation
Irradiance Caching Quality
Quality of Adaptive Sampling for
Final Gathering
Scales important items
collectively so that artists can
adjust with just one setting
Possible to overwrite
settings where necessary
in DefaultLightmass.ini
located in
<ProjectName>Config
I will explain this later
Now, back to addressing
artifacts
First, adjust Lighting Quality
Used Static Lighting Level
Scale=0.1
Preview 2m16s
Medium 7m48s
High 13m58s
Production 30m22s
Quality is still insufficient
Need higher calculation
accuracy for light
Adjust with Indirect Lighting
Quality
(Increase number of rays in final gathering)
Indirect Lighting Quality 1 Medium 7m48s
Indirect Lighting Quality 2 Medium 12m55s
Indirect Lighting Quality 5 Medium 29m46s
Indirect Lighting Quality 10 Medium 1h5m24s
Most artifacts disappear at 10
Static Lighting Level Scale=0.1 Indirect Lighting Quality=10 Production 4h10m24s
Static Lighting Level Scale×Indirect Lighting Quality =1.0
Artifacts can be reduced to an acceptable
level when the above multiplication results
in 1.0
With Lighting Quality set to Production Level
0.1 10
0.2 5
0.5 2
X
X
X
Lightmass Settings Final Settings
Static Lighting Level Scale= 0.1
Num Indirect Lighting Bounces=20
Indirect Lighting Quality = 10
Indirect Lighting Smoothness=1.0
Lighting Quality = Production
6. Lightmass Deep Dive
Let’s adjust Lightmass.ini
BaseLightmass.ini is in
C:Program FilesEpic
Games4.12EngineConfig
; These are tweaked defaults for various lightmass solver and export settings
; Artist-oriented lightmass settings are in the editor UI
; Documentation for all of these is in UnrealLightmass/Public/SceneExport.h
; This ini is reloaded every time a lighting build begins, no need to restart
[DevOptions.StaticLighting]
bAllowMultiThreadedStaticLighting=True
ViewSingleBounceNumber=-1
bUseBilinearFilterLightmaps=True
bCompressLightmaps=True
bUseConservativeTexelRasterization=True
bAccountForTexelSize=True
bUseMaxWeight=True
MaxTriangleLightingSamples=8
MaxTriangleIrradiancePhotonCacheSamples=4
bAllow64bitProcess=True
DefaultStaticMeshLightingRes=32
bAllowCropping=False
bGarbageCollectAfterExport=True
bRebuildDirtyGeometryForLighting=True
bUseEmbree=true
bVerifyEmbree=false
[DevOptions.StaticLightingSceneConstants]
StaticLightingLevelScale=1
VisibilityRayOffsetDistance=.1
VisibilityNormalOffsetDistance=3
VisibilityNormalOffsetSampleRadiusScale=.5
VisibilityTangentOffsetSampleRadiusScale=.8
SmallestTexelRadius=.1
; Tweaked for a good tradeoff between 'Cache Indirect Photon Paths' time and Indirect photon emitting
'Sampling Lights' time
LightGridSize=100
AutomaticImportanceVolumeExpandBy=500
MinimumImportanceVolumeExtentWithoutWarning=10000.0
[DevOptions.StaticLightingMaterial]
bUseDebugMaterial=False
ShowMaterialAttribute=None
; Material export sizes default to very small to keep exports fast
EmissiveSampleSize=128
DiffuseSampleSize=128
SpecularSampleSize=128
TransmissionSampleSize=256
NormalSampleSize=256
; Terrain materials default to much higher resolution since each material typically covers a large area in world
space
TerrainSampleScalar=4
DebugDiffuse=(R=0.500000,G=0.500000,B=0.500000)
EnvironmentColor=(R=0.00000,G=0.00000,B=0.00000)
[DevOptions.MeshAreaLights]
bVisualizeMeshAreaLightPrimitives=False
; Only emissive texels above .01 will be used to create mesh area lights
EmissiveIntensityThreshold=.01
MeshAreaLightGridSize=100
MeshAreaLightSimplifyNormalAngleThreshold=25
MeshAreaLightSimplifyCornerDistanceThreshold=.5
MeshAreaLightSimplifyMeshBoundingRadiusFractionThreshold=.1
MeshAreaLightGeneratedDynamicLightSurfaceOffset=30
[DevOptions.PrecomputedDynamicObjectLighting]
bVisualizeVolumeLightSamples=False
bVisualizeVolumeLightInterpolation=False
NumHemisphereSamplesScale=2
SurfaceLightSampleSpacing=300
FirstSurfaceSampleLayerHeight=50
SurfaceSampleLayerHeightSpacing=250
NumSurfaceSampleLayers=2
DetailVolumeSampleSpacing=300
VolumeLightSampleSpacing=3000
; Clamp the number of volume samples generated to ~15mb
MaxVolumeSamples=250000
bUseMaxSurfaceSampleNum=True
; Approximately clamp the number of surface samples generated to ~30mb (only for Landscape currently)
MaxSurfaceLightSamples=500000
[DevOptions.PrecomputedVisibility]
bVisualizePrecomputedVisibility=False
bCompressVisibilityData=True
bPlaceCellsOnOpaqueOnly=True
NumCellDistributionBuckets=800
CellRenderingBucketSize=5
NumCellRenderingBuckets=5
PlayAreaHeight=220
MeshBoundsScale=1.2
VisibilitySpreadingIterations=1
MinMeshSamples=14
MaxMeshSamples=40
NumCellSamples=24
NumImportanceSamples=40
[DevOptions.PrecomputedVisibilityModeratelyAggressive]
MeshBoundsScale=1
VisibilitySpreadingIterations=1
[DevOptions.PrecomputedVisibilityMostAggressive]
MeshBoundsScale=1
VisibilitySpreadingIterations=0
[DevOptions.VolumeDistanceField]
VoxelSize=75
VolumeMaxDistance=900
NumVoxelDistanceSamples=800
; Clamp the size of the volume distance field generated to ~15mb
MaxVoxels=3992160
[DevOptions.StaticShadows]
; Using area shadows by default instead of filtering in texture space
bUseZeroAreaLightmapSpaceFilteredLights=False
NumShadowRays=8
NumPenumbraShadowRays=8
NumBounceShadowRays=1
bFilterShadowFactor=True
ShadowFactorGradientTolerance=0.5
bAllowSignedDistanceFieldShadows=True
MaxTransitionDistanceWorldSpace=50
ApproximateHighResTexelsPerMaxTransitionDistance=50
MinDistanceFieldUpsampleFactor=3
MinUnoccludedFraction=.005
StaticShadowDepthMapTransitionSampleDistanceX=100
StaticShadowDepthMapTransitionSampleDistanceY=100
StaticShadowDepthMapSuperSampleFactor=2
; Clamp the number of shadow samples generated to ~8mb for huge levels
StaticShadowDepthMapMaxSamples=4194304
[DevOptions.ImportanceTracing]
bUseCosinePDF=False
bUseStratifiedSampling=True
NumHemisphereSamples=16
MaxHemisphereRayAngle=89
bUseAdaptiveSolver=true
NumAdaptiveRefinementLevels=2
AdaptiveBrightnessThreshold=1
AdaptiveFirstBouncePhotonConeAngle=4
[DevOptions.PhotonMapping]
bUsePhotonMapping=True
bUseFinalGathering=True
bUsePhotonDirectLightingInFinalGather=False
bVisualizeCachedApproximateDirectLighting=False
bUseIrradiancePhotons=True
bCacheIrradiancePhotonsOnSurfaces=True
bVisualizePhotonPaths=False
bVisualizePhotonGathers=True
bVisualizePhotonImportanceSamples=False
bVisualizeIrradiancePhotonCalculation=False
bEmitPhotonsOutsideImportanceVolume=False
ConeFilterConstant=1
; 400 gives a smooth enough result without requiring a very large search
NumIrradianceCalculationPhotons=400
; Allocating most final gather samples towards importance samples gives a good result as long as there are
enough first bounce photons
FinalGatherImportanceSampleFraction=.6
; 10 degrees is a good tradeoff between capturing high frequency incident lighting at final gather points and
covering the whole incident lighting domain with a limited number of importance directions
FinalGatherImportanceSampleConeAngle=10
IndirectPhotonEmitDiskRadius=200
IndirectPhotonEmitConeAngle=30
MaxImportancePhotonSearchDistance=2000
MinImportancePhotonSearchDistance=20
; Preview uses a very small number of importance directions
NumImportanceSearchPhotons=10
OutsideImportanceVolumeDensityScale=.0005
DirectPhotonDensity=350
; Same as DirectPhotonDensity, since currently direct photons are only used to create irradiance photons
DirectIrradiancePhotonDensity=350
DirectPhotonSearchDistance=200
IndirectPhotonPathDensity=5
; Need a very high indirect photon density since first bounce photons are used to guide the final gather
IndirectPhotonDensity=600
IndirectIrradiancePhotonDensity=300
IndirectPhotonSearchDistance=200
PhotonSearchAngleThreshold=.5
IrradiancePhotonSearchConeAngle=10
CachedIrradiancePhotonDownsampleFactor=2
[DevOptions.IrradianceCache]
bAllowIrradianceCaching=True
bUseIrradianceGradients=False
bShowGradientsOnly=False
bVisualizeIrradianceSamples=True
RecordRadiusScale=.8
InterpolationMaxAngle=20
PointBehindRecordMaxAngle=10
; Increase distance and angle constraints in the shading pass, which filters the interpolated result without
losing too much detail.
DistanceSmoothFactor=4
AngleSmoothFactor=4
; Sky occlusion has less noise than normal GI, don't blur away details
SkyOcclusionSmoothnessReduction=.5
; Enforce a minimum sample rate on surfaces with no nearby occluders
MaxRecordRadius=1024
CacheTaskSize=64
InterpolateTaskSize=64
[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
[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
[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
Don’t worry!
Copy, paste, and edit values
only where
tuning is required,
then put it in
<ProjectName>Config
as “DefaultLightmass.ini”
For example, when
area shadow quality
needs to be improved,
Increase shadow detail in DefaultLightmass.ini
Default Values for Medium Setting
Allows tuning that is not available in Editor
NumShadowRaysScale=16 NumPenumbraShadowRaysScale=64
Simply copy and paste from BaseLightmass.ini, and
change the values
Save as ”DefaultLightmass.ini” in <ProjectName>Config
Experimented with the various
config file settings
Quality improves
as number of rays increases
but processing takes longer
Improving Final Gathering
Increasing Indirect Lighting Quality
↓
Increases Number of Rays in Final
gathering
Insufficient Rays
Sufficient Rays
Sufficient Rays
Insufficient Rays
Increasing rays across the entire area may be wasteful...
Improving Final Gathering
Increasing Indirect Lighting Quality increases
rays even where unnecessary
↓
Use adaptive sampling to increase rays only
where necessary
↓
Increase level of adaptive sampling refinement
or
Decrease threshold of intensity when increasing
the level
Increase
level of adaptive sample
refinement
NumAdaptiveRefinementLevel
NumAdaptiveRefinementLevels = 0 Medium 1 m16s
NumAdaptiveRefinementLevels = 1 Medium 2 m15s
NumAdaptiveRefinementLevels = 2 Medium 4 m43s
(Default Value when Lighting Quality is Preview)
NumAdaptiveRefinementLevels = 3 Medium 10 m59s
(Default Value when Lighting Quality is Medium, High, or Production)
NumAdaptiveRefinementLevels = 4 Medium 34 m45s
Adjust threshold
to increase level of adaptive sample
refinement
AdaptiveBrightnessThresholdScale
Static Lighting Level Scale = 0.2
Indirect Lighting Quality = 5
Medium
Decided on the above settings
NumAdaptiveRefinementLevels = 3 AdaptiveBrightnessThresholdScale = 0.5
(Medium Default) 3 m 28 s
NumAdaptiveRefinementLevels=3 AdaptiveBrightnessThresholdScale = 0.25
3 m 33 s
NumAdaptiveRefinementLevels = 3 AdaptiveBrightnessThresholdScale = 0.05
4 m 13 s
NumAdaptiveRefinementLevels = 4 AdaptiveBrightnessThresholdScale = 0.5
12 m 41 s
NumAdaptiveRefinementLevels = 5 AdaptiveBrightnessThresholdScale = 0.25
48 m 03 s
Why is it so time consuming?
Let’s compare when set at
Static Lighting Level Scale = 0.2
and Indirect Lighting Quality = 10
Production
Static Lighting Level Scale=0.2 Indirect Lighting Quality=10 Production 28m22s
NumAdaptiveRefinementLevels = 5 AdaptiveBrightnessThresholdScale = 0.25
48 m 03 s
Because cost performance is low,
increasing the number of rays of
Indirect Lighting Quality
is better.
Be careful when using a value of
11 or more for
Indirect Lighting Quality
When Indirect Lighting Quality>11,
NumAdaptiveRefinementLevel +1
Build time increases substantially.
Adjust the number of rays in Lightmass.ini
Adjust “NumHemisphereSamplesScale” for each
Lighting Quality level
Or
[DevOptions.ImportanceTracing] NumHemisphereSamples
can scale the number of rays as well.
Lightmass.ini includes
all settings required to
apply custom tuning to your content.
Lets make Lightmass Epic
Talented artists including Koola study Lightmass
https://forums.unrealengine.com/showthread.php?88952-Lets-
make-Lightmass-EPIC-(and-understandable)
Conclusion
Emit Photons
• Directional Light
• Point Light
• Spot Light
• Koola Bounce Card
Emit No Photon
• Sky Light
• Use Emissive For
Static Lighting
Understanding differences in the behaviors of
various lights is important. Especially Sky light!
Lighting Quality
What does each setting influence?
Shadow
Photon Mapping
Irradiance Caching
Final Gathering
Overall Quality Settings
Setting Influence on
Influence on Build
time
High
Static Lighting Level
Scale
Num Indirect Lighting
Bounces
Indirect Lighting Quality
Indirect Lighting
Smoothness
What each setting influences on?
Details of Lightmass
(Irradiance Caching
recording radius)
Brightness of Scene
(Number of photon reflections)
Decreases artifact noise
(Number of rays for final
gathering)
Blurs indirect light component in
Lightmap
(Irradiance Caching
Interpolation Ratio)
Setting Influence on
Influence on Build
time
Medium
Low
High
Low
Lightmass Quality (Detail) & Build Time
=
Lightmap Resolution (Increases Resolution)
×
Lighting Quality (Improves Overall Quality)
×
Indirect Lighting Quality (Decreases Artifacts)
÷
Static Lighting Level Scale (Improves Detail)
Any feedback or suggestions
for better solutions
is
always welcome!
Thank you!
@torashami
http://www.frames-cg.com/

More Related Content

PDF
Physically Based Lighting in Unreal Engine 4
PDF
【UE4.25 新機能】ロードの高速化機能「IOStore」について
PPTX
Hable John Uncharted2 Hdr Lighting
PPT
The Unique Lighting of Mirror's Edge
PPTX
Lighting the City of Glass
PPTX
Optimizing the Graphics Pipeline with Compute, GDC 2016
PDF
Lighting Shading by John Hable
Physically Based Lighting in Unreal Engine 4
【UE4.25 新機能】ロードの高速化機能「IOStore」について
Hable John Uncharted2 Hdr Lighting
The Unique Lighting of Mirror's Edge
Lighting the City of Glass
Optimizing the Graphics Pipeline with Compute, GDC 2016
Lighting Shading by John Hable

What's hot (20)

PPTX
Moving Frostbite to Physically Based Rendering
PDF
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
PDF
「原神」におけるコンソールプラットフォーム開発
PDF
Siggraph2016 - The Devil is in the Details: idTech 666
PPTX
UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)
PDF
Unreal Summit 2016 Seoul Lighting the Planetary World of Project A1
PPTX
Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)
PDF
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
PPTX
Lightmassの仕組み ~Lightmap編~ (Epic Games Japan: 篠山範明)
PDF
Lightmass Deep Dive 2018 Vol.1: Lightmass内部アルゴリズム概要(Lightmap編)
PDF
HDR Theory and practicce (JP)
PDF
Rendering AAA-Quality Characters of Project A1
PDF
Volumetric Lighting for Many Lights in Lords of the Fallen
PPTX
Decima Engine: Visibility in Horizon Zero Dawn
PDF
建築ビジュアライズにおけるLightmass実践使用方法 (フリーランス 真茅健一様)
PPTX
Frostbite on Mobile
PPTX
Stochastic Screen-Space Reflections
PPTX
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
PPTX
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
PPTX
Unityネイティブプラグインマニアクス #denatechcon
Moving Frostbite to Physically Based Rendering
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
「原神」におけるコンソールプラットフォーム開発
Siggraph2016 - The Devil is in the Details: idTech 666
UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)
Unreal Summit 2016 Seoul Lighting the Planetary World of Project A1
Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
Lightmassの仕組み ~Lightmap編~ (Epic Games Japan: 篠山範明)
Lightmass Deep Dive 2018 Vol.1: Lightmass内部アルゴリズム概要(Lightmap編)
HDR Theory and practicce (JP)
Rendering AAA-Quality Characters of Project A1
Volumetric Lighting for Many Lights in Lords of the Fallen
Decima Engine: Visibility in Horizon Zero Dawn
建築ビジュアライズにおけるLightmass実践使用方法 (フリーランス 真茅健一様)
Frostbite on Mobile
Stochastic Screen-Space Reflections
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
Unityネイティブプラグインマニアクス #denatechcon
Ad

Similar to Practical usage of Lightmass in Architectural Visualization (Kenichi Makaya, UE4 Lightmass Deep Dive) (20)

PDF
Deferred shading
PDF
Linear Lighting Design Notes
PDF
task of lighnting
PDF
【Unite 2018 Tokyo】プログレッシブライトマッパーの真価を発揮する秘訣
PPTX
Progressive Lightmapper: An Introduction to Lightmapping in Unity
DOC
108600389 dd-report
PPT
lesson 2.pptlesson 2.pptlesson 2.pptlesson 2.pptlesson 2.ppt
PDF
Vray lighting
PDF
Gdc11 lighting used in BF3
PDF
One Designer to Another - Color, Dimming, and Flicker in the Age of LEDs by K...
PDF
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
PPTX
Light_architecture-corporate interiors
PDF
PLS 2016: How do you know if you’re using the most energy efficient street li...
PPTX
Develop2012 deferred sanchez_stachowiak
PPT
Panasonic projector DZ16K english
PPTX
Photogrammetry and Star Wars Battlefront
PDF
SiteOne Landscape Lighting Newsletter
PPTX
Introdution to astro photography
PPTX
45187459-Seminar-on-Digital-Light-Processing.pptx
PDF
Basic Stamp Lightmeter Presentation
Deferred shading
Linear Lighting Design Notes
task of lighnting
【Unite 2018 Tokyo】プログレッシブライトマッパーの真価を発揮する秘訣
Progressive Lightmapper: An Introduction to Lightmapping in Unity
108600389 dd-report
lesson 2.pptlesson 2.pptlesson 2.pptlesson 2.pptlesson 2.ppt
Vray lighting
Gdc11 lighting used in BF3
One Designer to Another - Color, Dimming, and Flicker in the Age of LEDs by K...
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
Light_architecture-corporate interiors
PLS 2016: How do you know if you’re using the most energy efficient street li...
Develop2012 deferred sanchez_stachowiak
Panasonic projector DZ16K english
Photogrammetry and Star Wars Battlefront
SiteOne Landscape Lighting Newsletter
Introdution to astro photography
45187459-Seminar-on-Digital-Light-Processing.pptx
Basic Stamp Lightmeter Presentation
Ad

More from エピック・ゲームズ・ジャパン Epic Games Japan (20)

PDF
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
PDF
猫でも分かるUE4を使った VRコンテンツ開発 超入門編 2021
PDF
Unreal Engine 5 早期アクセスの注目機能総おさらい Part 2
PDF
Unreal Engine 4.27 ノンゲーム向け新機能まとめ
PDF
Unreal Engine 5 早期アクセスの注目機能総おさらい Part 1
PDF
UE4 Hair & Groomでのリアルタイムファーレンダリング (UE4 Character Art Dive Online)
PDF
UE4を使った映像制作 (UE4 Character Art Dive Online)
PDF
Hair Groom入門 (UE4 Character Art Dive Online)
PDF
UE4で”MetaHumanを使わずに”耳なし芳一になる10の方法 | UE4 Character Art Dive Online
PDF
『バランワンダーワールド』でのマルチプラットフォーム対応について UNREAL FEST EXTREME 2021 SUMMER
PDF
Visual Dataprepで建築データを美味しく下ごしらえ UNREAL FEST EXTREME 2021 SUMMER
PDF
Unreal Engineでのコンフィギュレーター制作と映像制作 UNREAL FEST EXTREME 2021 SUMMER
PDF
バレンシアガ『Afterworld: The Age of Tomorrow』の舞台裏 UNREAL FEST EXTREME 2021 SUMMER
PDF
『FINAL FANTASY VII REMAKE』におけるプロファイリングと最適化事例 UNREAL FEST EXTREME 2021 SUMMER
PDF
SAMURAI JACK開発事例:海外むけアクションゲームをオーソドックスに作ってみた UNREAL FEST EXTREME 2021 SUMMER
PDF
『ガールズ&パンツァー 最終章』第3話 アニメとゲームエンジンの融合(ジャングル完結編) UNREAL FEST EXTREME 2021 SUMMER
PDF
UE4を使用したバーチャルヒューマンの映像制作 UNREAL FEST EXTREME 2021 SUMMER
PDF
オンラインで同期した100体の巨大生物から地球を衛る方法 UNREAL FEST EXTREME 2021 SUMMER
PDF
MetaHumanサンプル解体新書 UNREAL FEST EXTREME 2021 SUMMER
PDF
Twinmotion 2021とAEC分野向けソリューションのご紹介
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
猫でも分かるUE4を使った VRコンテンツ開発 超入門編 2021
Unreal Engine 5 早期アクセスの注目機能総おさらい Part 2
Unreal Engine 4.27 ノンゲーム向け新機能まとめ
Unreal Engine 5 早期アクセスの注目機能総おさらい Part 1
UE4 Hair & Groomでのリアルタイムファーレンダリング (UE4 Character Art Dive Online)
UE4を使った映像制作 (UE4 Character Art Dive Online)
Hair Groom入門 (UE4 Character Art Dive Online)
UE4で”MetaHumanを使わずに”耳なし芳一になる10の方法 | UE4 Character Art Dive Online
『バランワンダーワールド』でのマルチプラットフォーム対応について UNREAL FEST EXTREME 2021 SUMMER
Visual Dataprepで建築データを美味しく下ごしらえ UNREAL FEST EXTREME 2021 SUMMER
Unreal Engineでのコンフィギュレーター制作と映像制作 UNREAL FEST EXTREME 2021 SUMMER
バレンシアガ『Afterworld: The Age of Tomorrow』の舞台裏 UNREAL FEST EXTREME 2021 SUMMER
『FINAL FANTASY VII REMAKE』におけるプロファイリングと最適化事例 UNREAL FEST EXTREME 2021 SUMMER
SAMURAI JACK開発事例:海外むけアクションゲームをオーソドックスに作ってみた UNREAL FEST EXTREME 2021 SUMMER
『ガールズ&パンツァー 最終章』第3話 アニメとゲームエンジンの融合(ジャングル完結編) UNREAL FEST EXTREME 2021 SUMMER
UE4を使用したバーチャルヒューマンの映像制作 UNREAL FEST EXTREME 2021 SUMMER
オンラインで同期した100体の巨大生物から地球を衛る方法 UNREAL FEST EXTREME 2021 SUMMER
MetaHumanサンプル解体新書 UNREAL FEST EXTREME 2021 SUMMER
Twinmotion 2021とAEC分野向けソリューションのご紹介

Recently uploaded (20)

PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Digital Logic Computer Design lecture notes
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Sustainable Sites - Green Building Construction
PPT
Project quality management in manufacturing
PDF
Well-logging-methods_new................
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Digital Logic Computer Design lecture notes
Mechanical Engineering MATERIALS Selection
Internet of Things (IOT) - A guide to understanding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
UNIT 4 Total Quality Management .pptx
Lesson 3_Tessellation.pptx finite Mathematics
Sustainable Sites - Green Building Construction
Project quality management in manufacturing
Well-logging-methods_new................
Lecture Notes Electrical Wiring System Components
OOP with Java - Java Introduction (Basics)
Model Code of Practice - Construction Work - 21102022 .pdf

Practical usage of Lightmass in Architectural Visualization (Kenichi Makaya, UE4 Lightmass Deep Dive)

  • 1. Lightmass Deep Dive #2 Practical usage of Lightmass in Architectural Visualization
  • 3. Profile • Creating architectural perspectives since 2008 as a freelancer. • Started creating architectural content with UE4 soon after its release.
  • 6. Scene Data Used in this Presentation Forum Sample Reference Resources https://forums.unrealengine.com/showthread.php? 88952-Lets-make-Lightmass-EPIC-(and -understandable)&p=413678&viewfull=1#post413678 Casa Barragan House of Mexican Architect, Luis Barragan
  • 7. Test PC Specs • CPU Core i7 4790K 4.0GHZ x 4 core • Memory 16GB • GPU GTX770
  • 10. Production Settings with Normal Lighting Layout
  • 12. Production Settings with Normal Lighting Layout
  • 14. Production Settings with Normal Lighting Layout
  • 16. Production Settings with Normal Lighting Layout
  • 18. Production Settings with Normal Lighting Layout
  • 20. Production Settings with Normal Lighting Layout
  • 22. Production Settings with Normal Lighting Layout
  • 24. Production Settings with Normal Lighting Layout
  • 26. Production Settings with Normal Lighting Layout
  • 28. Production Settings with Normal Lighting Layout
  • 30. Production Settings with Normal Lighting Layout
  • 32. Production Settings with Normal Lighting Layout
  • 34. Production Settings with Normal Lighting Layout
  • 38. Procedure 1. Selecting Lights 2. Setting up the Scene 3. Testing Lighting 4. Lighting Sketch (Esquisse) 5. Final Lighting 6. Lightmass Deep Dive
  • 40. Four Types of Lights: •Directional Light •Point Light •Spot Light •Sky Light
  • 41. Light Mobility: Static or Stationary?
  • 42. Designed mainly using Directional Light and Sky Light But encountered problems....
  • 43. Insufficient diffraction of Indirect Light
  • 44. Sky Light can calculate only one bounce of Indirect Light
  • 45. Drawbacks of Sky Light Lighting from Sky Light only
  • 46. Drawbacks of Sky Light Insufficient diffraction of Indirect Light
  • 47. Because no photons are emitted
  • 48. Emit Photons • Directional Light • Point Light • Spot Light Emit No Photons • Sky Light
  • 49. Need Soft Indirect Lighting from the window
  • 50. Spot Light placed in window Static Spot Light Source Radius 200
  • 51. Both Light and Shadows are hard
  • 53. What is a Koola Bounce Card? Supports multiple bounces of Indirect Light while enabling Soft Lighting.
  • 54. Koola Bounce Card Size 200 x 200 cm
  • 55. Static Spot Light Source Radius 200
  • 56. Main Lights Used in Casa Barragan • Directional Light • Sky Light • Koola Bounce Card Decided to try the above settings first Stationary Static Static Spot Light
  • 57. 2. Setting up the Scene
  • 58. Lightmass Importance Volume Placement Specifies Area for Volume Lighting Samples
  • 59. Lightmass Portal Specifies Area of Focus for Final Gathering calculations
  • 64. Reflection Capture Placement Without Reflection Captures, results are poor due to Skylight reflection
  • 65. Reflection Capture Placement Better to temporarily place Reflection Captures to approximate the final image
  • 66. PostProcess Off • Auto Exposure • Causes exposure changes • Bloom • Overly bright screen and poor results • Screen Space Ambient Occlusion (AO) Difficult to tell if results are from the light bake or from AO
  • 67. Compress LightMaps off UMAP size 63MB Not sure whether noise is caused by insufficient number of samples during light bake or by compression noise. Be careful of increase in Light map size! UMAP size 90MB
  • 69. Adjusting Lighting Balance Preview or Medium Lighting Quality is good enough
  • 70. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 0 2m54s
  • 71. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 1 3m41s
  • 72. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 2 3m35s
  • 73. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 3 3m46s
  • 74. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 5 3m39s
  • 75. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 10 3m55s
  • 76. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 20 3m42s
  • 77. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 100 3m31s
  • 78. Adjusting Num Indirect Lighting Bounces • Differences are practically unnoticeable at around 10 • Almost no influence on build time
  • 79. 4. Lighting Sketch (Esquisse)
  • 80. Need detail in the Lightmaps How?
  • 81. 1. Higher Lightmap Resolution • Details lower than or equal to minimum texel of light map can not be captured LightmapResolution = 64LightmapResolution = 512
  • 82. 2. Decrease Static Lighting Level Scale (Decrease RecordRadiusScale of Irradiance caching) • Details smaller than RecordRadius can not be captured StaticLightingLevelScale = 0.1StaticLightingLevelScale = 1
  • 83. This means... 1. Decrease Static Lighting Level Scale until required detail is present 2. Increase lightmap resolution until detail can be captured
  • 84. 1. Setting Static Lighting Level Scale
  • 85. Details of shadows and bokeh around here need to be reproduced in our scene. Details in photograph Reference source http://motokimokito.blogspot.jp/
  • 86. Static Lighting Level Scale = 1 (Default)
  • 87. Static Lighting Level Scale = 0.5
  • 88. Static Lighting Level Scale = 0.2
  • 89. Static Lighting Level Scale =0.1 We’ll use this!
  • 90. At this stage, do not worry about noise. Check the Detail.
  • 91. Setting for Final Lighting Build
  • 92. Is sufficient detail reproduced? Reference source: http://motokimokito.blogspot.jp/
  • 93. Influence on Dynamic Meshes Be careful! Decreasing Static Lighting Level Scale increases Volume Lighting Samples. Static Lighting Level Scale 1.0 Static Lighting Level Scale 0.1
  • 94. 2. Setting Lightmap Resolution
  • 101. Detail of Direct Shadows Tempted to increase resolution to prevent jaggy shadows
  • 102. Detail of Direct Shadows Used Cascaded Shadows instead to avoid increasing resolution
  • 104. Is it enough to simply increase LightMapResolution for each mesh?
  • 105. Adjusting UVs for Lightmaps is still required
  • 106. Adjust to appropriate padding Padding between UV islands for Lightmap = 0
  • 107. Adjust to appropriate padding Padding between UV islands for Lightmap = 4
  • 108. Adjust padding to 4 texels 64 4
  • 110. Static Lighting Level Scale = 0.1 Indirect Lighting Quality = 5 Medium Decided on the above settings
  • 113. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  • 119. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  • 125. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  • 131. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  • 136. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  • 142. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  • 146. More Detail Increased Noise Improved Smoothness Less Detail 1.0Value Decreased Value Increased How Indirect Lighting Smoothness works
  • 148. The following values may be also be acceptable: If detail is important: 0.8 If smoothness is important: 1.2
  • 152. What are the Lighting Quality and Lightmass settings doing? In BaseLightmass.ini, we already mentioned: • Static Lighting Level Scale, • Num Indirect Lighting Bounces, and other settings including: Indirect Lighting Quality, Indirect Lighting Smoothness
  • 154. BaseLightmass.ini is in C:Program FilesEpic Games4.12EngineConfig
  • 155. ; These are tweaked defaults for various lightmass solver and export settings ; Artist-oriented lightmass settings are in the editor UI ; Documentation for all of these is in UnrealLightmass/Public/SceneExport.h ; This ini is reloaded every time a lighting build begins, no need to restart [DevOptions.StaticLighting] bAllowMultiThreadedStaticLighting=True ViewSingleBounceNumber=-1 bUseBilinearFilterLightmaps=True bCompressLightmaps=True bUseConservativeTexelRasterization=True bAccountForTexelSize=True bUseMaxWeight=True MaxTriangleLightingSamples=8 MaxTriangleIrradiancePhotonCacheSamples=4 bAllow64bitProcess=True DefaultStaticMeshLightingRes=32 bAllowCropping=False bGarbageCollectAfterExport=True bRebuildDirtyGeometryForLighting=True bUseEmbree=true bVerifyEmbree=false [DevOptions.StaticLightingSceneConstants] StaticLightingLevelScale=1 VisibilityRayOffsetDistance=.1 VisibilityNormalOffsetDistance=3 VisibilityNormalOffsetSampleRadiusScale=.5 VisibilityTangentOffsetSampleRadiusScale=.8 SmallestTexelRadius=.1 ; Tweaked for a good tradeoff between 'Cache Indirect Photon Paths' time and Indirect photon emitting 'Sampling Lights' time LightGridSize=100 AutomaticImportanceVolumeExpandBy=500 MinimumImportanceVolumeExtentWithoutWarning=10000.0 [DevOptions.StaticLightingMaterial] bUseDebugMaterial=False ShowMaterialAttribute=None ; Material export sizes default to very small to keep exports fast EmissiveSampleSize=128 DiffuseSampleSize=128 SpecularSampleSize=128 TransmissionSampleSize=256 NormalSampleSize=256 ; Terrain materials default to much higher resolution since each material typically covers a large area in world space TerrainSampleScalar=4 DebugDiffuse=(R=0.500000,G=0.500000,B=0.500000) EnvironmentColor=(R=0.00000,G=0.00000,B=0.00000) [DevOptions.MeshAreaLights] bVisualizeMeshAreaLightPrimitives=False ; Only emissive texels above .01 will be used to create mesh area lights EmissiveIntensityThreshold=.01 MeshAreaLightGridSize=100 MeshAreaLightSimplifyNormalAngleThreshold=25 MeshAreaLightSimplifyCornerDistanceThreshold=.5 MeshAreaLightSimplifyMeshBoundingRadiusFractionThreshold=.1 MeshAreaLightGeneratedDynamicLightSurfaceOffset=30 [DevOptions.PrecomputedDynamicObjectLighting] bVisualizeVolumeLightSamples=False bVisualizeVolumeLightInterpolation=False NumHemisphereSamplesScale=2 SurfaceLightSampleSpacing=300 FirstSurfaceSampleLayerHeight=50 SurfaceSampleLayerHeightSpacing=250 NumSurfaceSampleLayers=2 DetailVolumeSampleSpacing=300 VolumeLightSampleSpacing=3000 ; Clamp the number of volume samples generated to ~15mb MaxVolumeSamples=250000 bUseMaxSurfaceSampleNum=True ; Approximately clamp the number of surface samples generated to ~30mb (only for Landscape currently) MaxSurfaceLightSamples=500000 [DevOptions.PrecomputedVisibility] bVisualizePrecomputedVisibility=False bCompressVisibilityData=True bPlaceCellsOnOpaqueOnly=True NumCellDistributionBuckets=800 CellRenderingBucketSize=5 NumCellRenderingBuckets=5 PlayAreaHeight=220 MeshBoundsScale=1.2 VisibilitySpreadingIterations=1 MinMeshSamples=14 MaxMeshSamples=40 NumCellSamples=24 NumImportanceSamples=40 [DevOptions.PrecomputedVisibilityModeratelyAggressive] MeshBoundsScale=1 VisibilitySpreadingIterations=1 [DevOptions.PrecomputedVisibilityMostAggressive] MeshBoundsScale=1 VisibilitySpreadingIterations=0 [DevOptions.VolumeDistanceField] VoxelSize=75 VolumeMaxDistance=900 NumVoxelDistanceSamples=800 ; Clamp the size of the volume distance field generated to ~15mb MaxVoxels=3992160 [DevOptions.StaticShadows] ; Using area shadows by default instead of filtering in texture space bUseZeroAreaLightmapSpaceFilteredLights=False NumShadowRays=8 NumPenumbraShadowRays=8 NumBounceShadowRays=1 bFilterShadowFactor=True ShadowFactorGradientTolerance=0.5 bAllowSignedDistanceFieldShadows=True MaxTransitionDistanceWorldSpace=50 ApproximateHighResTexelsPerMaxTransitionDistance=50 MinDistanceFieldUpsampleFactor=3 MinUnoccludedFraction=.005 StaticShadowDepthMapTransitionSampleDistanceX=100 StaticShadowDepthMapTransitionSampleDistanceY=100 StaticShadowDepthMapSuperSampleFactor=2 ; Clamp the number of shadow samples generated to ~8mb for huge levels StaticShadowDepthMapMaxSamples=4194304 [DevOptions.ImportanceTracing] bUseCosinePDF=False bUseStratifiedSampling=True NumHemisphereSamples=16 MaxHemisphereRayAngle=89 bUseAdaptiveSolver=true NumAdaptiveRefinementLevels=2 AdaptiveBrightnessThreshold=1 AdaptiveFirstBouncePhotonConeAngle=4 [DevOptions.PhotonMapping] bUsePhotonMapping=True bUseFinalGathering=True bUsePhotonDirectLightingInFinalGather=False bVisualizeCachedApproximateDirectLighting=False bUseIrradiancePhotons=True bCacheIrradiancePhotonsOnSurfaces=True bVisualizePhotonPaths=False bVisualizePhotonGathers=True bVisualizePhotonImportanceSamples=False bVisualizeIrradiancePhotonCalculation=False bEmitPhotonsOutsideImportanceVolume=False ConeFilterConstant=1 ; 400 gives a smooth enough result without requiring a very large search NumIrradianceCalculationPhotons=400 ; Allocating most final gather samples towards importance samples gives a good result as long as there are enough first bounce photons FinalGatherImportanceSampleFraction=.6 ; 10 degrees is a good tradeoff between capturing high frequency incident lighting at final gather points and covering the whole incident lighting domain with a limited number of importance directions FinalGatherImportanceSampleConeAngle=10 IndirectPhotonEmitDiskRadius=200 IndirectPhotonEmitConeAngle=30 MaxImportancePhotonSearchDistance=2000 MinImportancePhotonSearchDistance=20 ; Preview uses a very small number of importance directions NumImportanceSearchPhotons=10 OutsideImportanceVolumeDensityScale=.0005 DirectPhotonDensity=350 ; Same as DirectPhotonDensity, since currently direct photons are only used to create irradiance photons DirectIrradiancePhotonDensity=350 DirectPhotonSearchDistance=200 IndirectPhotonPathDensity=5 ; Need a very high indirect photon density since first bounce photons are used to guide the final gather IndirectPhotonDensity=600 IndirectIrradiancePhotonDensity=300 IndirectPhotonSearchDistance=200 PhotonSearchAngleThreshold=.5 IrradiancePhotonSearchConeAngle=10 CachedIrradiancePhotonDownsampleFactor=2 [DevOptions.IrradianceCache] bAllowIrradianceCaching=True bUseIrradianceGradients=False bShowGradientsOnly=False bVisualizeIrradianceSamples=True RecordRadiusScale=.8 InterpolationMaxAngle=20 PointBehindRecordMaxAngle=10 ; Increase distance and angle constraints in the shading pass, which filters the interpolated result without losing too much detail. DistanceSmoothFactor=4 AngleSmoothFactor=4 ; Sky occlusion has less noise than normal GI, don't blur away details SkyOcclusionSmoothnessReduction=.5 ; Enforce a minimum sample rate on surfaces with no nearby occluders MaxRecordRadius=1024 CacheTaskSize=64 InterpolateTaskSize=64 [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 [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 [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
  • 156. Whoa! So many settings!
  • 157. When Lighting Quality is set to Production: [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
  • 158. [DevOptions.StaticLightingProductionQuality] NumShadowRaysScale=8 NumPenumbraShadowRaysScale=32 ApproximateHighResTexelsPerMaxTransitionDistanceScale=6 MinDistanceFieldUpsampleFactor=5 NumHemisphereSamplesScale=8 NumImportanceSearchPhotonsScale=3 NumDirectPhotonsScale=4 DirectPhotonSearchDistanceScale=.5 NumIndirectPhotonPathsScale=2 NumIndirectPhotonsScale=8 NumIndirectIrradiancePhotonsScale=2 RecordRadiusScaleScale=.5625 InterpolationMaxAngleScale=.75 IrradianceCacheSmoothFactor=.75 NumAdaptiveRefinementLevels=3 AdaptiveBrightnessThresholdScale=.25 AdaptiveFirstBouncePhotonConeAngleScale=2.5 What do these each adjust? Number of rays in final gathering Shadow Quality Number of photons and quality of photon mapping calculation Irradiance Caching Quality Quality of Adaptive Sampling for Final Gathering
  • 159. Scales important items collectively so that artists can adjust with just one setting
  • 160. Possible to overwrite settings where necessary in DefaultLightmass.ini located in <ProjectName>Config
  • 161. I will explain this later
  • 162. Now, back to addressing artifacts
  • 164. Used Static Lighting Level Scale=0.1
  • 169. Quality is still insufficient
  • 171. Adjust with Indirect Lighting Quality (Increase number of rays in final gathering)
  • 172. Indirect Lighting Quality 1 Medium 7m48s
  • 173. Indirect Lighting Quality 2 Medium 12m55s
  • 174. Indirect Lighting Quality 5 Medium 29m46s
  • 175. Indirect Lighting Quality 10 Medium 1h5m24s
  • 177. Static Lighting Level Scale=0.1 Indirect Lighting Quality=10 Production 4h10m24s
  • 178. Static Lighting Level Scale×Indirect Lighting Quality =1.0 Artifacts can be reduced to an acceptable level when the above multiplication results in 1.0 With Lighting Quality set to Production Level 0.1 10 0.2 5 0.5 2 X X X
  • 179. Lightmass Settings Final Settings Static Lighting Level Scale= 0.1 Num Indirect Lighting Bounces=20 Indirect Lighting Quality = 10 Indirect Lighting Smoothness=1.0 Lighting Quality = Production
  • 184. ; These are tweaked defaults for various lightmass solver and export settings ; Artist-oriented lightmass settings are in the editor UI ; Documentation for all of these is in UnrealLightmass/Public/SceneExport.h ; This ini is reloaded every time a lighting build begins, no need to restart [DevOptions.StaticLighting] bAllowMultiThreadedStaticLighting=True ViewSingleBounceNumber=-1 bUseBilinearFilterLightmaps=True bCompressLightmaps=True bUseConservativeTexelRasterization=True bAccountForTexelSize=True bUseMaxWeight=True MaxTriangleLightingSamples=8 MaxTriangleIrradiancePhotonCacheSamples=4 bAllow64bitProcess=True DefaultStaticMeshLightingRes=32 bAllowCropping=False bGarbageCollectAfterExport=True bRebuildDirtyGeometryForLighting=True bUseEmbree=true bVerifyEmbree=false [DevOptions.StaticLightingSceneConstants] StaticLightingLevelScale=1 VisibilityRayOffsetDistance=.1 VisibilityNormalOffsetDistance=3 VisibilityNormalOffsetSampleRadiusScale=.5 VisibilityTangentOffsetSampleRadiusScale=.8 SmallestTexelRadius=.1 ; Tweaked for a good tradeoff between 'Cache Indirect Photon Paths' time and Indirect photon emitting 'Sampling Lights' time LightGridSize=100 AutomaticImportanceVolumeExpandBy=500 MinimumImportanceVolumeExtentWithoutWarning=10000.0 [DevOptions.StaticLightingMaterial] bUseDebugMaterial=False ShowMaterialAttribute=None ; Material export sizes default to very small to keep exports fast EmissiveSampleSize=128 DiffuseSampleSize=128 SpecularSampleSize=128 TransmissionSampleSize=256 NormalSampleSize=256 ; Terrain materials default to much higher resolution since each material typically covers a large area in world space TerrainSampleScalar=4 DebugDiffuse=(R=0.500000,G=0.500000,B=0.500000) EnvironmentColor=(R=0.00000,G=0.00000,B=0.00000) [DevOptions.MeshAreaLights] bVisualizeMeshAreaLightPrimitives=False ; Only emissive texels above .01 will be used to create mesh area lights EmissiveIntensityThreshold=.01 MeshAreaLightGridSize=100 MeshAreaLightSimplifyNormalAngleThreshold=25 MeshAreaLightSimplifyCornerDistanceThreshold=.5 MeshAreaLightSimplifyMeshBoundingRadiusFractionThreshold=.1 MeshAreaLightGeneratedDynamicLightSurfaceOffset=30 [DevOptions.PrecomputedDynamicObjectLighting] bVisualizeVolumeLightSamples=False bVisualizeVolumeLightInterpolation=False NumHemisphereSamplesScale=2 SurfaceLightSampleSpacing=300 FirstSurfaceSampleLayerHeight=50 SurfaceSampleLayerHeightSpacing=250 NumSurfaceSampleLayers=2 DetailVolumeSampleSpacing=300 VolumeLightSampleSpacing=3000 ; Clamp the number of volume samples generated to ~15mb MaxVolumeSamples=250000 bUseMaxSurfaceSampleNum=True ; Approximately clamp the number of surface samples generated to ~30mb (only for Landscape currently) MaxSurfaceLightSamples=500000 [DevOptions.PrecomputedVisibility] bVisualizePrecomputedVisibility=False bCompressVisibilityData=True bPlaceCellsOnOpaqueOnly=True NumCellDistributionBuckets=800 CellRenderingBucketSize=5 NumCellRenderingBuckets=5 PlayAreaHeight=220 MeshBoundsScale=1.2 VisibilitySpreadingIterations=1 MinMeshSamples=14 MaxMeshSamples=40 NumCellSamples=24 NumImportanceSamples=40 [DevOptions.PrecomputedVisibilityModeratelyAggressive] MeshBoundsScale=1 VisibilitySpreadingIterations=1 [DevOptions.PrecomputedVisibilityMostAggressive] MeshBoundsScale=1 VisibilitySpreadingIterations=0 [DevOptions.VolumeDistanceField] VoxelSize=75 VolumeMaxDistance=900 NumVoxelDistanceSamples=800 ; Clamp the size of the volume distance field generated to ~15mb MaxVoxels=3992160 [DevOptions.StaticShadows] ; Using area shadows by default instead of filtering in texture space bUseZeroAreaLightmapSpaceFilteredLights=False NumShadowRays=8 NumPenumbraShadowRays=8 NumBounceShadowRays=1 bFilterShadowFactor=True ShadowFactorGradientTolerance=0.5 bAllowSignedDistanceFieldShadows=True MaxTransitionDistanceWorldSpace=50 ApproximateHighResTexelsPerMaxTransitionDistance=50 MinDistanceFieldUpsampleFactor=3 MinUnoccludedFraction=.005 StaticShadowDepthMapTransitionSampleDistanceX=100 StaticShadowDepthMapTransitionSampleDistanceY=100 StaticShadowDepthMapSuperSampleFactor=2 ; Clamp the number of shadow samples generated to ~8mb for huge levels StaticShadowDepthMapMaxSamples=4194304 [DevOptions.ImportanceTracing] bUseCosinePDF=False bUseStratifiedSampling=True NumHemisphereSamples=16 MaxHemisphereRayAngle=89 bUseAdaptiveSolver=true NumAdaptiveRefinementLevels=2 AdaptiveBrightnessThreshold=1 AdaptiveFirstBouncePhotonConeAngle=4 [DevOptions.PhotonMapping] bUsePhotonMapping=True bUseFinalGathering=True bUsePhotonDirectLightingInFinalGather=False bVisualizeCachedApproximateDirectLighting=False bUseIrradiancePhotons=True bCacheIrradiancePhotonsOnSurfaces=True bVisualizePhotonPaths=False bVisualizePhotonGathers=True bVisualizePhotonImportanceSamples=False bVisualizeIrradiancePhotonCalculation=False bEmitPhotonsOutsideImportanceVolume=False ConeFilterConstant=1 ; 400 gives a smooth enough result without requiring a very large search NumIrradianceCalculationPhotons=400 ; Allocating most final gather samples towards importance samples gives a good result as long as there are enough first bounce photons FinalGatherImportanceSampleFraction=.6 ; 10 degrees is a good tradeoff between capturing high frequency incident lighting at final gather points and covering the whole incident lighting domain with a limited number of importance directions FinalGatherImportanceSampleConeAngle=10 IndirectPhotonEmitDiskRadius=200 IndirectPhotonEmitConeAngle=30 MaxImportancePhotonSearchDistance=2000 MinImportancePhotonSearchDistance=20 ; Preview uses a very small number of importance directions NumImportanceSearchPhotons=10 OutsideImportanceVolumeDensityScale=.0005 DirectPhotonDensity=350 ; Same as DirectPhotonDensity, since currently direct photons are only used to create irradiance photons DirectIrradiancePhotonDensity=350 DirectPhotonSearchDistance=200 IndirectPhotonPathDensity=5 ; Need a very high indirect photon density since first bounce photons are used to guide the final gather IndirectPhotonDensity=600 IndirectIrradiancePhotonDensity=300 IndirectPhotonSearchDistance=200 PhotonSearchAngleThreshold=.5 IrradiancePhotonSearchConeAngle=10 CachedIrradiancePhotonDownsampleFactor=2 [DevOptions.IrradianceCache] bAllowIrradianceCaching=True bUseIrradianceGradients=False bShowGradientsOnly=False bVisualizeIrradianceSamples=True RecordRadiusScale=.8 InterpolationMaxAngle=20 PointBehindRecordMaxAngle=10 ; Increase distance and angle constraints in the shading pass, which filters the interpolated result without losing too much detail. DistanceSmoothFactor=4 AngleSmoothFactor=4 ; Sky occlusion has less noise than normal GI, don't blur away details SkyOcclusionSmoothnessReduction=.5 ; Enforce a minimum sample rate on surfaces with no nearby occluders MaxRecordRadius=1024 CacheTaskSize=64 InterpolateTaskSize=64 [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 [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 [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
  • 186. Copy, paste, and edit values only where tuning is required, then put it in <ProjectName>Config as “DefaultLightmass.ini”
  • 187. For example, when area shadow quality needs to be improved,
  • 188. Increase shadow detail in DefaultLightmass.ini Default Values for Medium Setting
  • 189. Allows tuning that is not available in Editor NumShadowRaysScale=16 NumPenumbraShadowRaysScale=64
  • 190. Simply copy and paste from BaseLightmass.ini, and change the values Save as ”DefaultLightmass.ini” in <ProjectName>Config
  • 191. Experimented with the various config file settings
  • 192. Quality improves as number of rays increases but processing takes longer
  • 193. Improving Final Gathering Increasing Indirect Lighting Quality ↓ Increases Number of Rays in Final gathering
  • 194. Insufficient Rays Sufficient Rays Sufficient Rays Insufficient Rays Increasing rays across the entire area may be wasteful...
  • 195. Improving Final Gathering Increasing Indirect Lighting Quality increases rays even where unnecessary ↓ Use adaptive sampling to increase rays only where necessary ↓ Increase level of adaptive sampling refinement or Decrease threshold of intensity when increasing the level
  • 196. Increase level of adaptive sample refinement NumAdaptiveRefinementLevel
  • 199. NumAdaptiveRefinementLevels = 2 Medium 4 m43s (Default Value when Lighting Quality is Preview)
  • 200. NumAdaptiveRefinementLevels = 3 Medium 10 m59s (Default Value when Lighting Quality is Medium, High, or Production)
  • 202. Adjust threshold to increase level of adaptive sample refinement AdaptiveBrightnessThresholdScale
  • 203. Static Lighting Level Scale = 0.2 Indirect Lighting Quality = 5 Medium Decided on the above settings
  • 204. NumAdaptiveRefinementLevels = 3 AdaptiveBrightnessThresholdScale = 0.5 (Medium Default) 3 m 28 s
  • 206. NumAdaptiveRefinementLevels = 3 AdaptiveBrightnessThresholdScale = 0.05 4 m 13 s
  • 207. NumAdaptiveRefinementLevels = 4 AdaptiveBrightnessThresholdScale = 0.5 12 m 41 s
  • 208. NumAdaptiveRefinementLevels = 5 AdaptiveBrightnessThresholdScale = 0.25 48 m 03 s
  • 209. Why is it so time consuming? Let’s compare when set at Static Lighting Level Scale = 0.2 and Indirect Lighting Quality = 10 Production
  • 210. Static Lighting Level Scale=0.2 Indirect Lighting Quality=10 Production 28m22s
  • 211. NumAdaptiveRefinementLevels = 5 AdaptiveBrightnessThresholdScale = 0.25 48 m 03 s
  • 212. Because cost performance is low, increasing the number of rays of Indirect Lighting Quality is better.
  • 213. Be careful when using a value of 11 or more for Indirect Lighting Quality
  • 214. When Indirect Lighting Quality>11, NumAdaptiveRefinementLevel +1
  • 215. Build time increases substantially.
  • 216. Adjust the number of rays in Lightmass.ini Adjust “NumHemisphereSamplesScale” for each Lighting Quality level Or [DevOptions.ImportanceTracing] NumHemisphereSamples can scale the number of rays as well.
  • 217. Lightmass.ini includes all settings required to apply custom tuning to your content.
  • 218. Lets make Lightmass Epic Talented artists including Koola study Lightmass https://forums.unrealengine.com/showthread.php?88952-Lets- make-Lightmass-EPIC-(and-understandable)
  • 220. Emit Photons • Directional Light • Point Light • Spot Light • Koola Bounce Card Emit No Photon • Sky Light • Use Emissive For Static Lighting Understanding differences in the behaviors of various lights is important. Especially Sky light!
  • 221. Lighting Quality What does each setting influence? Shadow Photon Mapping Irradiance Caching Final Gathering Overall Quality Settings Setting Influence on Influence on Build time High
  • 222. Static Lighting Level Scale Num Indirect Lighting Bounces Indirect Lighting Quality Indirect Lighting Smoothness What each setting influences on? Details of Lightmass (Irradiance Caching recording radius) Brightness of Scene (Number of photon reflections) Decreases artifact noise (Number of rays for final gathering) Blurs indirect light component in Lightmap (Irradiance Caching Interpolation Ratio) Setting Influence on Influence on Build time Medium Low High Low
  • 223. Lightmass Quality (Detail) & Build Time = Lightmap Resolution (Increases Resolution) × Lighting Quality (Improves Overall Quality) × Indirect Lighting Quality (Decreases Artifacts) ÷ Static Lighting Level Scale (Improves Detail)
  • 224. Any feedback or suggestions for better solutions is always welcome!

Editor's Notes

  • #177: At Production setting, the number of rays in final gathering increases by four times compared to the Medium setting, so it will be fine.
  • #195: Increasing Indirect Lighting Quality increases rays even where unnecessary Increase rays only where necessary by applying adaptive sampling Increase level of adaptive sampling refinement or Decrease threshold of intensity when increasing level
  • #210: Note that NumAdaptiveRefinementLevel increases one level when ILQ = 11 or more. Increasing level without consideration increases build time substantially. For Casa Barragan, after 8 hours the build was only at 3% so I cancelled it…
  • #216: Note that NumAdaptiveRefinementLevel increases one level when ILQ = 11 or more. Increasing level without consideration increases build time substantially. For Casa Barragan, after 8 hours the build was only at 3% so I cancelled it…
  • #218: Note that NumAdaptiveRefinementLevel increases one level when ILQ = 11 or more. Increasing level without consideration increases build time substantially. For Casa Barragan, after 8 hours the build was only at 3% so I cancelled it…