Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

123
Lightmass Deep Dive vol.2 Precomputed Light Volume 篠篠 篠篠 Epic Games Japan Senior Support Engineer

Transcript of Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Page 1: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Lightmass Deep Divevol.2 Precomputed Light Volume編

篠山 範明Epic Games Japan

Senior Support Engineer

Page 2: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Lightmass が出力するデータ

LightMap

ShadowMap

PrecomputedLight

Volume

Page 3: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Precomputed Light Volume

Page 4: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Precomputed Light Volume とは?

• 空間上に分布されたライティング情報• Lightmass で作成される。• Movable なメッシュのライティングに使われる。

Page 5: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ViewのメニューでDebug表示できます。

Page 6: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Precomputed Light Volume の…・使われ方・作られ方

の二点を見ていこうと思います。

Page 7: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Indirect Lighting CachePLV の使われ方

Page 8: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Movable Mesh のライティングは二種類

Page 9: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Movable Mesh のライティングは二種類

Direct Lighting By Movable Light

Page 10: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Movable Mesh のライティングは二種類PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

Direct Lighting By Movable Light

Indirect LightingBy PLVs

Page 11: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

周りの PLV からどのようにライティングを見積もるか?

Indirect LightingBy PLVs

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

Page 12: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Indirect Lighting Cache

Indirect LightingBy PLVs

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

Page 13: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Indirect Lighting Cache

Indirect LightingBy PLVs

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

Movable なメッシュは、ILC というデータをそれぞれ持つ

ランタイム上で、近くの PLV から自身の ILC を見積もりライティングを計算する。

Page 14: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILC 系調整、デバッグコマンド

r.Cache.XXXXXXというコマンドで調整できます。

Page 15: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILC Sampling の表示

• r.Cache.UpdateEveryFrame 1• r.Cache.DrawInterpolationPoints 1

• 毎フレーム Update してしまうので、デバッグ表示あとは必ず Off にするのをお忘れなく。

Page 16: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

二つのサンプリング方法

ILCQ_ Point ILCQ_Volume

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

Page 17: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

二つのサンプリング方法

Page 18: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

主な違いは、体積を考慮するかしないか。

Page 19: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Point

ILCQ_ Point

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

ILCQ Point

データ BB の中心一点レンダリング メッシュの大きさを

考慮しない

コスト 比較的軽い問題点 ???

Page 20: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Point の問題点

ゆっくり動くとパカパカします。(demo)

Page 21: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

予備 gif

Page 22: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

原因を調べます。。

Page 23: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Point の問題点

毎フレームの更新を避けるため、参照点がスナップされているからです。(demo)

Page 24: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

予備 gif

Page 25: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Point の問題点

サンプリングポイントのスナップによりパカつきが目立つ。(ILCQ_Volumeもスナップするけど、あまり目立たない )

Page 26: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Point の問題点

試しに、参照しないように修正してみました(demo)

Page 27: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

予備 gif

Page 28: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

予備 gif

Page 29: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Point の問題点

なおった!

Page 30: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Point の問題点

しかし、この処理は毎フレームの ILCの更新を招くため、CPU負荷を招く可能性があります。

プロファイルしてから採用を検討します。

Page 31: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Point

ILCQ_ Point

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

ILCQ Point

データ BB の中心一点レンダリング メッシュの大きさを

考慮しない

コスト 比較的軽い問題点 パカパカする

Page 32: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Volume

ILCQ_Volume

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

Page 33: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Volume

ILCQ_Volume

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILCQ Volume

データ BB 上のグリッド上に配置 (5*5*5)

レンダリング メッシュの大きさを考慮する

コスト Point に比べ CPU/GPU 共に高コスト

問題点 ???

Page 34: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Volume の問題点

demo

Page 35: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Volume の問題点

ILC更新の CPUコスト。。。

Page 36: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Volume の問題点

キューブを巨大にしたらその分負荷も増える。

Page 37: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ Volume の問題点

Volumeの中に入ってる PLVがあればあるほど、CPUコストが増えます。

非常に大きなオブジェクトへの適用は慎重に。。

Page 38: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ILCQ_Volume

ILCQ_Volume

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILCQ Volume

データ BB 上のグリッド上に配置 (5*5*5)

レンダリング メッシュの大きさを考慮する

コスト Point に比べ CPU/GPU 共に高コスト

問題点 大きいと高コスト

Page 39: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

二つのサンプリング方法PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

Page 40: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

二つのサンプリング方法PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

ILC ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILC

ILCQ Point ILCQ_Volumeデータ BB の中心一点 BB 上のグリッド上に配置レンダリング メッシュの大きさを考慮し

ないメッシュの大きさを考慮する

コスト 比較的軽い Point に比べ CPU/GPU 共に高コスト

問題点 ゆっくり動くとパカパカ 大きいと高コスト

Page 41: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

おまけ : Smooth Transition• 早く動くと補完される。r.Cache.SampleTransitionSpeed(default: 800)

Demo…

Page 42: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の使われ方 ~Indirect Lighting Cache~ まとめ• Movable なオブジェクトは PLV から ILC を作成し、動的にレンダリングします。• ILC には Point と Volume があります。• それらの特徴を理解して、プロファイルして、どちらを使うか見極めましょう

Page 43: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

しかし。。。そもそも PLV がダメだったらどんなサンプリングしてもだめ。

ノイズだらけ 配置がおかしい

Page 44: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の作り方データ計算方法と配置方法

Page 45: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV のデータ

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

PLV

一つの PLVが 3バンドの SHです(SH = Spherical Harmonics)

Page 46: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV のデータ

一つの PLVが 3バンドの SHです(SH = Spherical Harmonics)

デバッグ表示では一色ですが。。。

PLV

Page 47: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV のデータ

一つの PLVが 3バンドの SHです(SH = Spherical Harmonics)

デバッグ表示では一色ですが。。。

方向性があります。

PLV

画像参考例 : http://www.banterle.com/francesco/projects/BantyToolkit/tk_diffuse.jpg

Page 48: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV のデータ

一つの PLVが 3バンドの SHです(SH = Spherical Harmonics)

デバッグ表示では一色ですが。。。

方向性があります。

このデータを周りから作成する必要があります。

PLV

画像参考例 : http://www.banterle.com/francesco/projects/BantyToolkit/tk_diffuse.jpg

Page 49: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

一つ一つの PLV がどのように作られているか?

PLV

Page 50: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

一つ一つの PLV がどのように作られているか?

PLV

Page 51: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

上半分と下半分に分けて別々に。。。Lightmap と同様の計算をします。

PLV

Page 52: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

直接光を計算し

PLV

Page 53: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final Gathering!!

PLV

Page 54: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

下半分も同様です。直接光 + FG

PLV

Page 55: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

その二つを合算し、 PLV を作成します。

PLV

Page 56: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ただし、実は問題があります。

PLV

Page 57: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final GatheringがAdaptive Samplingしない問題

Page 58: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final Gathering Adaptive Sampling

Lightmap Texel

Page 59: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final Gathering Adaptive Sampling1 レイを半休上全体に飛ばして、飛ばした先からの Photon や Skylight を見積もる

本来は何十本も。。

Page 60: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final Gathering Adaptive Sampling2 となりあったレイから受け取るエネルギーの差が大きい場合は。。。

Page 61: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final Gathering Adaptive Sampling3. 再分割して詳細を見る

Page 62: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Final Gathering Adaptive Sampling4. 繰り返す。輝度差が閾値より低くなる、または最大分割数まで分割したらサンプリング終了。

Page 63: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

「 PLV 作成の」 Final Gathering のとき、この再分割 (Adaptive Sampling) を行いません。

PLV

Page 64: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

なので、現在の UE4 では、Lightmass Portal の効果は PLV には出ません。

PLV

Portal

Page 65: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

結果どうなるか。。。。

Page 66: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

結果どうなるか。。。。ノイズが多い。。

Page 67: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

試しに、再分割 (Adaptive Sampling)できるようにしてみました。

PLV

Page 68: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

ノイズが取れました。

Page 69: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

比べると一目瞭然です

Page 70: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

UE4.13をめどに、PLV作成もAdaptive Samplingになります。

ノイズが減りますが、ビルド時間が若干増えます

Page 71: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の作り方データ計算方法と配置方法

Page 72: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

失敗例

こんなにいらない 相対的におかしい

絵作りだけじゃなく、メモリ量、ビルド時間にも影響

Page 73: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置アルゴリズム

PLV の配置方法は三つが順番で行われます。

Surface Light

Sample

DetailVolumeSample

UniformVolumeSample

Page 74: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Surface Light Sample からはじめます

Page 75: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

各ポリゴン単位で処理が行われます。

Page 76: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

各ポリゴン、の法線を見て。。。上向きだったら。。

Page 77: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

その表面に、数段の PLV を作成します。

Page 78: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

こいつらです。

Page 79: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

ここにもできます。

Page 80: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

FirstSurfaceSampleLayerHeight(Default = 50)

SurfaceSampleLayerHeightSpacing(Default = 250)

.ini で細かくパラメータ調整できます。

何段つくる?NumSurfaceSampleLayers(Default = 2)SurfaceSampleLayer

HeightSpacing(Default = 250)

Page 81: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Detail Volume Sample…

Page 82: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Lightmass Character Indirect Detail Volumeで括った領域に PLV を作成します。

Page 83: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Lightmass Character Indirect Detail Volumeで括った領域に PLV を作成します。

Page 84: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

こいつら

Page 85: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

.ini で間隔が調整できます。

DetailVolumeSampleSpacing(Default = 300)

Page 86: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Uniform Volume Sample

Page 87: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Lightmass Importance Sample で囲った全体で PLV を作成します。

Page 88: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

最初のテストシーンではでてこない。。

Page 89: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

Default がめっちゃでかい!

VolumeLightSampleSpacing(Default = 3000)

Page 90: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

シーンが小さすぎた。

Page 91: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

90m Cube にしたら出てきた。 (30m 置き )

Page 92: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

下は Surface Light Sample で感覚は 3m 置きです。

Page 93: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

嫌な不釣り合いですね。。

Page 94: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置アルゴリズム

PLV の配置方法は三つが順番で行われます。

Surface Light

Sample

DetailVolumeSample

UniformVolumeSample

Page 95: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置アルゴリズム

ちなみに、各フェイズで PLV を作ろうとしたとき、近くにすでに作られていたら、その作成をスキップします。

Surface Light

Sample

DetailVolumeSample

UniformVolumeSample

Page 96: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置アルゴリズム

ちなみに、各フェイズで PLV を作ろうとしたとき、近くにすでに作られていたら、その作成をスキップします。

Surface Light

Sample

DetailVolumeSample

UniformVolumeSample

Page 97: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLVの配置設定方法

Page 98: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置方法

既に説明した二つのボリューム以外に、実は二つしかありません。

Volume

・・・・・

Page 99: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Static Lighting Level Scale (SLLS)

Static Lighting Leve Scale (SLLS) = 1.0

ライトマス全体のWorld Gridのスケーリング

Page 100: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Static Lighting Level Scale (SLLS)

Static Lighting Leve Scale (SLLS) = 0.1

ライトマス全体のWorld Gridのスケーリング

Page 101: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV増やしたいけど。。。 SLLS変えると、他のライトマスのパラメータにも影響しちゃうな。。。

Page 102: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

World Settings: Static Lighting Level Scale  

Photon mapping

Final Gathering

IrradianceCaching

Direct Lighting

(Shadowing)影用レイの数 Photonの放出量

最大バウンス回数 レイの数 キャッシングの半径

Lightmass 内部の World Grid.どれぐらいスケールするかを設定する。小さくすればするほどビルド時間が激増します。

Page 103: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

World Settings: Static Lighting Level Scale  

SLLS = 1.5 SLLS = 0.5SLLS を変えることで、例えば、 Irradiance Cache の半径が小さくなりサンプルが増えます。が、それだけビルド時間が増えます。

Page 104: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV増やしたいけど。。。 SLLS変えると、他のライトマスのパラメータにも影響しちゃうな。。。

Page 105: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Volume Light Sample Replacement Scale

PLVの配置専用のスケーリングパラメータStatic Lighting Leve Scale (SLLS) は

Lightmass全体の処理に影響するが、こちらは単独したスケーリングが可能

Page 106: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Volume Light Sample Replacement Scale

PLVの配置専用のスケーリングパラメータStatic Lighting Leve Scale (SLLS) は

Lightmass全体の処理に影響するが、こちらは単独したスケーリングが可能

。。。。。と思ったら。。。

Page 107: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Volume Light Sample Replacement Scale

Volume Light Sample Replacement Scale = 0.1

Page 108: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Static Lighting Level Scale (SLLS)

Static Lighting Leve Scale (SLLS) = 0.1

Page 109: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Volume Light Sample Replacement Scale

VLSRS = 0.1SLLS = 0.1ちがうじゃん!

Page 110: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Volume Light Sample Replacement Scale

このパラメータは。。SurfaceLightSampleSpacing,VolumeLightSampleSpacing,DetailVolumeSampleSpacing

各フェイズの SampleSpacingをスケールするだけです。

Surface Light

Sample

DetailVolumeSample

UniformVolumeSample

Page 111: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

ここだけ影響しない!!

Page 112: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Volume Light Sample Replacement Scale

VLSRS = 0.1SLLS = 0.1高さだけが違う

Page 113: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置方法

エディタでできるスケーリングでした。。

Volume

・・・・・

Page 114: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置方法

ということで、エディタでできるのは、重要なところを囲む全体をスケーリングさせるの二つしかできません。

Page 115: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置方法

あなたのプロジェクトにDefaultLightmass.iniを追加するときが来ました!!

Page 116: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置方法

パラメータの意味はスライドに入れておきました

Page 117: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

FirstSurfaceSampleLayerHeight(Default = 50)

SurfaceSampleLayerHeightSpacing(Default = 250)

.ini のパラメータ

何段つくる?NumSurfaceSampleLayers(Default = 2)SurfaceSampleLayer

HeightSpacing(Default = 250)

Page 118: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

.ini のパラメータ

DetailVolumeSampleSpacing(Default = 300)

Page 119: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Surface

Light Sampl

e

DetailVolum

eSampl

e

Uniform

Volume

Sample

.ini のパラメータ

VolumeLightSampleSpacing(Default = 3000)

Page 120: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

PLV の配置方法

[DevOpitions.PrecomputedDynamicObjectLighting]と記載して必要なパラメータをオーバーライドしてみてください。

Page 121: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

Precomputed Light Volume

Page 122: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

まとめ

Precomputed Light VolumeとIndirect Lighting Cacheはセットです。

シビアに調整したい場合は、二つの特性を理解し、最適な手法を模索しましょう。

Page 123: Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)

•斎藤さんへ GO!