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
AssetBundle と TextureCompression のおはなし
Search
Tetsuya Mori
PRO
October 23, 2013
Programming
0
110
AssetBundle と TextureCompression のおはなし
Tetsuya Mori
PRO
October 23, 2013
Tweet
Share
More Decks by Tetsuya Mori
See All by Tetsuya Mori
ビルドシステムを C# 大統一したお話
monry
PRO
2
1k
C# 大統一理論推進委員会 会員のための Unity Package Manager プロジェクト構成案
monry
PRO
0
1.3k
はじめての C# 大統一理論
monry
PRO
0
650
unity1week でチーム開発を成功させる秘訣
monry
PRO
0
180
Unity で ARゲームを作った話
monry
PRO
1
680
Visual Programming Framework UniFlow のご紹介/Introducing UniFlow
monry
PRO
2
2.7k
UniFlow 完全に理解した / I can develop UniFlow a little.
monry
PRO
0
470
Democratized Unity Package Manager
monry
PRO
1
2.6k
使ってみよう! Unity RemoteSettings/Let's use Unity RemoteSettings
monry
PRO
1
1k
Other Decks in Programming
See All in Programming
rails new flags - `rails new` のフラグから Rails を構成するコンポーネントの変遷をザックリ眺める
snaka
0
1.8k
デザインパターンで理解するLLMエージェントの作り方 / How to develop an LLM agent using agentic design patterns
rkaga
9
1.4k
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
3
1.2k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
1.1k
受け取る人から提供する人になるということ
little_rubyist
0
260
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2.1k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.3k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
120
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
970
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
110
RubyLSPのマルチバイト文字対応
notfounds
0
120
Jakarta EE meets AI
ivargrimstad
0
810
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
The Cult of Friendly URLs
andyhume
78
6k
Statistics for Hackers
jakevdp
796
220k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
A better future with KSS
kneath
238
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
A Philosophy of Restraint
colly
203
16k
What's new in Ruby 2.0
geeforr
343
31k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Transcript
AssetBundle ͱ TextureCompression ͷ͓ͳ͠ ʙMobile Platform ʹԙ͚ΔϦιʔεཧʙ גࣜձࣾΩοζελʔ ɹ࠸
͜ΜΜʂ • Unityɺͬͯ·͔͢ʂʁ • Unityɺָ͍͠Ͱ͢Ͷʂ • ࠓ AssetBundle ͱ Texture
ѹॖʹͭ ͍ͯޠΓʹདྷ·ͨ͠ʂʂ
ͱɺͦͷલʹ…ɻ
Who am I ? • “ɹ࠸” ͱਃ͠·͢ɻ • a.k.a. ΜΓ͌
/ T: @monry / F: ຊ໊ • 29ࡀ / ˁ / Oܕ / ఱṝ࠲ / طࠗ / झຯ: ߹ এ • झຯʮ͓ञʯͱʮ߹এʯͰ͢ɻ
Who am I ? • “גࣜձࣾΩοζελʔ” ͬͯձࣾͰಇ͍ͯ·͢ɻ • ະबֶࣇʙখֶੜͷ͓ࢠ͞·Λ͓࣋ͪͷϑΝ ϛϦʔΛλʔήοτʹͨ͠ҭ/ڭҭʹؔΘΔ
ΞϓϦɾαʔϏεΛల։͓ͯ͠Γ·͢ɻ ͑͜΄Μ ͷ͑΄Μؗ ͳΓ͖Γ!! ͬ͜͝ϥϯυ ύζϧ&ςΠϧζ
Ϩδϡϝ • AssetBundle ʹ͍ͭͯ • TextureCompression ʹ͍ͭͯ
લఏ • େલఏͱͯ͠ɺ2D ͷ͓͠Ͱ͢ʂ • ͬͱݴ͏ͱ NGUI ʹݶఆͯ͠·͢ • iOS
/ Android ͳϞόΠϧڥ • Unity 4.x (Pro) / NGUI 2.6.x • Pro ൛͡Όͳ͍ͱ AssetBundle Λ Build Ͱ͖ͳ͍ • AssetBundle ͷ͕8ׂͰ͢ :-P • ؒҧͬͨ͜ͱݴ͏͔Ε·ͤΜ͕ɺποίϛେܴͰ͢ʂʂ
AssetBundle ͷ֓ཁ • ͦͦ AssetBundle ͬͯ…ʁ • Asset Λ Bundle
ͨ͠Ϟϊ • ૉࡐΛవΊͯҰͭͷϑΝΠϧͱͯ͠ѻ͏ ͨΊͷٕज़ • Α͋͘Δॳճμϯϩʔυͱ͔ • ιγϟήͷΧʔυͷը૾ͱ͔
AssetBundle ͷ֓ཁ • ͜Μͳͷɻ(એ͡Όͳ͍Ͱ͢Αʁ͆)
AssetBundle ͷॴ • Unity ͕ղऍग़དྷΔϞϊͳΒ٧Ί์ • ͨͩ͠ɺiOS JIT ࣮ߦෆՄ
• WWW ΫϥεΛܦ༝ͯ͠औಘ • Ωϟογϡͱ͔Α͠ͳʹͬͯ͘ΕΔ • όʔδϣχϯάʹରԠ
AssetBundle ͷॴ • جຊతʹαʔόඞཁ • Content-Type: application/vnd.unity Λཁฦ٫ • ϑΝΠϧ໊ϢχʔΫ
• basename Ͱఆ͞ΕΔ • σΟϨΫτϦ۷ͬͯཧͱ͔ᶡ • ϓϥοτϑΥʔϜຖʹผϑΝΠϧ
AssetBundle ͷӡ༻ • ͡Ό͋ɺͦͷล౿·͑ͯɺͲ͏Δ ͷʁͬͯͳ͓͠Λɻ • ͔͜͜ΒઌɺฐࣾͰͷࣄྫΛϕʔε ʹਐΊ·͢ɻ • ҰͭͰࢀߟʹͳΔϞϊ͕͋Ε͍
Ͱ͢ɻ
AssetBundle ͷڥ • ॳճϦιʔεμϯϩʔυ • 2ճҎ߱ Cache ͤ Amazon S3
Amazon CloudFront App (Cache) App (Memory) Amazon S3 Amazon CloudFront App (Cache) App (Memory)
AssetBundle ͷڥ • νʔϜ։ൃ͢ΔͳΒ git Ͱཧ • όΠφϦ͔ͩΒඍົͬͪΌඍົ • Asset
Server (ཁ Team License) ΞϦ͔ • Editor Script ඞਢ • άάΕ͍ͬͺ͍స͕ͬͯ·͢ • ͜ͷษڧձͷաڈͷηογϣϯʹ
AssetBundle ͷڥ • iOS / Android ͷ྆ํʹରԠͤ͞Δ߹ɺ Team License ങͬͱ͚ʂ
• BuildPipeline.BuildAssetBundle() ͷࡍʹ Import Asset ͕ΔͨΊɺϦιʔε ͕ଟ͍ͱΊͬͪΌͭɻ • ͷͰɺCache Server ඞਢɻ
AssetBundle ͷઃܭ • ཻ (ฐࣾͷ߹) • Atlas / Texture /
AudioClip ΛݸผʹϏϧυ • 1ը໘ (≠γʔϯ) ʹ࠷େ10ݸΛ҆ • ॳճDL࣌ͷΩϟογϡʹ݁ߏґଘ • Ͳ͏ʹ͔͍ͨ͠Μ͚ͩͲͶ…ɻ
AssetBundle ͷઃܭ • ߋ৽ස (ฐࣾͷ߹) • ݪଇతʹ iOS ͷਃεέδϡʔϧ͕ج ४
• ͦͦߋ৽ස͕ߴ͍Ϟϊ API ͱ ͔ܦ༝ͨ͠ํ͕ཧָ͕ • BASE64 ͳςΩετΛ৯ΘͤΔͱ͔
AssetBundle ͷઃܭ • ॳճDL͢ΔωλҰཡ (ฐࣾͷ߹) • ͑ͯΞϓϦ (Assets/Resources/) ʹ .txt
(TSV ͳ TextAsset) Λอ࣋ • ϑΝΠϧ໊<TAB>όʔδϣϯ<LF> • ຖճىಈ࣌ʹ͜ͷϦετΛνΣοΫ • WWW.LoadFromCacheOrDownload ʹͤͯ Cache ͕༗͢ΔόʔδϣϯͱҟͳΔͳΒ DL
AssetBundle ͷઃܭ • ϑΝΠϧ໊ (ฐࣾͷ߹) • ϓϥοτϑΥʔϜ໊/छผ@ γʔϯ໊@ը໘໊@ϑΝΠϧ໊.unity3d • ϓϥοτϑΥʔϜ໊
iOS, Android, Editor ͳͲ • छผ Atlas, AudioClip, Texture ͳͲ
AssetBundle ͷߏங • Editor Script Ͱ͕ΜΔɻ Supporting Files/ 種別/ シーン名/
画面名/ ファイル名 ͜ͷߏܾΊଧͪͰσΟϨΫτϦͷ ϑΝΠϧΛࠪ
AssetBundle ͷ৴ • S3 Λ Origin ͱͨ͠ CloudFront • “όʔδϣϯ൪߸/ϓϥοτϑΥʔϜ/”
ͳ σΟϨΫτϦҎԼʹஔ • Editor Script Ͱॻ͖ग़ͨ͠σΟϨΫτϦ Λؙͬͱ PUT ग़དྷΔͱָͪΜ
ҙ • దͳࠩϏϧυΛߦΘͳ͍ͱμϝ • Կ͔ྑ͍Ҋແ͍͔ͬ͢ʁ͆ • WWW λΠϜΞτͷ࣮͕ແ͍ͷͰɺࣗલ ͰΉඞཁ͋Γ •
CloudFront ͏߹ɺ։ൃத Origin ͔Β DL ͨ͠ํ͕ྑ͍ • CF ଆͷ Cache Invalidation ͱ͔େมͩ͠ɻ
Texture Compression • ςΫενϟͷѹॖ • Inspector ͷ Format ʹ৭ʑ ग़ͯ͘Δ͚Ͳɺཁ͢Δʹ
Ͳ͏͍͏ίτ…ʁ
Texture Compression • σόΠεຖʹɺల։ग़དྷΔϑΥʔϚοτͱग़ དྷͳ͍ϑΥʔϚοτ͕͋Δ • GPU ʹґଘ • ల։ग़དྷͳ͔ͬͨ߹ɺແѹॖͷςΫενϟ
ΛҰؾʹϝϞϦʹࡌͤΔͬΆ͍ • શը໘ςΫενϟͱ͔ඳըʹ1secֻ͔Δί τɻ
Texture Compression • Ͱɺ࠷దͳͷʁ • iOS PowerVR (PVR) ʹ͠ͱ͚
OK • RGBA Compressed PVRTC 4 bits ͕Φεεϝ • ͩ͜ΘΔͳΒ Texture ผʹ࣮ػͰݟ ͭͭదʹબΜͰͶ
ͦ͏ɺiPhone ͳΒͶɻ
Texture Compression • ͰɺAndroid ʁ • …ɻ • ………ɻ •
࠷దղ͋Γ·ͤΜʂ orz
Texture Compression • ͱɺݴ͍͍ͨͱ͜ΖͰ͕͢ɺ7ׂҎ্͕ Adreno ʹରԠ͍ͯ͠ΔΑ͏ͳͷͰɺ ATC ͕ྑ͍Μ͡Όͳ͍͔ͱɻ ग़ల: NTT
Ϩκφϯτ͞·ͷ Remote TestKit Ұཡ http://appkitbox.com/testkit/smartphone
Texture Compression • ඇରԠ…ʁ • ͿͬͪΌ͚ΓࣺͯΔํ͕ਫ਼ਆӴੜ ্ΑΖ͍͠ͷͰʁ • গͳ͘ͱʮಡΊͳ͍ʯͱ͍͏ίτ ແ͍
(ͬΆ͍) ͷͰɺαΠζ࣍ୈͰ Կͱ͔ͳΔ͔ɻ
Texture Compression • WebPlayer / Standalone / etc… ʁ •
·ͩ࡞ͬͨ͜ͱແ͍ͷͰ͔Γ·ͤ Μʂ (ŝžŕ • ೡΖใަ͠·͠ΐ͏ʂ
·ͱΊ • AssetBundle • Editor Script ͕؊ཁ • ͪΌΜͱӡ༻ݟਾ͑ͯઃܭ͢͠ •
Texture Compression • Android ͷαϙʔτ࣍ୈ • υϥεςΟοΫͳஅඞཁ͔
Any Questions?
Thank you for your attention!!!