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
SDF を作りたかった
Search
Yuichi Sato
January 29, 2021
Programming
0
500
SDF を作りたかった
Blender で作成したベクトル場を Unity で利用する
https://qiita.com/YuichiSato/items/bc160896b5883f1a125b
Yuichi Sato
January 29, 2021
Tweet
Share
More Decks by Yuichi Sato
See All by Yuichi Sato
深層学習学習中
satoyuichi
0
33
深層学習はじめました
satoyuichi
0
48
瞑想アプリ
satoyuichi
0
44
初めての iPhone ネイティブアプリ
satoyuichi
0
59
キャンフェスにゲームを出そう -StruckOut 編-
satoyuichi
0
23
ミクちゃんが歌ったら 家に帰ろう
satoyuichi
0
17
体温記録送信アプリ
satoyuichi
0
21
コロナ横目にバージョンアップ
satoyuichi
0
75
本日のシェーダー芸
satoyuichi
1
700
Other Decks in Programming
See All in Programming
Oxlintはいいぞ
yug1224
5
1.4k
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
6
660
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
630
生成AIを活用したソフトウェア開発ライフサイクル変革の現在値
hiroyukimori
PRO
0
100
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
Apache Iceberg V3 and migration to V3
tomtanaka
0
170
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
990
AI時代の認知負荷との向き合い方
optfit
0
160
Oxlint JS plugins
kazupon
1
1k
CSC307 Lecture 09
javiergs
PRO
1
840
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Navigating Weather and Climate Data
rabernat
0
110
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
200
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
430
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Site-Speed That Sticks
csswizardry
13
1.1k
Designing for humans not robots
tammielis
254
26k
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)