Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
レイトレーシング入門
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shirotsu
November 03, 2018
2
400
レイトレーシング入門
2018 秋の会津大LTで話させていただいたトピックです。
Shirotsu
November 03, 2018
Tweet
Share
Featured
See All Featured
The Curious Case for Waylosing
cassininazir
0
240
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
76
Documentation Writing (for coders)
carmenintech
77
5.3k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
940
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
So, you think you're a good person
axbom
PRO
2
1.9k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Transcript
レイトレーシング 入門してみた by Shirotsu
佐藤利音 s1250010 HN : Shirotsu Twitter @4rotsugd Github @Nao-Shirotsu 自己紹介
レイトレーシング レンダリング手法の一つ
やろうと思ったきっかけ
CGって実際何を どうやってるんだ...? Shirotsu
色々あって... こういうの あるよ パストレ 強い人
パストレーシング レイトレーシングから派生した 1つのレンダリング手法 基本的な考え方は一緒......らしい
コーネルボックス CG界のHello World ? これの描画に挑戦 プリレンダリング
大体の流れ
光源 光線(Ray)の反射 「光源からの光が物体に 反射して目に入ってくる」 という現実の考え方を再現
光源 光線(Ray)の反射 カメラから逆に 光の軌跡を追跡
光源 光線(Ray)の反射 全ての点からの 光を計算する
光源 光線(Ray)の反射 スクリーン これが画像として 出力される
光線(Ray)の反射 現実 無数の反射した光線が 光源から目に届いている コンピュータ 無数はムリ!!
光線(Ray)の反射 無数が無理なら... ランダムに光線を 反射させてデータを 集めてしまえ!
光線(Ray)の反射 無数が無理なら... ランダムに光線を 反射させてデータを 集めてしまえ! パストレーシング
パストレーシング 光源 A B C カメラから発したRayが 何かと交差したとき、 その交点から新しく複数のRayを ランダムな方向に飛ばす
パストレーシング 光源 A B C 新しいRayたちの平均を取って... また交差したら平均を取って... 繰り返し Average Ray
= ( A + B + C ) / 3
パストレーシング 光源 A B C 実は割と嘘ですが大体合ってるはず... 説明が下手なので許してください
改めてコーネルボックス • Rayは直線で表現できる • 球と直線の交差判定は簡単 (高校数学) というわけでこんな感じです
コーネルボックス x y 球 球 球 球 光源
コーネルボックス z y 球 球 球 球 球 光源
コード
コード
結果...... 正面 別アングル
結構粗い Rayはランダムに反射 -> サンプリング回数を増やさないと綺麗にならない これのレンダリングに 3時間かかりました;;
一応GitHubに置いておきました https://github.com/Nao-Shirotsu/PathTracing_CornellBoxRenderer C++コンパイラだけで実行できるので よかったら試してみてください
振り返り • 光の物理量の計算がしんどかった -> 計算式を理解するのが辛い(数学アレルギー) • GoogleTestでTDDっぽい開発をやってみた -> いつもより明らかにバグが少なくて楽
ありがとうございました by Shirotsu ID : 10006