Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ray Tracing in 5 minutes
Search
yumcyawiz
September 07, 2017
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ray Tracing in 5 minutes
Slide for OSK 2017 Summer Lightning Talk.
yumcyawiz
September 07, 2017
Transcript
86 slides
Ray Tracing in 5 minutes
レイトレーシング(Ray Tracing)とは?
None
超リアル!!!
どうやって生成するのか
None
光が目に届くまで
光が目に届くまで
光が目に届くまで 反射
でも目に届く光はごくわずか
逆から追跡する
逆から追跡する レイ(Ray)
逆から追跡する レイ(Ray) レイ(Ray)
None
画像にする スクリーン
画像にする スクリーン
画像にする スクリーン
画像にする
必要なもの レイと物体の衝突判定
レイの数学的表現 始点 方向
Ԧ Ԧ レイの数学的表現
Ԧ Ԧ レイの数学的表現
Ԧ レイの数学的表現 Ԧ + Ԧ
球のベクトル方程式 Ԧ − Ԧ 2 = 2 Ԧ Ԧ
レイが球面上にあるとき Ԧ = Ԧ + Ԧ
レイが球面上にあるとき Ԧ = Ԧ + Ԧ Ԧ + Ԧ −
Ԧ 2 = 2 Ԧ + Ԧ − Ԧ ⋅ ( Ԧ + Ԧ − Ԧ ) = 2 ⋮ 最終的にtに関する2次方程式
代数的な計算で衝突点が求まる
ポリゴンの場合 三角形の集合で表される
ポリゴンの場合 すべての三角形と衝突計算を行う
計算が重い!!!
最適化手法 ・空間分割法 ・BVH(Bounding Volume Hierarchy)
もっと簡単な方法はないのか?
レイマーチング
レイマーチング
レイマーチング
レイマーチング
レイマーチング
レイマーチング 衝突
計算量が増えるが、複雑な形状を 簡単に扱える
こんなことできます
こんなことできます
興味のある方は→
Physically Based Rendering
物理的に正しく光の強さを計算する
写真のようにリアルな画像が生成できる
光の強さとは?
光の強さ = 光子の数
放射束Φ Φ = ある領域を単位時間に通過する光子の数
カメラのセンサー 画素が受け取る光子 = 放射束×露光時間
カメラのセンサー 画素に入ってくる放射束が分 かればよい
放射束面密度 = Φ ある一点を単位時間に通過する光子の数
放射輝度 = 2Φ cos ある一点にある方向から単位時間に来る 光子の数
カメラのセンサー 半球に渡って放射輝度を積分して放射束面密 度を得る = න Ω , cos
カメラのセンサー 一画素の全範囲に渡って放射束面密度を 積分して放射束を得る Φ = න න Ω (, )
cos
めっちゃ数値積分する
数値積分 I =
数値積分 () 等間隔で点をサンプリングする
数値積分 () 短冊部分を足し合わせる
高次元だとサンプリング 数が爆発的に増える
モンテカルロ積分
確率的にサンプリング点 を生成する
モンテカルロ積分 () 確率密度( )でサンプリング点を生成 1 2 3 4 5 6
モンテカルロ積分 () 一様分布なら = − 1 2 3 4 5
6
モンテカルロ積分 () = σ= () () で計算できる 1 2 3
4 5 6
カメラのセンサー 確率密度 で画素に点 をサンプリング 一画素の面積
カメラのセンサー 確率密度 で方向をサンプ リング 半球全体
カメラのセンサー 一画素を通過する放射束が計算できる = = ( ) = ,
cos ( )
カメラのセンサー = = ( ) = , cos
( ) サンプリング数を増やすと近似精度が上がる
モンテカルロ積分の問題点
モンテカルロ積分の問題点 収束が遅い
モンテカルロ積分の問題点 サンプリング数をとすると に比例
モンテカルロ積分の問題点 サンプリング数を100倍にしても10倍の 精度向上しか見込めない
カメラのセンサー = = ( ) = , cos
( ) ( , )を計算する必要がある
None
入射放射輝度の計算 ( , )
入射放射輝度の計算 ( , ) どれだけの光が反射されるのか?
双方向反射率分布関数(BRDF) (, , )
双方向反射率分布関数(BRDF) (, , ) 入射光が出射方向にどれだけ反射されるかを表す
反射される放射輝度 , = න , , (, ) cos
反射される放射輝度 , = න , , (, ) cos が発光している場合も加えると
レンダリング方程式(LTE) , = , + න , , (, )
cos Physically Based Renderingで最も重要な式 発光 反射光
レンダリング方程式(LTE) , = , + න , , (, )
cos この方程式をモンテカルロ積分でひたすら解く
レンダリング方程式を解くことでリアルな画像が得られる
この続きを知りたい方は
#ρ-rayに入ろう!!!
ありがとうございました
More Decks by yumcyawiz
See All by yumcyawiz
rtcamp 10 (vk-illuminati)
yumcyawiz
1
580
ReSTIRの数理と実装 (rtcamp10)
yumcyawiz
1
2.1k
fredholm(rtcamp9)
yumcyawiz
0
190
フォトンマッピングをパス空間から考える
yumcyawiz
0
580
fredholm
yumcyawiz
0
370
Introduction to volume rendering
yumcyawiz
0
2.9k
OSK#p-ray2020年度講義: 古典的レイトレーサーの実装
yumcyawiz
0
320
Ray Tracing: Overview
yumcyawiz
7
1.4k
GLSLでパストレーシングしてコーネルボックスを出す
yumcyawiz
0
650
Other Decks in Programming
See All in Programming
ActionController meets Protocol Buffers
sorah
1
800
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
5.5k
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.8k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
300
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
170
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
430
Spec-driven Development with AI
simas
PRO
0
2.3k
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
240
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
370
はじめてのPLATEAU
nokonoko1203
1
640
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
980
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
480
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
The Language of Interfaces
destraynor
162
27k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
HDC tutorial
michielstock
2
1k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Balancing Empowerment & Direction
lara
6
1.4k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Scaling GitHub
holman
464
140k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350