Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ReSTIRについて

Pocol
July 23, 2023

 ReSTIRについて

ReSTIRについての私的まとめ資料。
間違い等があれば,修正例と共にご指摘頂けると大変助かります。
資料は随時更新します。

Pocol

July 23, 2023
Tweet

More Decks by Pocol

Other Decks in Programming

Transcript

  1. 𝐿𝑜 𝑥, 𝜔 = 𝐿𝑒 𝑥, 𝜔 + න Ω

    𝑓𝑟 𝑥, 𝜔′, 𝜔 𝐿𝑖 𝑥, 𝜔 cos 𝜃 𝑑𝜔 Emissive BSDF =BRDF+BTDF Light 解析解が無い(答えが一意に定まらない)。 再帰的に書きなおすことが出来る。
  2. • • • 𝐼 = 1 𝑁 ෍ 𝑖=1 𝑁

    𝑓 𝑥𝑖 𝜌 𝑥𝑖 𝑓 𝑥𝑖 :被積分関数 𝜌 𝑥𝑖 :確率密度関数 𝑁:サンプル数
  3. • • Importance Sampling • Stratified Sampling ( ) •

    Multiple Importance Sampling • Quasi Monte Carlo Method ( ) •
  4. • • 𝑓 𝑥 𝜌 𝑥 𝑃 𝑋 ≤ 𝑥

    𝑃 𝑥 𝑃−1 𝑢 𝑓 𝑥 ※レンダリングにおける具体的な例は[Pocol 2021]を参照。
  5. • • • • • 𝑤𝐵𝑆𝐷𝐹 𝑥 = 𝑝𝐵𝑆𝐷𝐹 𝑥

    𝑝𝐵𝑆𝐷𝐹 𝑥 + 𝑝𝑙𝑖𝑔ℎ𝑡 𝑥 𝑤𝑙𝑖𝑔ℎ𝑡 𝑥 = 𝑝𝑙𝑖𝑔ℎ𝑡 𝑥 𝑝𝐵𝑆𝐷𝐹 𝑥 + 𝑝𝑙𝑖𝑔ℎ𝑡 𝑥
  6. • • 𝑝 𝑀 𝑀 ≥ 1 𝐗 = 𝑋1

    , ⋯ , 𝑋𝑀 𝑤𝑗 3. 𝐗 𝑤1 , ⋯ , 𝑤𝑀 𝑌 𝑤𝑗 = ො 𝑝 𝑋𝑗 𝑝 𝑋𝑗 を 𝑌 Ƹ 𝑝
  7. • • 𝐼 = 1 𝑁 ෍ 𝑖=1 𝑁 𝑓

    𝑌𝑖 Ƹ 𝑝 𝑌𝑖 ∙ 1 𝑀 ෍ 𝑗=1 𝑀 Ƹ 𝑝 𝑋𝑖𝑗 𝑝 𝑋𝑖𝑗 • 𝑓が Ƹ 𝑝 𝑝 • 𝑀 𝑁 補正項がくっついている
  8. 𝑓 = 𝐹𝑟 𝐺 𝑉 𝐿𝑒 Ƹ 𝑝 = 𝐹𝑟

    𝐺 𝐿𝑒 𝐹𝑟 𝐺 𝑉 𝐿𝑒 • • • 比較的軽量な候補サンプルが生成できる!!
  9. • 𝑥1 𝑚 𝑥𝑚 • 𝑥𝑖 • 𝑥𝑖 𝑥𝑚+1 𝑤

    𝑥𝑖 σ 𝑗=1 𝑚 𝑤 𝑥𝑗 𝑤 𝑥𝑚+1 σ 𝑗=1 𝑚+1 𝑤 𝑥𝑗
  10. • 𝑥𝑚+1 𝑥𝑖 𝑤 𝑥𝑖 σ 𝑗=1 𝑚 𝑤 𝑥𝑗

    1 − 𝑤 𝑥𝑚+1 σ 𝑗=1 𝑚+1 𝑤 𝑥𝑗 = 𝑤 𝑥𝑖 σ 𝑗=1 𝑚+1 𝑤 𝑥𝑗 𝒎 𝒎 + 𝟏
  11. • 𝐿 𝑟𝑖𝑠 1,𝑀 = 𝑓(𝑦) Ƹ 𝑝(𝑦) ∙ 1

    𝑀 ෍ 𝑗=1 𝑀 𝑤 𝑥𝑗 = 𝑓 𝑦 ∙ 1 Ƹ 𝑝 𝑦 1 𝑀 ෍ 𝑗=1 𝑀 𝑤 𝑥𝑗 = 𝑓 𝑦 𝑊 𝐱, 𝑧 𝑊 𝐱, 𝑧 = 1 Ƹ 𝑝 𝑥𝑧 1 𝑀 ෍ 𝑖=1 𝑀 𝑤𝑖 𝑥𝑖
  12. • 𝑊 𝐱, 𝑧 Τ 1 𝑝 𝑦 • 𝑊

    𝐱, 𝑧 𝔼 𝑊 𝐱, 𝑧 = 1 𝑝 𝑦 𝑍 𝑦 𝑀 𝑍 𝑦 = 𝑖 | 1 ≤ 𝑖 ≤ 𝑀 and 𝑝𝑖 𝑦 > 0 𝑝𝑖 𝑦 > 0 𝑦 𝑖 𝑝𝑖 𝑦 = 0の 𝑦
  13. • 𝔼 𝑀 𝑍 𝑦 𝑊 𝐱, 𝑧 = 1

    𝑝 𝑦 𝐼 = 1 𝑁 ෍ 𝑖=1 𝑁 𝑓 𝑌𝑖 Ƹ 𝑝 𝑌𝑖 ∙ 1 𝑍 𝑌𝑖 ෍ 𝑗=1 𝑀 Ƹ 𝑝 𝑋𝑖𝑗 𝑝 𝑋𝑖𝑗
  14. • 𝑍 • 𝑍 • • • if 𝑝 𝜔

    > 0 when 𝑓 𝜔 > 0 if Ƹ 𝑝 𝜔 > 0 and 𝑞𝑗 𝜔 > 0 when 𝑓 𝜔 > 0 if Ƹ 𝑝𝑖 𝜔 > 0 and 𝑞𝑗 𝜔 > 0 when 𝑓 𝜔 > 0 𝑍 𝜔 𝑀
  15. • Ƹ 𝑝 Ƹ 𝑝 Ƹ 𝑝𝐴 𝑎 > 0

    but Ƹ 𝑝𝐵 𝑎 = 0 Ƹ 𝑝𝐴 𝑑 = 0 Ƹ 𝑝𝐵 𝑎 = 0
  16. 𝑋𝑖 𝑓 Ω 𝑝 𝑝𝑖 𝑋 𝑚𝑖 𝑋𝑖 𝑊𝑖 Τ

    1 𝑝𝑖 𝑋𝑖 Ω𝑖 𝑋𝑖 𝑝𝑖 𝑓 𝑓 𝑌 𝑊𝑌
  17. • 𝑋𝑖 Ω𝑖 𝑊𝑖 ∈ ℝ Τ 1 𝑝𝑖 𝑋𝑖

    • 𝑓 Ω 𝑇𝑠 : Ω𝑠 → Ω 𝑋𝑠 ∈ Ω𝑠 Ω • Τ 𝜕𝑇𝑖 𝜕𝑥 • 𝑇𝑖 𝑤𝑖 = 𝑚𝑖 𝑇𝑖 𝑋𝑖 Ƹ 𝑝 𝑇𝑖 𝑋𝑖 𝑊𝑖 ∙ 𝜕𝑇𝑖 𝜕𝑋𝑖
  18. • • • 𝐱𝑖+1 − 𝐱𝑖 ≥ 𝑑𝑚𝑎𝑥 𝐱𝑖 ,

    𝐱𝑖+1 , 𝐲𝑖 𝑦𝑖+1 𝑥𝑖+1 𝑥𝑖+1 − 𝑦𝑖 ≥ 𝑑𝑚𝑎𝑥
  19. • 𝑖 𝑋𝑖 𝑡 𝑊 𝑋𝑖 𝑡 𝑌𝑖 𝑡−1 𝑋𝑖

    𝑡 𝑍𝑖 𝑗 𝑍𝑖 𝑍𝑗 𝑌𝑖 𝑡 𝑍𝑖 ≔ 𝑌𝑖 𝑡 𝐼𝑖 𝑡 ≈ 𝑓𝑖 𝑌𝑖 𝑡 𝑊 𝑌𝑖 𝑡 ※𝑌𝑖 𝑡−1を 𝑡 − 1 𝑖
  20. • LightingPasses::RenderDirectLighting() • ExecuteRayTracingPass(…, …, “GenerateInitialSamples”, …, …); • ExecuteRayTracingPass(…,

    …, “TemporalResampling”, …, …); • ExecuteRayTracingPass(…, …, “SpatialResampling”, …, …); • ExecuteRayTracingPass(…, …, “ShadeSamples”, …, …);
  21. • LightingPasses::RenderBrdfRays() • ExecuteRayTracingPass(…, …, “BrdfRayTracingPass”, …, …); • ExecuteRayTracingPass(…,

    …, “ShadeSecondarySurfaces”, …, …); • ExecuteRayTracingPass(…, …, “GITemporalResampling”, …, …); • ExecuteRayTracingPass(…, …, “GISpatialResampling”, …, …); • ExecuteRayTracingPass(…, …, “GIFinalShading”, …, …);
  22. • [Talbot 2005] Justin F. Talbot, Davit Cline, Parris Egbert,

    “Importance Resampling fo Global Illumination”, ESGR’05, pp.139-146, 2005 • [Bitterli 2020] Benedikt Bitterli, Chris Wyman, Matt Pharr, Peter Shirley, Aaron Lefohon, Wojciech Jarosz, “Spatiotemporal reservoir resampling for real-time ray tracing with dynamic direct lighting”, ACM Transactions on Graphics, Vol.39, No.4, 2020. • [Wyman 2021] Chris Wyman, Alexey Panteleev, “Rearchitecting Spatiotemporal Resampling for Production”, High-Performance Graphics 2021. • [Ouyang 2021] Y.Ouyang, S.Liu, M.Kettunen, M.Pharr, J.Pataleoni, “ReSTIR GI: Path Resampling for Real-Time Path Tracing”, High- Performance Graphics 2021. • [Lin 2022] Daqi Lin, Markus Kettunen, Benedikt Bitterli, Jacopo Pantaleoni, Cem Yukesel, Chris Wyman, “Generalized Resampled Importance Sampling”, SIGGRAPH 2022. • [Veach 1997] Eric Veach, “Robust Monte Carlo Methods for Light Transport Simulation”, Ph.D. dissertation, Standford University, 1997. • [Shocker 2022] Shocker, “ (Path Tracing)”, memoRANDOM, https://rayspace.xyz/CG/contents/path_tracing/, 2022. • [Pocol 2021] Pocol, “Direct3D 12 ”, , 2021. • [KiNaNkomoti 2022] KiNaNkomoti, “Pathtracing Caustics ”, 8 , 2022. • [Hirai 2022] , , “ 7 ”, CEDEC KUSYU 2022 • [NVIDIA 2023] NVIDIA, “ 2077 4 11 ”, https://www.nvidia.com/ja-jp/geforce/news/cyberpunk-2077-ray-tracing-overdrive-update-launches-april-11/, 2023. • [Capcom 2019] Capcom, “Devil May Cry5 Special Edition”, https://www.devilmaycry.com/5se/jp/, 2019. • [EmbarkStudios 2023] EmbarkStudios, “kajiya”, https://github.com/EmbarkStudios/kajiya, 2023. • [Halen 2021] Henrik Halen, Andres Brinck, Kyle Hayward, Xiangshun Bei, “Global Illumination Based on Surfels”, SIGGRAPH 2021 Advances in Real-Time Rendering in Games course, 2021. • [Boksansky 2021] Jakub Boksansky, Paula Jukarainen, Chris Wyman, “Rendering Many Lights With Grid-Based Reservoirs”, Ray Tracing Gems 2, Chapter 23, pp.351-365, 2021.