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
AR without SceneKit
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
naru-jpn
February 07, 2018
Programming
0
440
AR without SceneKit
Create AR application using Metal without SceneKit
naru-jpn
February 07, 2018
Tweet
Share
More Decks by naru-jpn
See All by naru-jpn
配信アプリのためのリアルタイムプッシュ通知ぼかしの夢
narujpn
3
1k
PiPを応用した配信コメントバー機能の開発秘話と技術の詳解 / pip_streaming_comment_bar
narujpn
3
4.6k
Updating an App to Use Swift Concurrency 解説
narujpn
2
370
PiP で実現するミラティブの配信コメントバー / pip-streaming-comment-bar
narujpn
0
1.3k
App Extension のスタックトレース情報からクラッシュを解析/集計する / Analyzing app extension's stack trace
narujpn
3
1.7k
ミラティブとWebRTC - WebRTC framework の中身を覗いてみよう / WebRTC framework AudioUnit Processing
narujpn
1
2.2k
CoreML3のオンデバイストレーニングでつくる母音推定
narujpn
0
470
AltConfと周辺の歩き方
narujpn
0
2k
エンジニア経験を活かしたスクラムマスターとして 開発チームとプロダクトを成長させる
narujpn
1
430
Other Decks in Programming
See All in Programming
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
230
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
500
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
540
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
890
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
170
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
130
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
180
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
830
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Chasing Engaging Ingredients in Design
codingconduct
0
140
How to build a perfect <img>
jonoalderson
1
5.2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Build your cross-platform service in a week with App Engine
jlugia
234
18k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
99
Are puppies a ranking factor?
jonoalderson
1
3.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
210
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
260
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
Designing Experiences People Love
moore
143
24k
Transcript
AR without SceneKit #mobilearmeetup @Timers 2018/2/7
Relation of ARKit and SceneKit
ARKit Camera SceneKit Pixel Buffer 3D Info Rendering ARSCNView
ARKit Camera SceneKit Pixel Buffer 3D Info Rendering ARSCNView Light
Estimation Plane Detection Manage 3D Objects
Remove SceneKit and Use Metal
ARKit Camera SceneKit Pixel Buffer 3D Info Rendering ARSCNView Light
Estimation Plane Detection Manage 3D Objects
ARKit Camera Pixel Buffer 3D Info Light Estimation Plane Detection
Metal ARKit Camera Pixel Buffer 3D Info Light Estimation Plane
Detection Rendering
Metal ARKit Camera Pixel Buffer 3D Info Rendering Light Estimation
Plane Detection Take Photo
MetalAR https://github.com/naru-jpn/MetalAR
None
Metal ARKit Camera Pixel Buffer 3D Info Light Estimation Plane
Detection Rendering Take Photo
// Create ARSession session = ARSession() // ARSessionDelegate session.delegate =
self
Metal ARKit Camera Pixel Buffer 3D Info Light Estimation Plane
Detection Rendering Take Photo
// Defined in ARSessionDelegate // Called when ARFrame is updated
func session(_ session: ARSession, didUpdate frame: ARFrame) { // … }
A running AR session continuously captures video frames from the
device camera. For each frame, ARKit analyzes the image together with data from the device's motion sensing hardware to estimate the device's real-world position. ARFrame https://developer.apple.com/documentation/arkit/arframe
Metal ARKit Camera Pixel Buffer 3D Info Light Estimation Plane
Detection Rendering Take Photo
Pipeline of off-screen rendering Draw video frame Filter Draw Instances
ARFrame MTLTexture
Pipeline of off-screen rendering Filter Draw Instances ARFrame MTLTexture Draw
video frame Commands sent to GPU
Pipeline of off-screen rendering Filter Draw Instances ARFrame MTLTexture MPSImageSobel
declared in Metal Performance Shaders Draw video frame Commands sent to GPU
Performance on iPhone7
Filter Draw Instances ARFrame MTLTexture Draw video frame 3.3 ms
Rendering
Making Image to save drawHierarchy(in:afterScreenUpdates:) MTLTexture → CGImage 7.0 ~
10.0 ms available on background thread 30.0 ~ 40.0 ms required to execute on main thread
Challenges
Drawing original 3D objects User Interaction (available hitTest(_:types:) for ARFrame)
Physics engine Skeletal Animation …
References
Documents Metal Best Practices Guide https://developer.apple.com/library/content/documentation/ 3DDrawing/Conceptual/MTLBestPracticesGuide/index.html#// apple_ref/doc/uid/TP40016642-CH27-SW1 Metal Shading
Language Specification https://developer.apple.com/metal/Metal-Shading-Language- Specification.pdf
AR Template Project