Skip to content
Go back

Stochastic light culling

· Updated:

paper web

拙訳

関連研究

  • 多光源レンダリング
    • VPL [Keller 1997Keller, A. 1997. Instant radiosity. Proceedings of the 24th annual conference on computer graphics and interactive techniques 49–56. 10.1145/258734.258769. https://dl.acm.org/doi/pdf/10.1145/258734.258769.]
    • Reflective Shadow Maps [Dachsbacher and Stamminger 2005Dachsbacher, C. and Stamminger, M. 2005. Reflective shadow maps. Proceedings of the 2005 symposium on interactive 3D graphics and games 203–231. 10.1145/1053427.1053460.]
      • 点光源や平行光源からのsingle-bounceのVPL
    • Imperfect Shadow Maps [Ritschel et al. 2008Ritschel, T., Grosch, T., Kim, M. H., Seidel, H.-P., Dachsbacher, C. and Kautz, J. 2008. Imperfect shadow maps for efficient computation of indirect illumination. ACM SIGGRAPH asia 2008 papers. 10.1145/1457515.1409082. https://jankautz.com/publications/ISM_SIGAsia08.pdf.]
      • 多光源でのシャドウマップ
    • Bidirectional Reflective Shadow Mapping や Adaptive Imperfect Shadow Maps [Ritschel et al. 2011Ritschel, T., Eisemann, E., Ha, I., Kim, J. D. K. and Seidel, H.-P. 2011. Making imperfect shadow maps view-adaptive: High-quality global illumination in large dynamic scenes. Computer Graphics Forum 30, 8, 2258–2269. 10.1111/j.1467-8659.2011.01998.x.]
      • 視点依存のimportanceを考慮する
    • Lightcuts [Walter et al. 2005Walter, B., Fernandez, S., Arbree, A., Bala, K., Donikian, M. and Greenberg, D. P. 2005. Lightcuts: a scalable approach to illumination. ACM SIGGRAPH 2005 papers 1098–1107. 10.1145/1186822.1073318. https://www.graphics.cornell.edu/~bjw/lightcuts.pdf.]
      • 多光源でのradiance計算(オフラインレンダリング用)
    • Interleaved Sampling や Geometry-aware Filtering [Segovia et al. 2006Segovia, B., Iehl, J. C., Mitanchey, R. and Péroche, B. 2006. Non-interleaved deferred shading of interleaved sample patterns. Proceedings of the 21st ACM SIGGRAPH/EUROGRAPHICS symposium on graphics hardware 53–60. 10.1145/1283900.1283909. https://liris.cnrs.fr/Documents/Liris-2476.pdf.; Ritschel et al. 2011Ritschel, T., Eisemann, E., Ha, I., Kim, J. D. K. and Seidel, H.-P. 2011. Making imperfect shadow maps view-adaptive: High-quality global illumination in large dynamic scenes. Computer Graphics Forum 30, 8, 2258–2269. 10.1111/j.1467-8659.2011.01998.x.]
      • リアルタイムでの大まかなradiance推定
        • 一致推定量consistent estimatorとなり得る
          • 一致性があるconsistentと、サンプル数の増加に従って推定値が母数に収束していく
        • 光源を一様にサンプリングしているため、分散が大きくなったりサンプリングしすぎたりoversamplingして問題になる
  • ライトカリング
  • ライトカリング向けシャドウイング
    • Forward+と組み合わせるray-traced shadows [Harada et al. 2013Harada, T., McKee, J. and Yang, J. C. 2013. Forward+: A Step Toward Film-Style Shading in Real Time. GPU Pro 4 277–298.]
    • Clustered shadingを用いたvirtual shadow maps [Olsson et al. 2014Olsson, O., Sintorn, E., Kämpe, V., Billeter, M. and Assarsson, U. 2014. Efficient virtual shadow maps for many lights. Proceedings of the 18th meeting of the ACM SIGGRAPH symposium on interactive 3D graphics and games 87–96. 10.1145/2556700.2556701. https://www.cse.chalmers.se/~d00sint/more_efficient/clustered_shadows_tvcg.pdf.]
      • 直接照明を想定して作られている

確率論的ライトカリング

  • 確率論的なフォールオフ関数を導入する
    • ライトがそのシェーディング点にとって重要でない場合に確率論的な方法で取り除く
    • フォールオフ関数f(l)f(l)を確率pi(l)[0,1]p_i(l) \in [0, 1]で無作為にサンプリングするロシアンルーレット法を用いる
    • フォールオフ関数は以下のように近似される:
      • f(l){f(l)pi(l)=max(αi,f(l))(pi(l)>ξi)0(otherwise)f(l) \approx \begin{cases} \frac{f(l)}{p_i(l)} = \max(\alpha_i, f(l)) & (p_i(l) > \xi_i) \\ 0 & (\text{otherwise}) \end{cases}
        • llはシェーディング点から光源までの距離
        • αi\alpha_iは分散を制御するための定数
        • ξi[0,1)\xi_i \in [0, 1)は一様乱数
        • 本論では、pi(l)=min(f(l)αi,1)p_i(l) = \min \left( \frac{f(l)}{\alpha_i}, 1 \right)を使う
          • pip_iはspatially-varying importanceを示すため、効率を考えるとf(l)f(l)に比例させる方が良い
    • 本手法では、光源1つに対して乱数を1つだけ用意して、シェーディング点すべてで同じ値を使う
      • 各光源の影響範囲を固定して、カリングできるようにするため
      • その範囲rir_iは以下のように求まる:
        • ri=f1(αiξi)=1αiξir_i = f^{-1}(\alpha_i \xi_i) = \frac{1}{\sqrt{\alpha_i \xi_i}}
          • pi(l)p_i(l)は単調に減少するので、pi(ri)=ξip_i(r_i) = \xi_iから導き出せる
        • 光源との距離がrir_i以上ならその光源をカリングできる
          • αi\alpha_iを制御することで、分散を大きくするかカリングされやすくするかのトレードオフを決める
  • 誤差限界error boundをもとにαi\alpha_iを決定する
    • シェーディング点ごとに計算するVPL数がVPL総数に対して劣線形sublinearになる

      • VPLでは放射強度が光源数NNに反比例するので、より大きなαi\alpha_iはより大きなNNに対して使われる
    • αi\alpha_iはユーザー指定の誤差限界ϵmax\epsilon_{\max}を用いて以下のように定義される:

      • αi=2πϵmaxEmaxω^(Ii(ω^))\alpha_i = \frac{2\pi \epsilon_{\max}}{E \max_{\hat{\omega}^{'}} (I_i(\hat{\omega}^{'}))}

        • EEはカメラの露出の大きさのパラメータ
          • 自動露出などでシェーディング時に分からないときは前フレームの値を使う
        • ω^\hat{\omega}^{'}はシェーディング点から光源への向き。ライト方向
      • 導出は以下の通り:

        • 確率論的フォールオフ関数の分散は以下のように求まる:
          • (σi(l))2=(1pi(l)1)(f(l))2(\sigma_i(l))^2 = (\frac{1}{p_i(l)}-1) (f(l))^2
        • すると、ある光源に現れる誤差は以下のように求まる:
          • ϵi(x,ω^)=σi(xix)EIi(ω^i)V(x,xi)ρ(x,ω^,ω^i)max(ω^in^,0)\epsilon_i(\boldsymbol{x},\hat{\omega}) = \sigma_i(||\boldsymbol{x}_i - \boldsymbol{x}||) E I_i(-\hat{\omega}_i^{'}) V(\boldsymbol{x}, \boldsymbol{x}_i) \rho(\boldsymbol{x}, \hat{\omega}, \hat{\omega}_i^{'}) \max(\hat{\omega}_i^{'} \cdot \hat{n}, 0)
            • IiI_iは光源の放射強度
            • VVは可視性
            • ρ\rhoはBRDF
            • x\boldsymbol{x}はシェーディング点の位置
            • xi\boldsymbol{x}_iは光源の位置
            • ω^\hat{\omega}はシェーディング点からカメラへの向き。カメラ方向
            • n^\hat{n}は表面の法線
        • したがって、誤差の最大値は以下のように求まる:
          • ϵmax=αiEmaxω^(Ii(ω^))2π\epsilon_{\max} = \frac{\alpha_i E \max_{\hat{\omega}^{'}}(I_i(\hat{\omega}^{'}))}{2\pi}
            • 分散の式からmaxl(σi(l))=αi2\max_l(\sigma_i(l)) = \frac{\alpha_i}{2}が得られる
            • VVの最大値は明らかに11
            • ρ\rhoは単純化のためにLambertモデル(ρ=1π\rho = \frac{1}{\pi})であると仮定する
            • ω^in^\hat{\omega}_i^{'} \cdot \hat{n}cos\cosなので最大値は11
    • この計算では放射強度IIの指向性を考慮していない

      • そのため、点光源用の既存のライトカリングフレームワークを利用できる
      • 本論では、ディフューズ面のような低周波数の放射強度を想定している

確率論的Tiled Lighting

  • 確率論的ライトカリングは、範囲制限されたライトに対応するフレームワークであれば容易に組み込める
    • 光源の影響範囲をrir_iの式に、フォールオフ関数をf(l)f(l)に置き換えるだけ
    • そのままでも十分キレイに仕上がるが、temporal reprojectionを使ったりフレームごとに乱数列を変えたりすれば画像品質をさらに改善できる
  • VPLベース間接照明のデモ
    • BRSMおよびAISM [Ritschel et al. 2011Ritschel, T., Eisemann, E., Ha, I., Kim, J. D. K. and Seidel, H.-P. 2011. Making imperfect shadow maps view-adaptive: High-quality global illumination in large dynamic scenes. Computer Graphics Forum 30, 8, 2258–2269. 10.1111/j.1467-8659.2011.01998.x.] と確率論的tiled lightingを組み合わせる
      • BRSMでVPLをサンプリングして、間接シャドウを表現するAISMをVPLごとに生成する
      • 元論文では、シェーディングコスト削減のためにinterleaved samplingとgeometry-aware filteringを使っている
    • interleaved sample patterns [Segovia et al. 2006Segovia, B., Iehl, J. C., Mitanchey, R. and Péroche, B. 2006. Non-interleaved deferred shading of interleaved sample patterns. Proceedings of the 21st ACM SIGGRAPH/EUROGRAPHICS symposium on graphics hardware 53–60. 10.1145/1283900.1283909. https://liris.cnrs.fr/Documents/Liris-2476.pdf.] のnon-interleaved deferred shading を用いた実装 [Ritschel et al. 2008Ritschel, T., Grosch, T., Kim, M. H., Seidel, H.-P., Dachsbacher, C. and Kautz, J. 2008. Imperfect shadow maps for efficient computation of indirect illumination. ACM SIGGRAPH asia 2008 papers. 10.1145/1457515.1409082. https://jankautz.com/publications/ISM_SIGAsia08.pdf.] に確率論的tiled lightingを組み合わせる
      • 規則的なサンプリングパターン(8x8とか)にあるピクセルをスクリーンのsubregionsにdeinterleaveして、regionごとに別個のVPLサブセットでシェーディングを行う
        • このregionごとに確率論的tiled lightingを使う
      • interleaved samplingを用いると、タイルごとに必要なライトリストが小さくなるため、より近いメモリ(LDSとか)に収められる
  • Imperfect Shadow Mapsでの点群カリング
    • splatting前にライトをカリングする
      • 面の裏やVPL表面の下にある点をカリングできる
      • 本手法ではライトの影響範囲が有限なので、点とVPLの距離でもカリングできる
        • これによって、splattingパスのコストを劣線形にできる

Progressive Path Tracingでのエリアライトサンプリング

  • エリアライトへの対応
    • 影響範囲を表面の位置ごとに定義し、境界ボリュームをaverage emissive radianceを用いて近似する
    • αi\alpha_iを以下のように修正する:
      • αi=2πϵmaxELˉiAi\alpha_i = \frac{2\pi\epsilon_{\max}}{E \bar{L}_i A_i}
        • Lˉi\bar{L}_iはaverage emissive radiance
        • AiA_iはライトの面積
  • Bounding Sphere Treeによるカリング
    • multi-bounce path tracingではシェーディング点がランダムに散らばるので、視錐台ベースのクラスタリング手法が使えない
    • 代わりに、ライトのBounding Sphere Treeを作って、影響範囲内にあるライトを探す
    • 本手法では確率関数が既知なので、multiple importance sampling [Veach and Guibas 1995Veach, E. and Guibas, L. J. 1995. Optimally combining sampling techniques for Monte Carlo rendering. Proceedings of the 22nd annual conference on computer graphics and interactive techniques 419–428. 10.1145/218380.218498. https://dl.acm.org/doi/pdf/10.1145/218380.218498.] が使える
    • 1回1回のレンダリング誤差を大きくできるprogressive path tracingの方が、より積極的にカリングできるので、特に有効
  • GPU実装
    • ツリーの走査とシェーディングを分離する
      • 分岐のdivergenceを削減するため
      • 可視性判定の計算コストが比較的高いレイトレーシングベースのアルゴリズムでより効果ある
      • シェーディング点ごとに影響範囲内にあるライトリストを作る
    • シャドウレイの数を最大1つに制限する
      • resampled importance sampling [Talbot et al. 2005Talbot, J., Cline, D. and Egbert, P. 2005. Importance resampling for global illumination. Eurographics symposium on rendering (2005). 10.2312/EGWR/EGSR05/139-146. https://diglib.eg.org/server/api/core/bitstreams/0205c190-16aa-4f85-a26f-c7b3220683b9/content.] を使う
      • ライトリストS\mathbb{S}からライト1つをリサンプリングするときのPDFを以下のように定義する:
        • q(i)=gi(x)jSgj(x)q(i) = \frac{g_i(\bold{x})}{\sum_{j \in \mathbb{S}}{g_j(\bold{x})}}
          • gi(x)g_i(\mathbf{x})はライトiiをリサンプリングするときのimportance
        • 単純化のため、gi(x)g_i(\mathbf{x})を以下のように近似する:
          • gi(x)=f(xxi,c)LˉiAimax(ω^i,cn^i,0)max(ω^i,0n^,ω^i,1n^,ω^i,2n^,0)g_i(\mathbf{x}) = f(||\mathbf{x} - \mathbf{x}_{i,c}||) \bar{L}_i A_i \max(-\hat{\omega}_{i,c} \cdot \hat{n}_i, 0) \max(\hat{\omega}_{i,0} \cdot \hat{n}, \hat{\omega}_{i,1} \cdot \hat{n}, \hat{\omega}_{i,2} \cdot \hat{n}, 0)
            • ω^\hat{\omega}x\mathbf{x}からそれぞれの頂点への向き
            • c付きは三角形の中心に関連する
            • n^i\hat{n}_iはライトiiの幾何的な法線
      • ライトリストに対するCDFを作って、二分探索でライトをサンプリングする
      • 光源の頂点をサンプリングして、以下のサンプル密度によって放射輝度を計算する:
        • pi(xix)min(km,1)q(i)si(xi)p_i(||\mathbf{x}_i - \mathbf{x}||) \min\left( \frac{k}{m}, 1 \right) q(i) s_i(\mathbf{x}_i)
          • xi\mathbf{x}_iはサンプリングした頂点
          • si(xi)s_i(\mathbf{x}_i)はライトiiにおける頂点サンプリングPDF(面積ベースだと1Ai\frac{1}{A_i}
      • importanceの計算はkk個のライトを選んだ後に行う
        • divergenceを小さくしたり、計算コストを固定したりするため

Discussion

  • Limitations

    • バンディング・アーティファクト
      • 通常のロシアンルーレット法で発生する高周波ノイズと比べると、geometry-awareフィルタで低減しにくい
      • エリアライトの場合やϵmax\epsilon_{\max}が小さい場合はそこまで問題にならない
    • 指向性importance
      • 本論では、高周波な放射強度およびBRDFがライト範囲の計算に含まれていない
      • 球状でないバウンディングボリュームを使うことで解決できるかもしれない
  • 今後の課題

    • なんやかんやあります