Universal AR

提供: ディーズガレージ wiki
移動先: 案内検索

(仮)ユニバーサルAR
UnityでglTFとUSDZを作り<model-viewer>に組込みしてみます。

Ar qr.png

https://dz.plala.jp/ar2

環境

DCCツール 3dsMax, Unity, <model-viewer>
検証環境 iPhone XS

Unity Importer Exporter

glTF

GitHub - Plattar/gltf-exporter

USDZ

GitHub - Unity-Technologies/usd-unity-sdk

アニメーション付きは?
https://forum.unity.com/threads/usd-for-unity-updates.646645/page-3

Adobe Aero 一択かも? 未確認
Adobe Aero サポートされているファイル形式

Web Tool

GLB Packer

Facebook for Developers
https://glb-packer.glitch.me

自前で用意する場合 未確認
GitHub - sbtron/makeglb
GitHub - najadojo/gltf-import-export
GitHub - Geopipe/gltf2glb
GitHub - Qantas94Heavy/binary-gltf-utils
GitHub - TimvanScherpenzeel/gltf-to-glb

Debug

https://vr.google.com/scene-viewer-preview

Converter

USD from glTF

GitHub - google/usd_from_gltf

PC Windows10 VMware Workstation 15 Player
OS Ubuntu 18.04.3 LTS

USD

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install build-essential cmake libboost-dev libboost-all-dev libtbb-dev git pyside-tools python-pip
$ pip install PyOpenGL
$ sudo apt install libx11-dev libglew-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev
$ git clone https://github.com/PixarAnimationStudios/USD
$ sudo python USD/build_scripts/build_usd.py /usr/local/USD

usdview

$ cd ~
$ export PYTHONPATH=$PYTHONPATH:/usr/local/USD/lib/python
$ export PATH=$PATH:/usr/local/USD/bin
$ cd USD
$ usdview extras/usd/tutorials/convertingLayerFormats/Sphere.usda

USD_from_glTF

$ cd ~
$ sudo apt install nasm
$ pip install Pillow
$ git clone https://github.com/google/usd_from_gltf
$ python usd_from_gltf/tools/ufginstall/ufginstall.py ~/usd_from_gltf /usr/local/USD

error
CentOS 7がよさげ

gltf2usd

GitHub - kcoley/gltf2usd

PC Windows10 VMware Workstation 15 Player
OS Ubuntu 18.04.3 LTS

gltf2usd

$ sudo apt install zlib1g-dev
$ sudo apt install openexr
$ sudo apt install libopenexr-dev
$ pip install openexr
$ git clone https://github.com/kcoley/gltf2usd.git
$ cd gltf2usd
$ pip install -r requirements.txt

変換

$ cd ~
$ cd gltf2usd/Source
$ export PYTHONPATH=$PYTHONPATH:/usr/local/USD/lib/python
$ export PATH=$PATH:/usr/local/USD/bin
$ python gltf2usd.py -g ../../gltf/littlest-tokyo.gltf -o ../../littlest-tokyo.usdz

log

Alpha Mask not supported in USDPreviewSurface!  Using Alpha Blend...

アニメーションのエクスポートに成功してる

glTF Pipeline

GitHub - AnalyticalGraphicsInc/gltf-pipeline

$ npm install -g gltf-pipeline

Draco glTF 未確認

<model-viewer>

参考: GitHub - model-viewer/README.md
参考: GitHub - model-viewer/POLYFILLS.md
参考: GitHub - model-viewer/Document

ソース

https://dz.plala.jp/ar2/index.html
https://dz.plala.jp/ar2/script.js
https://dz.plala.jp/ar2/style.css
https://dz.plala.jp/ar2/data.json

gzip圧縮

効果があるのか疑問
.htaccess

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
 
#古いブラウザ対策
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch \bMSIE\s(7|8) !no-gzip !gzip-only-text/html
 
#画像は圧縮しない GIF、JPEG、PNG、ICO
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary

#圧縮するファイル
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/js
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-woff
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/glb
AddOutputFilterByType DEFLATE application/usdz
</IfModule>

リソース

HDR

https://hdrihaven.com/

Model

Le Corbusier LC2 ©CASSINA IXC. Ltd.
Aeron Chair ©Herman Miller, Inc.
Ball Chair © Eero Aarnio
Panton Chair ©Vitra
PH 5 ©Louis Poulsen
PH 2/1 Wall ©Louis Poulsen
Samba Dancing @ Mixamo

Sketchfab

CC BY 4.0
Littlest Tokyo @ glenatron
Mech Drone @ Willy Decarpentrie
Pony Cartoon @ Slava Z.
Robot Steampunk 3D-Coat 4.5 PBR @ 3d-coat
Junkrat @ Claudia Luehl
phoenix bird @ NORBERTO-3D
Dancing Crab - Uca Mjoebergi @ Bohdan Lvov
Flying Trabant (Final Takeoff) @ Zacharias Reinhardt
Flying Bee @ elly77ellison
Thor and the Midgard Serpent @ Mr. The Rich
Spot Mini (Rigged) @ Greg McKechnie
cute dog @ RODX81
animated EAGLE @ Asim3d
Space Invader @ Sirhaian
Lance of Longinus @ Mr. The Rich

CC BY-NC 4.0
Tokay gecko @ DigitalLife3D
Southern White Rhino @ DigitalLife3D
Loggerhead sea turtle @ DigitalLife3D

CC BY-NC-SA 4.0
BB8 (Animated) @ StarWars-Universe
R2-D2 (Animated) @ StarWars-Universe
DANCING STORMTROOPER @ StrykerDoesAnimation 自主規制

ライブラリ検索

https://github.com/search?q=USD
https://github.com/search?q=glTF

更新履歴

  • 2020.01.07 更新
  • 2019.10.25 公開