建築ビジュアライズにおけるLightmass実践使用方法 (フリーランス 真茅健一様)

15.8K Views

July 31, 16

スライド概要

2016年7月30日に行われたライセンシー様向けライトマス勉強会の資料です。フリーランス 真茅健一様がルイスバラガン邸をUE4で再現し、その際にどのようにライトビルドで試行錯誤したのかを、非常に丁寧に説明して頂いております。



CASA BARRAGAN Unreal Engine4

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

profile-image

Unreal Engineを開発・提供しているエピック ゲームズ ジャパンによる公式アカウントです。 勉強会や配信などで行った講演資料を公開しています。 公式サイトはこちら https://www.unrealengine.com/ja/

シェア

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

Lightmass Deep Dive #2 建築ビジュアライズにおける Lightmass実践使用方法

2.

建築ビジュアライズ制作者 ま かや けん いち 真茅健一

3.

活動内容 • 2008年よりフリーランスとして建築パースを制作 • UnrealEngine4の一般公開後まもなくより、UE4で建築コン テンツを制作

4.

このセッションで使うシーンデータ Casa Barragan フォーラムサンプル 引用元 メキシコの建築家 ルイス・バラガンの自邸 https://forums.unrealengine.com/showthread.php? 88952-Lets-make-Lightmass-EPIC-(and -understandable)&p=413678&viewfull=1#post413678

5.

https://youtu.be/Y7r28nO4iDU

6.

検証用マシン • CPU Core i7 4790K 4コア • メモリ 16GB • GPU GTX770

7.

このセッションのテーマ

8.

Lightmassでの ディティールアップと モヤモヤ対策

9.

普通にライトを置いてProduction設定

10.

最終設定

11.

普通にライトを置いてProduction設定

12.

最終設定

13.

普通にライトを置いてProduction設定

14.

最終設定

15.

普通にライトを置いてProduction設定

16.

最終設定

17.

普通にライトを置いてProduction設定

18.

最終設定

19.

普通にライトを置いてProduction設定

20.

最終設定

21.

普通にライトを置いてProduction設定

22.

最終設定

23.

普通にライトを置いてProduction設定

24.

最終設定

25.

普通にライトを置いてProduction設定

26.

最終設定

27.

普通にライトを置いてProduction設定

28.

最終設定

29.

普通にライトを置いてProduction設定

30.

最終設定

31.

普通にライトを置いてProduction設定

32.

最終設定

33.

普通にライトを置いてProduction設定

34.

最終設定

35.

やわらかな間接光の表現

36.

ゲームでの最適化とは おそらく異なります。

37.

おしながき 1. 使用ライトの選定 2. シーンセットアップ 3. テストライティング 4. ライティングエスキス 5. 最終ライティング 6. Lightmass Deep Dive

38.

1.使用ライトの選定

39.

4つのライト • Directional Light • Point Light • Spot Light • Sky Light

40.

ライトの可動性はStatic か Stationary

41.

Directional LightとSky Lightをメインに設計 しかし問題点が…

42.

間接光が回り切らない

43.

SkyLightは間接光のバウンスが 一回しか計算出来ない

44.

スカイライトの弱点 スカイライトのみでライティング

45.

スカイライトの弱点 間接光が回り切らない

46.

フォトンがでないから

47.

フォトンがでるライト フォトンがでないライト • Directional Light • Point Light • Spot Light • Sky Light

48.

窓からの柔らかい間接光を表現したい

49.

窓にスポットライトを置いてみる Static Spot Light SourceRadius 100 (直径200cmの球体からのエリアシャドウ)

50.

光も影も硬い。

51.

Koola式バウンスカードを 採用しました

52.

Koola式バウンスカードとは やわらかい光の表現をしつつ複数回の間接光のバウンスに対応できる

53.

Koola式 バウンスカードサイズ 200x200cm

54.

Static Spot Light SourceRadius 200

55.

バラガン邸で使用したメインのライト • Directional Light Stationery • Sky Light Static • Koola式バウンスカード Static Spot Light ひとまずこの方針でいくことに

56.

2.シーンセットアップ

57.

Lightmass Importance Volumeの配置 Volume Lighting Samplesの配置範囲を指定

58.

Lightmass Portal ファイナルギャザーの際にどこを重点的に計算するべきか教える

59.

SkyLightの品質が改善 Portalあり

60.

SkyLightの品質が改善 Portalなし

61.

SkyLightの品質が改善 Portalあり

62.

SkyLightの品質が改善 Portalなし

63.

ReflectionCaptureの配置 何も置かないとスカイライトの反射でよくわからないことに

64.

ReflectionCaptureの配置 最終のイメージをつかむために仮で入れておいたほうが良い

65.

PostProcessのオフ • Auto Exposure • 露出が変わってしまう。 • Bloom • 画面が明るくなりわかりにくい • Screen Space Ambient Occlusion ライトベイクの結果かAOの結果かわからない

66.

Compress LightMapsのオフ Compress On 63MB Compress Off 90MB モヤモヤの原因がライトベイク時のサンプル数不足か 圧縮によるノイズかわからない。ライトマップのサイズが増えるので注意。

67.

3.テストライティング

68.

ライティングバランスの調整 LightingQualityはPreviewかMediumで十分

69.

Num Indirect Lighting Bounces の調整

70.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 0 2m54s

71.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 1 3m41s

72.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 2 3m35s

73.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 3 3m46s

74.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 5 3m39s

75.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 10 3m55s

76.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 20 3m42s

77.

Num Indirect Lighting Bounces の調整 Num Indirect Lighting Bounces 100 3m31s

78.

Num Indirect Lighting Bounces の調整 • 「5」ぐらいで絵はほとんど変わらなくなる • ほとんどビルド時間への影響はない

79.

4.ライティングエスキス

80.

ライトマップのディティールを出したい どうやって?

81.

1.ライトマップの高解像度化 LightmapResolution=512 LightmapResolution=64 • ライトマップの最小テクセル以下のディティールは記録できない

82.

2.Static Lighting Level Scaleを下げる

83.

2.Static Lighting Level Scaleを下げる (イラディアンスキャッシュのRecordRadiusScaleを下げる) StaticLightingLevelScale=1 StaticLightingLevelScale=0.1 • RecordRadiusより小さなディティールは記録できない

84.

つまり… 1.欲しいディティールがでるまで Static Lighting Level Scaleを下げる。 2.引き出したディティールを記録できるまで ライトマップ解像度を上げる

85.

1.Static Lighting Level Scaleの 設定

86.

写真のディティール このへんの 影のディティールと ボケ足感が欲しい 引用元 http://motokimokito.blogspot.jp/

87.

Static Lighting Level Scale =1 (デフォルト)

88.

Static Lighting Level Scale =0.5

89.

Static Lighting Level Scale =0.2

90.

Static Lighting Level Scale =0.1 (今回の設定)

91.

この段階ではモヤモヤは 気にしない。 ディティールのチェック

92.

最終ライティングビルドの設定

93.

引用元 http://motokimokito.blogspot.jp/ ディティールは出たかな?

94.

動的メッシュへの影響 Static Lighting Level Scale 1.0 Static Lighting Level Scale 0.1 Static Lighting Level Scaleを下げると Volume Lighting Sampleが増えるので注意

95.

2.ライトマップ解像度の設定

96.

Light Map Resolution 32

97.

Light Map Resolution 64

98.

Light Map Resolution 128

99.

Light Map Resolution 256 (今回の設定)

100.

Light Map Resolution 512

101.

Light Map Resolution 1024

102.

ダイレクトシャドウのディティール 影のギザギザが嫌なら解像度を上げざるを得ない

103.

ダイレクトシャドウのディティール 上げたくないのでカスケードシャドウを使いました。

104.

ライトマップ解像度が決まった。

105.

各メッシュの LightMapResolutionを あげるだけでいいか~

106.

ライトマップ用UVの調整が 残っていますね。

107.

不適切なライトマップ用UV ライトマップ用UV アイランド間のパディング=0

108.

64 4 ライトマップ解像度に対して4テクセルのパディングになるように調整

109.

適切なパディングに調整 ライトマップ用UV アイランド間のパディング=4

110.

Indirect Lighting Smoothnessを調整

111.

Static Lighting Level Scale =0.1 Indirect Lighitng Quality=5 Medium の設定で固定

112.

Indirect Lighting Smoothness=0.5 28m56s

113.

Indirect Lighting Smoothness=0.8 32m55s

114.

Indirect Lighting Smoothness=1 29m46s (デフォルト値)

115.

Indirect Lighting Smoothness=1.2 33m22s

116.

Indirect Lighting Smoothness=1.5 28m58s

117.

Indirect Lighting Smoothness=2.0 33m28s

118.

Indirect Lighting Smoothness=0.5 28m56s

119.

Indirect Lighting Smoothness=0.8 32m55s

120.

Indirect Lighting Smoothness=1 29m46s (デフォルト値)

121.

Indirect Lighting Smoothness=1.2 33m22s

122.

Indirect Lighting Smoothness=1.5 28m58s

123.

Indirect Lighting Smoothness=0.5 28m56s

124.

Indirect Lighting Smoothness=0.8 32m55s

125.

Indirect Lighting Smoothness=1 29m46s (デフォルト値)

126.

Indirect Lighting Smoothness=1.2 33m22s

127.

Indirect Lighting Smoothness=1.5 28m58s

128.

Indirect Lighting Smoothness=2.0 33m28s

129.

Indirect Lighting Smoothnessの考察 スムーズUP ディティールアップ (ビルド時間が短くなる) ノイズが増える ディティール消失 (ビルド時間が増える) 値を下げる 1.0 値を上げる

130.

基本的に Indirect Lighting Smoothness=1.0 で、よさそうです

131.

ディティール重視の時は0.8 スムーズさ重視の時は1.2 ぐらいは、ありかもしれません

132.

5.最終ライティング

133.

モヤモヤ(アーティファクト)を 消していく

134.

ちょっとその前に

135.

Lighting Quality や Lightmass Settingsって何してるの? これまで触ってきた • Static Lighting Level Scale • Indirect Lighting Smoothness 他にも • Indirect Lighting Quality などなど…

136.

BaseLightmass.iniを スケーリングしています

137.

C:¥Program Files¥Epic Games¥4.12¥Engine¥Config に入ってます

138.

; 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

139.

ぎゃ~~~~

140.

Lighting Quality が 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

141.

何を調整しているか? [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 ファイナルギャザーの アダプティブサンプルの品質

142.

アーティストが調整できるように 重要項目を複数まとめて スケーリングしてくれています

143.

後で少しお話します

144.

では改めて、モヤモヤを 消していきましょう

145.

まずはLighting Qualityで調整

146.

Static Lighting Level Scale=0.1 で固定

147.

Preview 2m16s

148.

Medium 7m48s

149.

High 13m58s

150.

Production 30m22s

151.

まだクオリティが足りない

152.

計算精度をさらに上げたい

153.

Indirect Lighting Qualityで調整 (ファイナルギャザーのレイの数を上げる)

154.

Indirect Lighting Quality 1 Medium 7m48s

155.

Indirect Lighting Quality 2 Medium 12m55s

156.

Indirect Lighting Quality 5 Medium 29m46s

157.

Indirect Lighting Quality 10 Medium 1h5m24s

158.

Productionに

159.

Static Lighting Level Scale=0.1 Indirect Lighting Quality=10 Production

160.

Lighting QualityがProductionの場合 Static Lighting Level Scale×Indirect Lighting Quality =1.0 0.1 のとき 10 0.2 のとき 5 0.5 のとき 2 掛けて1.0になる割合で概ね 満足できるレベルにモヤモヤがとれました。

161.

Casa Barragan最終設定 Static Lighting Level Scale = 1→ 0.1 Num Indirect Lighting Bounces =3→20 Indirect Lighting Quality = 1→10 Indirect Lighting Smoothness=1.0→1.0 Lighting Quality = Production Build Time 15m57s →4h10m24s

162.

Casa Barragan最終設定 Static Lighting Level Scale = 1→ 0.1 Num Indirect Lighting Bounces =3→20 Indirect Lighting Quality = 1→10 Indirect Lighting Smoothness=1.0→1.0 Lighting Quality = Production Build Time 15m57s →4h10m24s 15倍!!

163.

はっきり言ってゲームエンジンの 設定としては重い設定だと思います。

164.

ここまでは入り口です。

165.

6. Lightmass Deep Dive

166.

Lightmass.iniでしか できないチューニングが たくさんあります

167.

C:¥Program Files¥Epic Games¥4.12¥Engine¥Config

168.

BaseLightmass.ini

169.

; 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

170.

ご安心を!

171.

必要なところだけ コピペ&値を変更 「DefaultLightmass.ini」として 「ProjectName」¥Config に置くことで設定可能

172.

例えば エリアシャドウのクオリティを 上げたい時

173.

DefaultLightmass.iniでシャドウのディティール上げる NumShadowRaysScale=2 NumPenumbraShadowRaysScale=4 Medium 設定のデフォルト値

174.

エディタでできないチューニングができる NumShadowRaysScale=16 NumPenumbraShadowRaysScale=64

175.

「BaseLightmass.ini」からコピペして値を変えるだけ 「ProjectName」¥Configの中に「DefaultLightmass.ini」として保存

176.

さっきのシーンを もっと最適化できる方法はないか

177.

レイが十分 レイが足りない レイが足りない レイが十分 全体のレイの数を増やすと無駄なのでは…

178.

ファイナルギャザーを改善 Indirect Lighting Qualityを上げる ↓ ファイナルギャザーのレイの数を上げる

179.

ファイナルギャザーの レイの数に比例して品質は 上がるが時間がかかる。

180.

ファイナルギャザーを改善 Indirect Lighting Qualityを増やすと必要のない 所までレイが増えるので無駄なのでは ↓ アダプティブサンプルで必要なとこに必要なだけ レイを増やしたい ↓ アダプティブサンプル改善の レベルを上げる or レベルが上がる際の明るさの閾値を下げる

181.

アダプティブサンプル改善の レベルを上げる NumAdaptiveRefinementLevel

182.

NumAdaptiveRefinementLevels=0 Medium 1m16s

183.

NumAdaptiveRefinementLevels=1 Medium 2m15s

184.

NumAdaptiveRefinementLevels=2 Medium 4m43s (Lighting Quality Previewの時のデフォルト値)

185.

NumAdaptiveRefinementLevels=3 Medium 10m59s (Lighting Quality Medium,High,Productionの時のデフォルト値)

186.

NumAdaptiveRefinementLevels=4 Medium 34m45s

187.

アダプティブサンプル改善の レベルを上げる閾値を調整 AdaptiveBrightnessThresholdScale

188.

Static Lighting Level Scale =0.2 Indirect Lighitng Quality=5 Medium の設定で固定

189.

NumAdaptiveRefinementLevels=3 AdaptiveBrightnessThresholdScale=0.5 (Mediumのデフォルト) 3m28s

190.

NumAdaptiveRefinementLevels=3 AdaptiveBrightnessThresholdScale=0.25 3m33s

191.

NumAdaptiveRefinementLevels=3 AdaptiveBrightnessThresholdScale=0.05 4m13s

192.

NumAdaptiveRefinementLevels=4 AdaptiveBrightnessThresholdScale=0.5 12m41s

193.

NumAdaptiveRefinementLevels=5 AdaptiveBrightnessThresholdScale=0.25 48m03s

194.

あれ、よけい重くないか? ということで Static Lighting Level Scale =0.2 Indirect Lighitng Quality=10 Productionと比較

195.

Static Lighting Level Scale=0.2 Indirect Lighintg Quality=10 Production 28m22s

196.

NumAdaptiveRefinementLevels=5 AdaptiveBrightnessThresholdScale=0.25 48m03s

197.

費用対効果が悪いため 素直にIndirect Ligihting Qualityで レイの数を上げたほうがよいです

198.

ただし、Indirect Lighting Qualityで 11以上値をいれるのは要注意

199.

Indirect Lighting Quality>11 の時 NumAdaptiveRefinementLevel +1 になります

200.

ビルド時間が跳ね上がります。

201.

Lightimass.iniからレイの数を調整 各Ligihtng Qualityの「NumHemisphereSamplesScale」 Or [DevOptions.ImportanceTracing]NumHemisphereSamples これらの値を変更することでもレイの数をスケーリングできる

202.

Lightmass.iniには あなたのコンテンツにあった カスタムチューニングをするための 全ての設定があります

203.

Lets make Lightmass Epic https://forums.unrealengine.com/showthread.php?88952-Letsmake-Lightmass-EPIC-(and-understandable) Koolaさんはじめ凄腕アーティスト達がLightmassを研究しています

204.

まとめ

205.

静的なシーンでのLightmapの品質 (MovableなStaticMesh,SkeltalMeshは後半のセッションで)

206.

各種光源の挙動の違いを理解するのが大事 フォトンがでるライト フォトンがでないライト • Directional Light • Point Light • Spot Light • Koola式バウンスカード • Sky Light • Use Emissive For Static Lighting 特にスカイライト!

207.

各種設定が何に影響するか 項目 影響するもの ビルド時間への影響 影 フォトンマッピング Lighting Quality イラディアンスキャッシュ ファイナルギャザー 全体的な品質設定 高

208.

各種設定が何に影響するか 項目 Static Lighting Level Scale Num Indirect Lighting Bouces 影響するもの Lightmassのディティール (イラディアンスキャッシュの Indirect Lighting Smoothness 中(高) 記録半径) シーンの明るさ (フォトンの反射回数) アーティファクトノイズを減らす Indirect Lighting Quality ビルド時間への影響 (ファイナルギャザーのレイの数) ライトマップをぼかす割合 (イラディアンスキャッシュの 補間の割合) 低 高 低

209.

Lightmassの品質(ディティール)&ビルド時間 = ライトマップ解像度(解像度が上がる) × Lighitng Quality(全体的な品質が上がる) × Indirect Lighting Quality(アーティファクトノイズが減る) ÷ Static Lighting Level Scale(ディティールが上がる)

210.

間違っている事や こんないい方法あるよって方は ドシドシご意見を頂けると嬉しいです!! http://www.frames-cg.com/ @torashami