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
SDF を作りたかった
Search
Yuichi Sato
January 29, 2021
Programming
550
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SDF を作りたかった
Blender で作成したベクトル場を Unity で利用する
https://qiita.com/YuichiSato/items/bc160896b5883f1a125b
Yuichi Sato
January 29, 2021
More Decks by Yuichi Sato
See All by Yuichi Sato
深層学習学習中
satoyuichi
0
53
深層学習はじめました
satoyuichi
0
59
瞑想アプリ
satoyuichi
0
53
初めての iPhone ネイティブアプリ
satoyuichi
0
69
キャンフェスにゲームを出そう -StruckOut 編-
satoyuichi
0
33
ミクちゃんが歌ったら 家に帰ろう
satoyuichi
0
25
体温記録送信アプリ
satoyuichi
0
32
コロナ横目にバージョンアップ
satoyuichi
0
87
本日のシェーダー芸
satoyuichi
1
800
Other Decks in Programming
See All in Programming
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
210
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
160
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
240
デプロイ直後のレイテンシスパイクを調べたら、 Railsの仕様にたどり着いた
nhsykym
0
120
アクセシビリティから考える情報設計
high_g_engineer
0
370
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
450
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
150
iOSDC2026登壇資料.pdf
riofujimon
0
120
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
960
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
370
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
480
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.2k
Bash Introduction
62gerente
615
220k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Balancing Empowerment & Direction
lara
6
1.3k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
We Are The Robots
honzajavorek
0
370
30 Presentation Tips
portentint
PRO
1
390
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Between Models and Reality
mayunak
4
450
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
520
Transcript
SDF を作りたかった 2020年12月24日 佐藤雄一
自己紹介 名前:佐藤 雄一 好物:エレキギター、(初期)仏教、Smalltalk Twitter:@satoyuichi80 趣味:読書、ギター演奏、映画鑑賞 最近好きなTV番組: 「サンドウィッチマン& 芦田愛菜の博士ちゃん」
目的 Unity の Visual Effect Graph で使う SDF データを作るため。下の画像の Teapot
の ように形状を表現するための 3D テクスチャを生成したかった。
Signed Distance Field(SDF)とは 内側で負、境界でゼロ、外側で正となり、形状表面からの距離を示す。これを二次元 や三次元テクスチャとして持ち、形状を表現する。 出所)https://niteeshyadav.com/blog/the-current-state-of-the-text-in-augmented-reality-7507/
が、しかし 手持ちのソフトで SDF を手軽に出力する方法がないようなので、ひとまず Blender で ベクトル場を作って、Unity にインポートすることにした。 SDF とベクトル場の違いは各ボクセルにスカラー値を持つか、ベクトル値を持つかな
ので、どちらかで対応できればもう片方にも適用できるはずと判断した。
Unity で .vf ファイルがインポートできることがわかったので、Blender のアドオンと組 み合わせて以下の順序で生成することにした。 生成順序 .fga をエクスポート (C
で作ったコンバータで ) .fga を .vf に変換 .vf を出力 Unity にインポート Blender でベクトル場を生成
Blender で作ったベクトル場 中心に吸い込み型の力場を作って、その力の方向を各ボクセルに記録しているよう す。
.fga ファイルの構造 Blender のアドオンを使ってベクトル場を作り .fga ファイルをエクスポートする。.fga ファイルはアスキー形式で、以下のような構造になっている。 分割数 X Y
Z BBox 最小値 X 座標 Y 座標 Z 座標 BBox 最大値 X 座標 Y 座標 Z 座標 Vector X 値 Y 値 Z 値 ...
.vf ファイルの構造 .vf ファイルはバイナリ形式で以下のような構造になっている。 • Float(用途:SDF) • Vector(用途:Vector Field, Vector
Gradient Field) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 FourCC(VF_V) X 分割数 Y 分割数 Z 分割数 ベクトル値(float, float, float) ... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 FourCC(VF_F) X 分割数 Y 分割数 Z 分割数 スカラー値 ...
結果
今後の展望 • Blender で SDF を作るアドオンを開発する • Blender で VGF(Vector
Gradient Field)を作るアドオンを開発する …が、すでにある気がする(調べた限りではないけど
参考資料 • Qiita(https://qiita.com/YuichiSato/items/bc160896b5883f1a125b) • Blender - FGA Vector Field Editor(https://github.com/isathar/Blender_UE4_VectorFieldEditor)
• VF : VectorField file format(https://github.com/peeweek/VectorFieldFile/blob/master/README.md) • fga2vf(https://github.com/satoyuichi/fga2vf)