SlideShare a Scribd company logo
@kamitani_08
https://youtu.be/RunOyTHt0nk
公開は2月初旬を予定してます!
レイマーチング使います
10m離れてる!
10m進行!
30cm進行!
10cm進行!
当たってます!!
float ReturnValue= 0.0;
for(int i = 0; i < MaxSteps; i++)
{
float distance = length(Position) -Length;
if(d < 0.001)
{
ReturnValue = 1.0;
break;
}
Position += RayDirection * distance ;
}
return ReturnValue;
最大ループ数
レイの開始点
オブジェクトからカメラへの相対座標
レイの進行方向
CameraVector * -1 してレイの進行方向を算出
球の半径
Opacity = 不透明度
float ReturnValue= 0.0;
for(int i = 0; i < MaxSteps; i++)
{
float distance = length(Position) -Length;
if(d < 0.001)
{
ReturnValue = 1.0;
break;
}
Position += RayDirection * distance ;
}
return ReturnValue;
float ReturnValue= 0.0;
for(int i = 0; i < MaxSteps; i++)
{
float distance = length(Position) -Length;
if(d < 0.001)
{
ReturnValue = 1.0;
break;
}
Position += RayDirection * distance ;
}
return ReturnValue;
原点からレイの開始位置への距離が
球の半径より近いかチェック
float ReturnValue= 0.0;
for(int i = 0; i < MaxSteps; i++)
{
float distance = length(Position) -Length;
if(d < 0.001)
{
ReturnValue = 1.0;
break;
}
Position += RayDirection * distance ;
}
return ReturnValue;
上記計算結果で近ければ不透明に。
遠ければ座標を進行方向に進める
float ReturnValue= 0.0;
for(int i = 0; i < MaxSteps; i++)
{
float distance = length(Position) -Length;
if(d < 0.001)
{
ReturnValue = 1.0;
break;
}
Position += RayDirection * distance ;
}
return ReturnValue;
この処理をMaxSteps分繰り返します
https://youtu.be/R5EpPNpiY10
• 疑似的に影をつける
• 潜れるようにする
• あたり判定をつける
にわとりだからわかんない
うすい!
濃い!
float ReturnValue= 0.0;
for(int i = 0; i < MaxSteps; i++)
{
float distance = length(Position) -Length;
if(d < 0.001)
{
ReturnValue = 1.0;
break;
}
Position += RayDirection * distance ;
}
return ReturnValue;
(距離関数の結果*-1) - ノイズの値
ノイズなし ノイズあり
小 大
• 雲のモデリング
• 出来た雲に疑似影をつける
• 潜れるようにする
• あたり判定をつける
なし あり
• 雲のモデリング
• 出来た雲に疑似影をつける
• 潜れるようにする
• あたり判定をつける
https://youtu.be/iykkioiqlNU
• 雲のモデリング
• 出来た雲に疑似影をつける
• 潜れるようにする
• あたり判定をつける
これ
たりない…
たりないなら延ばせばいいじゃない!
・・・
かなり無駄な処理が走ってる
ここからレイマーチングを開始
10Steps 20Steps
30Steps 200Steps
https://www.shadertoy.com/
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
https://cedil.cesa.or.jp/cedil_sessions/view/1919
https://shaderbits.com/blog/creating-volumetric-ray-marcher
https://www.youtube.com/watch?v=yblxol_eCc4
公開は2月初旬を予定!
新大阪UE4勉強会#1 鶏でも出来た雲の潜り方

More Related Content

Recently uploaded

RaySheet Product Description Documentation - 2024.6.19
RaySheet Product Description Documentation - 2024.6.19RaySheet Product Description Documentation - 2024.6.19
RaySheet Product Description Documentation - 2024.6.19
GrapeCity, inc.
 
シグネチャで始めるRustプログラミング - Superteam Japan Developer Event
シグネチャで始めるRustプログラミング - Superteam Japan Developer Eventシグネチャで始めるRustプログラミング - Superteam Japan Developer Event
シグネチャで始めるRustプログラミング - Superteam Japan Developer Event
K Kinzal
 
Bhyve Management Daemon Version 3.0 on FreBSD
Bhyve Management Daemon Version 3.0 on FreBSDBhyve Management Daemon Version 3.0 on FreBSD
Bhyve Management Daemon Version 3.0 on FreBSD
Yuichiro Naito
 
RaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet Documentation
RaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet DocumentationRaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet Documentation
RaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet Documentation
GrapeCity, inc.
 
RayBarcode Product Description Documentation - 2024.6.19
RayBarcode Product Description Documentation - 2024.6.19RayBarcode Product Description Documentation - 2024.6.19
RayBarcode Product Description Documentation - 2024.6.19
GrapeCity, inc.
 
クラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdf
クラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdfクラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdf
クラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdf
TatsuyaHanayama
 
Solanaで始めるRustプログラミング - Superteam Japan Developer Event
Solanaで始めるRustプログラミング - Superteam Japan Developer EventSolanaで始めるRustプログラミング - Superteam Japan Developer Event
Solanaで始めるRustプログラミング - Superteam Japan Developer Event
K Kinzal
 
RayPen Product Description Documentation - 2024.6.19
RayPen Product Description Documentation - 2024.6.19RayPen Product Description Documentation - 2024.6.19
RayPen Product Description Documentation - 2024.6.19
GrapeCity, inc.
 

Recently uploaded (8)

RaySheet Product Description Documentation - 2024.6.19
RaySheet Product Description Documentation - 2024.6.19RaySheet Product Description Documentation - 2024.6.19
RaySheet Product Description Documentation - 2024.6.19
 
シグネチャで始めるRustプログラミング - Superteam Japan Developer Event
シグネチャで始めるRustプログラミング - Superteam Japan Developer Eventシグネチャで始めるRustプログラミング - Superteam Japan Developer Event
シグネチャで始めるRustプログラミング - Superteam Japan Developer Event
 
Bhyve Management Daemon Version 3.0 on FreBSD
Bhyve Management Daemon Version 3.0 on FreBSDBhyve Management Daemon Version 3.0 on FreBSD
Bhyve Management Daemon Version 3.0 on FreBSD
 
RaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet Documentation
RaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet DocumentationRaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet Documentation
RaySheetで解決できるシナリオ10選-業務改善に貢献する機能 - RaySheet Documentation
 
RayBarcode Product Description Documentation - 2024.6.19
RayBarcode Product Description Documentation - 2024.6.19RayBarcode Product Description Documentation - 2024.6.19
RayBarcode Product Description Documentation - 2024.6.19
 
クラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdf
クラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdfクラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdf
クラウドネイティブにおけるセキュアなソフトウェア・サプライ・チェーンの考え方とベストプラクティス.pdf
 
Solanaで始めるRustプログラミング - Superteam Japan Developer Event
Solanaで始めるRustプログラミング - Superteam Japan Developer EventSolanaで始めるRustプログラミング - Superteam Japan Developer Event
Solanaで始めるRustプログラミング - Superteam Japan Developer Event
 
RayPen Product Description Documentation - 2024.6.19
RayPen Product Description Documentation - 2024.6.19RayPen Product Description Documentation - 2024.6.19
RayPen Product Description Documentation - 2024.6.19
 

Featured

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

新大阪UE4勉強会#1 鶏でも出来た雲の潜り方