Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

32,512 views

Published on

Epic Games Japan hold a meeting named "Lightmass Deep Dive" on July 30, 2016.
A Japanese architectural artist, Kenichi Makaya, created Casa Barragan on UE4. the architecture is a house of Mexican Architect, Luis Barragan. And he gave a presentation about making of the scene. .

CASA BARRAGAN Unreal Engine4
https://www.youtube.com/watch?v=Y7r28nO4iDU&feature=youtu.be

EGJ translated the slide for the presentation to English and published it.

Published in: Engineering
  • Sex in your area is here: ❶❶❶ http://bit.ly/39sFWPG ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ♥♥♥ http://bit.ly/39sFWPG ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT, ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hi there! Essay Help For Students | Discount 10% for your first order! - Check our website! https://vk.cc/80SakO
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

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

  1. 1. Lightmass Deep Dive #2 Practical usage of Lightmass in Architectural Visualization
  2. 2. Architectural Visualizer Kenichi Makaya
  3. 3. Profile • Creating architectural perspectives since 2008 as a freelancer. • Started creating architectural content with UE4 soon after its release.
  4. 4. CASA BARRAGAN
  5. 5. 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
  6. 6. Test PC Specs • CPU Core i7 4790K 4.0GHZ x 4 core • Memory 16GB • GPU GTX770
  7. 7. Presentation Theme
  8. 8. Improving Lightmass Details and Addressing Artifacts
  9. 9. Production Settings with Normal Lighting Layout
  10. 10. Final Settings
  11. 11. Production Settings with Normal Lighting Layout
  12. 12. Final Settings
  13. 13. Production Settings with Normal Lighting Layout
  14. 14. Final Settings
  15. 15. Production Settings with Normal Lighting Layout
  16. 16. Final Settings
  17. 17. Production Settings with Normal Lighting Layout
  18. 18. Final Settings
  19. 19. Production Settings with Normal Lighting Layout
  20. 20. Final Settings
  21. 21. Production Settings with Normal Lighting Layout
  22. 22. Final Settings
  23. 23. Production Settings with Normal Lighting Layout
  24. 24. Final Settings
  25. 25. Production Settings with Normal Lighting Layout
  26. 26. Final Settings
  27. 27. Production Settings with Normal Lighting Layout
  28. 28. Final Settings
  29. 29. Production Settings with Normal Lighting Layout
  30. 30. Final Settings
  31. 31. Production Settings with Normal Lighting Layout
  32. 32. Final Settings
  33. 33. Production Settings with Normal Lighting Layout
  34. 34. Final Settings
  35. 35. Rendering Soft Indirect Lighting
  36. 36. Likely differs from optimizations for games
  37. 37. Procedure 1. Selecting Lights 2. Setting up the Scene 3. Testing Lighting 4. Lighting Sketch (Esquisse) 5. Final Lighting 6. Lightmass Deep Dive
  38. 38. 1.Selecting Lights
  39. 39. Four Types of Lights: •Directional Light •Point Light •Spot Light •Sky Light
  40. 40. Light Mobility: Static or Stationary?
  41. 41. Designed mainly using Directional Light and Sky Light But encountered problems....
  42. 42. Insufficient diffraction of Indirect Light
  43. 43. Sky Light can calculate only one bounce of Indirect Light
  44. 44. Drawbacks of Sky Light Lighting from Sky Light only
  45. 45. Drawbacks of Sky Light Insufficient diffraction of Indirect Light
  46. 46. Because no photons are emitted
  47. 47. Emit Photons • Directional Light • Point Light • Spot Light Emit No Photons • Sky Light
  48. 48. Need Soft Indirect Lighting from the window
  49. 49. Spot Light placed in window Static Spot Light Source Radius 200
  50. 50. Both Light and Shadows are hard
  51. 51. Used Koola-style Bounce Card
  52. 52. What is a Koola Bounce Card? Supports multiple bounces of Indirect Light while enabling Soft Lighting.
  53. 53. Koola Bounce Card Size 200 x 200 cm
  54. 54. Static Spot Light Source Radius 200
  55. 55. 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
  56. 56. 2. Setting up the Scene
  57. 57. Lightmass Importance Volume Placement Specifies Area for Volume Lighting Samples
  58. 58. Lightmass Portal Specifies Area of Focus for Final Gathering calculations
  59. 59. Improved Skylight Quality With Portal
  60. 60. Improved Skylight Quality Without Portal
  61. 61. Improved Skylight Quality With Portal
  62. 62. Improved Skylight Quality Without Portal
  63. 63. Reflection Capture Placement Without Reflection Captures, results are poor due to Skylight reflection
  64. 64. Reflection Capture Placement Better to temporarily place Reflection Captures to approximate the final image
  65. 65. 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
  66. 66. 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
  67. 67. 3. Test Lighting
  68. 68. Adjusting Lighting Balance Preview or Medium Lighting Quality is good enough
  69. 69. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 0 2m54s
  70. 70. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 1 3m41s
  71. 71. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 2 3m35s
  72. 72. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 3 3m46s
  73. 73. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 5 3m39s
  74. 74. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 10 3m55s
  75. 75. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 20 3m42s
  76. 76. Adjusting Num Indirect Lighting Bounces Num Indirect Lighting Bounces 100 3m31s
  77. 77. Adjusting Num Indirect Lighting Bounces • Differences are practically unnoticeable at around 10 • Almost no influence on build time
  78. 78. 4. Lighting Sketch (Esquisse)
  79. 79. Need detail in the Lightmaps How?
  80. 80. 1. Higher Lightmap Resolution • Details lower than or equal to minimum texel of light map can not be captured LightmapResolution = 64LightmapResolution = 512
  81. 81. 2. Decrease Static Lighting Level Scale (Decrease RecordRadiusScale of Irradiance caching) • Details smaller than RecordRadius can not be captured StaticLightingLevelScale = 0.1StaticLightingLevelScale = 1
  82. 82. This means... 1. Decrease Static Lighting Level Scale until required detail is present 2. Increase lightmap resolution until detail can be captured
  83. 83. 1. Setting Static Lighting Level Scale
  84. 84. Details of shadows and bokeh around here need to be reproduced in our scene. Details in photograph Reference source http://motokimokito.blogspot.jp/
  85. 85. Static Lighting Level Scale = 1 (Default)
  86. 86. Static Lighting Level Scale = 0.5
  87. 87. Static Lighting Level Scale = 0.2
  88. 88. Static Lighting Level Scale =0.1 We’ll use this!
  89. 89. At this stage, do not worry about noise. Check the Detail.
  90. 90. Setting for Final Lighting Build
  91. 91. Is sufficient detail reproduced? Reference source: http://motokimokito.blogspot.jp/
  92. 92. 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
  93. 93. 2. Setting Lightmap Resolution
  94. 94. Light Map Resolution 32
  95. 95. Light Map Resolution 64
  96. 96. Light Map Resolution 128
  97. 97. Light Map Resolution 256
  98. 98. Light Map Resolution 512
  99. 99. Light Map Resolution 1024
  100. 100. Detail of Direct Shadows Tempted to increase resolution to prevent jaggy shadows
  101. 101. Detail of Direct Shadows Used Cascaded Shadows instead to avoid increasing resolution
  102. 102. Lightmap Resolution was set
  103. 103. Is it enough to simply increase LightMapResolution for each mesh?
  104. 104. Adjusting UVs for Lightmaps is still required
  105. 105. Adjust to appropriate padding Padding between UV islands for Lightmap = 0
  106. 106. Adjust to appropriate padding Padding between UV islands for Lightmap = 4
  107. 107. Adjust padding to 4 texels 64 4
  108. 108. Adjusting Indirect Lighting Smoothness
  109. 109. Static Lighting Level Scale = 0.1 Indirect Lighting Quality = 5 Medium Decided on the above settings
  110. 110. Indirect Lighting Smoothness = 0.5 28m56s
  111. 111. Indirect Lighting Smoothness = 0.8 32m55s
  112. 112. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  113. 113. Indirect Lighting Smoothness = 1.2 33m22s
  114. 114. Indirect Lighting Smoothness = 1.5 28m58s
  115. 115. Indirect Lighting Smoothness = 2.0 33m28s
  116. 116. Indirect Lighting Smoothness = 0.5 28m56s
  117. 117. Indirect Lighting Smoothness = 0.8 32m55s
  118. 118. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  119. 119. Indirect Lighting Smoothness = 1.2 33m22s
  120. 120. Indirect Lighting Smoothness = 1.5 28m58s
  121. 121. Indirect Lighting Smoothness = 2.0 33m28s
  122. 122. Indirect Lighting Smoothness = 0.5 28m56s
  123. 123. Indirect Lighting Smoothness = 0.8 32m55s
  124. 124. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  125. 125. Indirect Lighting Smoothness = 1.2 33m22s
  126. 126. Indirect Lighting Smoothness = 1.5 28m58s
  127. 127. Indirect Lighting Smoothness = 2.0 33m28s
  128. 128. Indirect Lighting Smoothness = 0.5 28m56s
  129. 129. Indirect Lighting Smoothness = 0.8 32m55s
  130. 130. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  131. 131. Indirect Lighting Smoothness = 1.2 33m22s
  132. 132. Indirect Lighting Smoothness = 1.5 28m58s
  133. 133. Indirect Lighting Smoothness = 0.5 28m56s
  134. 134. Indirect Lighting Smoothness = 0.8 32m55s
  135. 135. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  136. 136. Indirect Lighting Smoothness = 1.2 33m22s
  137. 137. Indirect Lighting Smoothness = 1.5 28m58s
  138. 138. Indirect Lighting Smoothness = 2.0 33m28s
  139. 139. Indirect Lighting Smoothness = 0.5 28m56s
  140. 140. Indirect Lighting Smoothness = 0.8 32m55s
  141. 141. Indirect Lighting Smoothness = 1 29m46s (Default Value)
  142. 142. Indirect Lighting Smoothness = 1.2 33m22s
  143. 143. Indirect Lighting Smoothness = 1.5 28m58s
  144. 144. Indirect Lighting Smoothness = 2.0 33m28s
  145. 145. More Detail Increased Noise Improved Smoothness Less Detail 1.0Value Decreased Value Increased How Indirect Lighting Smoothness works
  146. 146. Basically, Indirect Lighting Smoothness=1.0 is acceptable.
  147. 147. The following values may be also be acceptable: If detail is important: 0.8 If smoothness is important: 1.2
  148. 148. 5. Final Lighting
  149. 149. Addressing artifacts
  150. 150. Before that,
  151. 151. 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
  152. 152. Configuring BaseLightmass.ini
  153. 153. BaseLightmass.ini is in C:Program FilesEpic Games4.12EngineConfig
  154. 154. ; 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
  155. 155. Whoa! So many settings!
  156. 156. 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
  157. 157. [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
  158. 158. Scales important items collectively so that artists can adjust with just one setting
  159. 159. Possible to overwrite settings where necessary in DefaultLightmass.ini located in <ProjectName>Config
  160. 160. I will explain this later
  161. 161. Now, back to addressing artifacts
  162. 162. First, adjust Lighting Quality
  163. 163. Used Static Lighting Level Scale=0.1
  164. 164. Preview 2m16s
  165. 165. Medium 7m48s
  166. 166. High 13m58s
  167. 167. Production 30m22s
  168. 168. Quality is still insufficient
  169. 169. Need higher calculation accuracy for light
  170. 170. Adjust with Indirect Lighting Quality (Increase number of rays in final gathering)
  171. 171. Indirect Lighting Quality 1 Medium 7m48s
  172. 172. Indirect Lighting Quality 2 Medium 12m55s
  173. 173. Indirect Lighting Quality 5 Medium 29m46s
  174. 174. Indirect Lighting Quality 10 Medium 1h5m24s
  175. 175. Most artifacts disappear at 10
  176. 176. Static Lighting Level Scale=0.1 Indirect Lighting Quality=10 Production 4h10m24s
  177. 177. 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
  178. 178. 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
  179. 179. 6. Lightmass Deep Dive
  180. 180. Let’s adjust Lightmass.ini
  181. 181. BaseLightmass.ini is in
  182. 182. C:Program FilesEpic Games4.12EngineConfig
  183. 183. ; 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
  184. 184. Don’t worry!
  185. 185. Copy, paste, and edit values only where tuning is required, then put it in <ProjectName>Config as “DefaultLightmass.ini”
  186. 186. For example, when area shadow quality needs to be improved,
  187. 187. Increase shadow detail in DefaultLightmass.ini Default Values for Medium Setting
  188. 188. Allows tuning that is not available in Editor NumShadowRaysScale=16 NumPenumbraShadowRaysScale=64
  189. 189. Simply copy and paste from BaseLightmass.ini, and change the values Save as ”DefaultLightmass.ini” in <ProjectName>Config
  190. 190. Experimented with the various config file settings
  191. 191. Quality improves as number of rays increases but processing takes longer
  192. 192. Improving Final Gathering Increasing Indirect Lighting Quality ↓ Increases Number of Rays in Final gathering
  193. 193. Insufficient Rays Sufficient Rays Sufficient Rays Insufficient Rays Increasing rays across the entire area may be wasteful...
  194. 194. 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
  195. 195. Increase level of adaptive sample refinement NumAdaptiveRefinementLevel
  196. 196. NumAdaptiveRefinementLevels = 0 Medium 1 m16s
  197. 197. NumAdaptiveRefinementLevels = 1 Medium 2 m15s
  198. 198. NumAdaptiveRefinementLevels = 2 Medium 4 m43s (Default Value when Lighting Quality is Preview)
  199. 199. NumAdaptiveRefinementLevels = 3 Medium 10 m59s (Default Value when Lighting Quality is Medium, High, or Production)
  200. 200. NumAdaptiveRefinementLevels = 4 Medium 34 m45s
  201. 201. Adjust threshold to increase level of adaptive sample refinement AdaptiveBrightnessThresholdScale
  202. 202. Static Lighting Level Scale = 0.2 Indirect Lighting Quality = 5 Medium Decided on the above settings
  203. 203. NumAdaptiveRefinementLevels = 3 AdaptiveBrightnessThresholdScale = 0.5 (Medium Default) 3 m 28 s
  204. 204. NumAdaptiveRefinementLevels=3 AdaptiveBrightnessThresholdScale = 0.25 3 m 33 s
  205. 205. NumAdaptiveRefinementLevels = 3 AdaptiveBrightnessThresholdScale = 0.05 4 m 13 s
  206. 206. NumAdaptiveRefinementLevels = 4 AdaptiveBrightnessThresholdScale = 0.5 12 m 41 s
  207. 207. NumAdaptiveRefinementLevels = 5 AdaptiveBrightnessThresholdScale = 0.25 48 m 03 s
  208. 208. Why is it so time consuming? Let’s compare when set at Static Lighting Level Scale = 0.2 and Indirect Lighting Quality = 10 Production
  209. 209. Static Lighting Level Scale=0.2 Indirect Lighting Quality=10 Production 28m22s
  210. 210. NumAdaptiveRefinementLevels = 5 AdaptiveBrightnessThresholdScale = 0.25 48 m 03 s
  211. 211. Because cost performance is low, increasing the number of rays of Indirect Lighting Quality is better.
  212. 212. Be careful when using a value of 11 or more for Indirect Lighting Quality
  213. 213. When Indirect Lighting Quality>11, NumAdaptiveRefinementLevel +1
  214. 214. Build time increases substantially.
  215. 215. 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.
  216. 216. Lightmass.ini includes all settings required to apply custom tuning to your content.
  217. 217. Lets make Lightmass Epic Talented artists including Koola study Lightmass https://forums.unrealengine.com/showthread.php?88952-Lets- make-Lightmass-EPIC-(and-understandable)
  218. 218. Conclusion
  219. 219. 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!
  220. 220. 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
  221. 221. 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
  222. 222. 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)
  223. 223. Any feedback or suggestions for better solutions is always welcome!
  224. 224. Thank you! @torashami http://www.frames-cg.com/

×