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

コンピュータグラフィクスの空

Fadis
December 02, 2023

 コンピュータグラフィクスの空

2020年にEpic GamesのSébastien Hillaire氏が発表した論文「A Scalable and Production Ready Sky and Atmosphere Rendering Technique」を実装してみます
これは2023年12月2日に行われた Kernel/VM探検隊@北陸 Part 6 での発表資料です

発表動画: https://youtu.be/YrQ4ACuvM68
ソースコード: https://github.com/Fadis/gct/tree/kernelvm_20231202

Fadis

December 02, 2023
Tweet

More Decks by Fadis

Other Decks in Programming

Transcript

  1. Lscat (c, x, v) = T (c, x) σs (x)

    p (v, li) T (x, x + tatmo li) Ei ͜ͷܦ࿏Ͱ ੜ͡Δٵऩͱ ग़ࢄཚ ͜͜ʹಧ͍ͨޫͷ͏ͪ ೖࢄཚͰࢹ఺ͷํ޲ʹ ޲͖Λม͑Δޫͷׂ߹ ͜ͷܦ࿏Ͱੜ͡Δ ٵऩͱग़ࢄཚ ඈΜͰ͖ͨ ޫͷΤωϧΪʔ v : li : ||c − x|| ଠཅͷ޲͖ x + tatmo li : ඪߴ100kmͷ໘ͱ ํ޲ʹ৳͹ͨ͠ ௚ઢͷަ఺ li c x
  2. T(xa , xb ) = e−∫xb x=xa σt (x)||dx|| ϥϯϕϧτɾϕʔϧͷ๏ଇ

    ֤఺Ͱͷޫͷ௨Γ΍͢͞ Λޫ͕௨Δܦ࿏Ͱੵ෼ σt (x) ͦͷ஋͕େ͖͍ఔಁաͰ͖ΔޫͷΤωϧΪʔ͸খ͘͞ͳΔ Lscat (c, x, v) = T (c, x) σs (x) p (v, li) T (x, x + tatmo li) Ei
  3. σr (x) = 5.802 × 10−6 13.558 × 10−6 33.1

    × 10−6 e− ||x|| − 6.36 × 106 8 × 103 ||x|| 6.36 × 106m 1ؾѹͷۭؾதͰ ޫ͕ۭؾΛߏ੒͢Δ ෼ࢠͱͿ͔ͭͬͯ ग़ࢄཚ͢Δׂ߹ ߴ౓ ߴ౓͕ߴ͘ͳΔఔ ۭؾͷີ౓͕Լ͕Δ x ۭؾதͷ෼ࢠʹΑΔ ग़ࢄཚ
  4. σm (x) = (3.996 × 10−6 + 4.40 × 10−6)

    e− ||x|| − 6.36 × 106 1.2 × 103 6.36 × 106m ߴ౓͕ߴ͘ͳΔͱ ۭؾதΛඬ͏ཻࢠͷྔ͸ٸ଎ʹݮΔ ۭؾதΛඬ͏ཻࢠʹΑΔ ग़ࢄཚͱٵऩ ग़ࢄཚ ٵऩ ||x|| x
  5. 6.36 × 106m ΦκϯʹΑΔޫͷٵऩ ||x|| x σo (x) = 0.650

    × 10−6 1.881 × 10−6 0.085 × 10−6 max ( 0,1 − |(||x|| − 6.36 × 106) − 25 × 103 | 15 × 103 ) ٵऩ ߴ౓25kmΛϐʔΫͱ͢Δ ্Լ֤15kmͷൣғ
  6. T(xa , xb ) = e−∫xb x=xa σt (x)||dx|| σt

    (x) = σr (x) σm (x) σo (x) σr (x) = 5.802 × 10−6 13.558 × 10−6 33.1 × 10−6 e− ||x|| − 6.36 × 106 8 × 103 σm (x) = (3.996 × 10−6 + 4.40 × 10−6) e− ||x|| − 6.36 × 106 1.2 × 103 σo (x) = 0.650 × 10−6 1.881 × 10−6 0.085 × 10−6 max ( 0,1 − |(||x|| − 6.36 × 106) − 25 × 103 | 15 × 103 ) Lscat (c, x, v) = T (c, x) σs (x) p (v, li) T (x, x + tatmo li) Ei
  7. σs (x) = 5.802 × 10−6 13.558 × 10−6 33.1

    × 10−6 p (v, li) = 3 (1 + (v ⋅ li) 2 ) 16π ۭؾΛߏ੒͢Δ෼ࢠʹΑΔࢄཚ(ϨΠϦʔࢄཚ) Lscat (c, x, v) = T (c, x) σs (x) p (v, li) T (x, x + tatmo li) Ei
  8. σs (x) = 5.802 × 10−6 13.558 × 10−6 33.1

    × 10−6 p (v, li) = 3 (1 + (v ⋅ li) 2 ) 16π ۭؾΛߏ੒͢Δ෼ࢠʹΑΔࢄཚ(ϨΠϦʔࢄཚ) σs (x) = 3.996 × 10−6 p (v, li) = 3 8π (1 − g2) (1 + (v ⋅ li) 2 ) (2 + g2) (1 + g2 − 2g (v ⋅ li)) 3 2 ۭؾதΛඬ͏ཻࢠʹΑΔग़ࢄཚͱٵऩ(ϛʔࢄཚ) g = 0.8 Lscat (c, x, v) = T (c, x) σs (x) p (v, li) T (x, x + tatmo li) Ei ϔχΤΠɾάϦʔϯελΠϯؔ਺
  9. Lscat (c, x, v) = T (c, x) T (x,

    x + tatmo li) σs (x) p (v, li) Ei L (c, v) = ∫ ||p−c|| t=0 Lscat (c, c − tv, v) dt c 100km p ͜ͷઢ෼ʹԊͬͯੵ෼
  10. Lscat (c, x, v) = T (c, x) T (x,

    x + tatmo li) σs (x) p (v, li) Ei T(xa , xb ) = e−∫xb x=xa σt (x)||dx|| σt (x) = σr (x) σm (x) σo (x) σr (x) = 5.802 × 10−6 13.558 × 10−6 33.1 × 10−6 e− ||x|| − 6.36 × 106 8 × 103 σm (x) = (3.996 × 10−6 + 4.40 × 10−6) e− ||x|| − 6.36 × 106 1.2 × 103 L (c, v) = ∫ ||p−c|| t=0 Lscat (c, c − tv, v) dt ਺஋ੵ෼ͷ਺஋ੵ෼͸ ϦΞϧλΠϜϨϯμϦϯάʹ͸ਏ͍
  11. ଠཅ͔Β ʹࢸΔޫͷಁա཰ xa 1 − ( 1 − θ θmax

    ) 2 1 − (1 − h 1 × 105 ) 2 ଠཅͱ Λ݁Ϳ௚ઢ͕஍໘ʹ઀͢Δ֯౓ xa
  12. θ ϕ θ ϕ π 2 − π 2 0

    2π ͳΜ͔ബ҉͍
  13. σr (x) = 5.802 × 10−6 13.558 × 10−6 33.1

    × 10−6 e− ||x|| − 6.36 × 106 8 × 103 ग़ࢄཚ͔͠ແ͍ ۭؾதͷ෼ࢠʹΑΔٵऩ͸ແࢹͰ͖Δ΄Ͳখ͍͞ ࢄཚͨ͠ޫ͸ ຆͲΤωϧΪʔΛࣦΘͣʹ ࢄཚΛ܁Γฦ͢ ͦͷ͏ͪزΒ͔͸ࢹ఺ʹಧ͘ ϚϧνεΩϟολϦϯάͷӨڹ͕ ແࢹ͢Δʹ͸େ͖͗͢Δ
  14. L2 (xs , p) = ∫ Ω4π L′  (xs

    , p, − ω) 1 4π dω L′  (x, p, v) = ∫ ||p−x|| t=0 T (x, x − tv) σs (x) 1 4π T (x, x + tatmo li) dt શͯͷ޲͖͔Βͷ2࣍ͷೖࢄཚ c x
  15. L2 (xs , p) = ∫ Ω4π L′  (xs

    , p, − ω) 1 4π dω L′  (x, p, v) = ∫ ||p−x|| t=0 T (x, x − tv) σs (x) 1 4π T (x, x + tatmo li) dt શͯͷ޲͖͔Βͷ2࣍ͷೖࢄཚ c x ∫ D 0 e−σt xSdx = S − Se−σt D σt Λ࢖ͬͯ Λղੳతʹղ͘ L′ 
  16. fms (xs , p) = ∫ Ω4π Lf (xs ,

    p, − ω) 1 4π dω Lf (x, p, v) = ∫ ||p−x|| t=0 T (x, x − tv) σs (x) dt Fms (x, p) = 1 1 − fms (x, p) ψms (x, p) = L2 (x, p) Fms (x, p) L2 (xs , p) = ∫ Ω4π L′  (xs , p, − ω) 1 4π dω L′  (x, p, v) = ∫ ||p−x|| t=0 T (x, x − tv) σs (x) 1 4π T (x, x + tatmo li) dt શͯͷ޲͖͔Βͷ2࣍ͷೖࢄཚ શͯͷ޲͖͔Βͷ 2͔࣍Β ࣍·Ͱͷೖࢄཚ ∞ ∫ D 0 e−σt xSdx = S − Se−σt D σt ͜Ε΋ Ͱղ͘ ͜͜ʹ2࣍ͷೖࢄཚ͕ՃΘΔͱ͢Δͱ ઴ԽࣜʹͳΔ
  17. Lscat (c, x, v) = T (c, x) σs (x)

    p (v, li) T (x, x + tatmo li) Ei + ψms (x, li) Ei ͜ͷܦ࿏Ͱ ੜ͡Δٵऩͱ ग़ࢄཚ ͜͜ʹಧ͍ͨޫͷ͏ͪ ೖࢄཚͰࢹ఺ͷํ޲ʹ ޲͖Λม͑Δޫͷׂ߹ ͜ͷܦ࿏Ͱੜ͡Δ ٵऩͱग़ࢄཚ c x ෳ਺ճࢄཚͯ͠ ʹͨͲΓண͘෼ x