December 02, 2023
1.9k

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

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

December 02, 2023

## Transcript

17. ### 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
18. ### 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

20. ### σ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 ۭؾதͷ෼ࢠʹΑΔ ग़ࢄཚ
21. ### σm (x) = (3.996 × 10−6 + 4.40 × 10−6)

e− ||x|| − 6.36 × 106 1.2 × 103 6.36 × 106m ߴ౓͕ߴ͘ͳΔͱ ۭؾதΛඬ͏ཻࢠͷྔ͸ٸ଎ʹݮΔ ۭؾதΛඬ͏ཻࢠʹΑΔ ग़ࢄཚͱٵऩ ग़ࢄཚ ٵऩ ||x|| x
22. ### 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ͷൣғ
23. ### 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
24. ### σ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
25. ### σ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 ϔχΤΠɾάϦʔϯελΠϯؔ਺
26. ### 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 ͜ͷઢ෼ʹԊͬͯੵ෼
27. ### 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 ਺஋ੵ෼ͷ਺஋ੵ෼͸ ϦΞϧλΠϜϨϯμϦϯάʹ͸ਏ͍
28. ### 100km ߴ౓h ఱ௖ͱଠཅͷ ͳ֯͢θ ͸ ͱ ͚ͩͰܾ·Δ e−∫xb x=xa σt

(x)||dx|| θ h xa xb
29. ### ଠཅ͔Β ʹࢸΔޫͷಁա཰ xa 1 − ( 1 − θ θmax

) 2 1 − (1 − h 1 × 105 ) 2 ଠཅͱ Λ݁Ϳ௚ઢ͕஍໘ʹ઀͢Δ֯౓ xa

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

× 10−6 e− ||x|| − 6.36 × 106 8 × 103 ग़ࢄཚ͔͠ແ͍ ۭؾதͷ෼ࢠʹΑΔٵऩ͸ແࢹͰ͖Δ΄Ͳখ͍͞ ࢄཚͨ͠ޫ͸ ຆͲΤωϧΪʔΛࣦΘͣʹ ࢄཚΛ܁Γฦ͢ ͦͷ͏ͪزΒ͔͸ࢹ఺ʹಧ͘ ϚϧνεΩϟολϦϯάͷӨڹ͕ ແࢹ͢Δʹ͸େ͖͗͢Δ

࣍ݩ͕େ͖͗͢Δ y

y

38. ### 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
39. ### 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′ ￼
40. ### 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࣍ͷೖࢄཚ͕ՃΘΔͱ͢Δͱ ઴ԽࣜʹͳΔ
41. ### 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