Omniverse とは
Omniverse は、Wikipedia によると、概念上可能なすべての宇宙の集合だそうです。
この世界には、個別の物理法則を持った宇宙が複数存在して、それらすべての宇宙の集合を Omniberse と呼ぶようで、以下のような階層のようです。
Universe < Multiverse < Metaverse < Xenoverse < Omniverse
これはおいといて
Nvidia の Omniverse とは
NVIDIA Omniverse™ は、API、SDK、サービスのプラットフォームであり、開発者は、産業およびロボティクスのユース ケース向けに OpenUSD、NVIDIA RTX™ レンダリング技術、生成フィジカル AI を既存のソフトウェア ツールおよびシミュレーション ワークフローに統合することができます。
よく分からん
動かしてみて分かったこと
試しに、Omniverse Kit App Template 以下を色々動かしてみて、ちょっと理解が進みました。
Unity と比較してみたいと思います。
Unity の場合は、Unity Editor を起動すると以下のような画面が出て、
Build すると、実行可能なアプリが作成されます。
以下のようなイメージです。
一方、Omniverse Kit App Template で、USD Composer を作成して立ち上げると、以下のような画面が出てきます。
なるほど、ここで開発して Build すればアプリができるのか、と思ってやってみると、作成されるのは USD という形式のファイルでこれは実行可能なアプリではありません。
一方、Omniverse Kit App Template の USD Viewer というものがあるので、それを試してみると、USD 形式のファイルを表示するアプリができました。
どうも以下のような感じみたいです。
USD Composer と USD Viewer はどちらも Omniverse の Kit SDK から作成されたアプリで、USD Composer が Unity Editor に相当して App が USD Viewer に相当すると思います。
どちらも USD を扱うアプリであり、Omniverse は USD を扱うアプリを作成するためのプラットフォームだという理解で良さそう (USD が何たるかはまだ分かってないですが)。
今回やったこと
前準備
git clone
git clone https://github.com/NVIDIA-Omniverse/kit-app-template.git
cd kit-app-template
USD Composer の 作成
Select desired template で USD Composer を指定して、template を作成します。
$ ./repo.sh template new
[CTRL+C to Exit]
? Select what you want to create with arrow keys ↑↓: Application>
? Select desired template with arrow keys ↑↓: [omni_usd_composer]: USD Composer
? Enter name of application .kit file [name-spaced, lowercase, alphanumeric]: my_company.my_usd_composer
? Enter application_display_name: My USD Composer
? Enter version: 0.1.0
The application template you have selected requires a setup extension.
Setup Extension -> omni_usd_composer_setup
Configuring extension template: Omni USD Composer Setup
? Enter name of extension [name-spaced, lowercase, alphanumeric]: my_company.my_usd_composer_setup_extension
? Enter extension_display_name: My USD Composer Setup Extension
? Enter version: 0.1.0
Extension 'my_company.my_usd_composer_setup_extension' created successfully in /home/ubuntu/Sources/kit-app-template_test/source/extensions/my_company.my_usd_composer_setup_extension
Application 'my_company.my_usd_composer' created successfully in /home/ubuntu/Sources/kit-app-template_test/source/apps/my_company.my_usd_composer.kit
The application template you have selected has optional linked applications and layers.
? Do you want to add application layers? No
実行すると source/apps/my_company.my_usd_composer.kit ができます。
中を見てみると、[dependencies] の所に USD Composer を構成する Extensions が色々書かれているみたい。
[dependencies]
"omni.activity.ui" = {}
"omni.activity.usd_resolver" = {}
...
ビルドします。
$ ./repo.sh build
USD Composer を起動して USD を作成
./repo.sh launch を実行し、作成した ApplicationTemplate を選択すると Window が立ち上がります。
$ ./repo.sh launch
[ctrl+c to Exit]
? Select with arrow keys which App you would like to launch:
ApplicationTemplate
#################################################################################
❯ my_company.my_usd_composer.kit
Create > Shape で適当にオブジェクトを追加して USD を保存。
USD Viewer の作成
Select desired template で USD Viewer を指定して、template を作成します。
後で使うので、ApplicationLayer で Omniverse Kit App Streaming を選択します。
$ ./repo.sh template new
[CTRL+C to Exit]
? Select what you want to create with arrow keys ↑↓: Application>
? Select desired template with arrow keys ↑↓: [omni_usd_viewer]: USD Viewer
? Enter name of application .kit file [name-spaced, lowercase, alphanumeric]: my_company.my_usd_viewer
? Enter application_display_name: My USD Viewer
? Enter version: 0.1.0
The application template you have selected requires a extra extension.
Extra Extension -> omni_usd_viewer_messaging
Configuring extension template: Omni USD Viewer Messaging
? Enter name of extension [name-spaced, lowercase, alphanumeric]: my_company.my_usd_viewer_messaging_extension
? Enter extension_display_name: My USD Viewer Messaging Extension
? Enter version: 0.1.0
Extension 'my_company.my_usd_viewer_messaging_extension' created successfully in /home/ubuntu/Sources/kit-app-template_test/source/extensions/my_company.my_usd_viewer_messaging_extension
The application template you have selected requires a setup extension.
Setup Extension -> omni_usd_viewer_setup
Configuring extension template: Omni USD Viewer Setup
? Enter name of extension [name-spaced, lowercase, alphanumeric]: my_company.my_usd_viewer_setup_extension
? Enter extension_display_name: My USD Viewer Setup Extension
? Enter version: 0.1.0
Extension 'my_company.my_usd_viewer_setup_extension' created successfully in /home/ubuntu/Sources/kit-app-template_test/source/extensions/my_company.my_usd_viewer_setup_extension
Application 'my_company.my_usd_viewer' created successfully in /home/ubuntu/Sources/kit-app-template_test/source/apps/my_company.my_usd_viewer.kit
The application template you have selected has optional linked applications and layers.
? Do you want to add application layers? Yes
? Browse layers with arrow keys ↑↓: 1 layer selected
Creating selected ApplicationLayerTemplate.
Application Template -> omni_default_streaming
Application 'my_company.my_usd_viewer' created successfully in /home/ubuntu/Sources/kit-app-template_test/source/apps/my_company.my_usd_viewer_streaming.kit
Omniverse Kit App Streaming を選択した結果 source/apps/my_company.my_usd_viewer.kit とは別に source/apps/my_company.my_usd_viewer_streaming.kit というファイルが作成されています。
ビルドします。
$ ./repo.sh build
USD Viewer を起動して USD を見る
作成した USD のパスを /app/auto_load_usd に指定して ./repo.sh launch を実行します。
作成した ApplicationTemplate を選択すると Window が立ち上がります。
$ ./repo.sh launch -- --/app/auto_load_usd='/home/ubuntu/Documents/My USD/test.usd'
[ctrl+c to Exit]
? Select with arrow keys which App you would like to launch:
ApplicationTemplate
#################################################################################
my_company.my_usd_composer.kit
❯ my_company.my_usd_viewer.kit
ApplicationLayerTemplate
#################################################################################
my_company.my_usd_viewer_streaming.kit
作成した USD を見ることができ、マウスでカメラを操作することができました。
Web ブラウザから USD Viewer を見る
追加で、Omniverse Web Viewer Sample Application を使って、Web ブラウザから Streaming された USD Viwer を見たいと思います。
Omniverse Web Viewer Sample Application の前準備
git clone -b 1.5.2 https://github.com/NVIDIA-Omniverse/web-viewer-sample.git
cd web-viewer-sample
npm install
Omniverse Web Viewer Sample Application の Streaming 設定
stream.config.json の local.server にサーバーの IP アドレス (今回は 10.0.3.31) を記載します。
{
"$comment": "source can be 'gfn', 'local' or 'stream'",
"source": "local",
"stream":
{
"$comment": "Optional props if source is set to 'stream'.",
"appServer": "",
"streamServer": ""
},
"gfn": {
"$comment": "Required props if source is set to 'gfn'.",
"catalogClientId": "",
"clientId": "",
"cmsId": 0
},
"local": {
"$comment": "Required props if source is set to 'local'.",
"server": "10.0.3.31",
"signalingPort": 49100,
"mediaPort": 47998
}
}
USD Viewer の Streaming 起動
追加で --no-window を指定して ./repo.sh launch を実施します。
こうすることで Window が起動されません。
ApplicationLayerTemplate の streaming.kit を選択します。
$ ./repo.sh launch -- --/app/auto_load_usd='/home/ubuntu/Documents/My USD/test.usd' --no-window
[ctrl+c to Exit]
? Select with arrow keys which App you would like to launch:
ApplicationTemplate
#################################################################################
my_company.my_usd_composer.kit
my_company.my_usd_viewer.kit
ApplicationLayerTemplate
#################################################################################
❯ my_company.my_usd_viewer_streaming.kit
Omniverse Web Viewer Sample Application の起動
npm run dev
ブラウザで見てみる
http://127.0.0.1:5173 にアクセスすると、以下のような画面が見えます。
ここで UI for any streaming app を選択して Next に行くと、作成した USD が見られました!
少しは Omniverse について分かった気がする。







