Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
introduction to TextureView + OpenGL ES
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daichi Furiya (Wasabeef)
November 06, 2015
Programming
1.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
introduction to TextureView + OpenGL ES
Daichi Furiya (Wasabeef)
November 06, 2015
More Decks by Daichi Furiya (Wasabeef)
See All by Daichi Furiya (Wasabeef)
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
6
3k
About Flutter Architecture
wasabeef
1
340
2023 Flutter/Dart Summary
wasabeef
0
140
I/O Extended 2023 - Dart と Flutter の新機能
wasabeef
0
250
I/O Extended 2023 - Flutter 活用事例
wasabeef
10
3.1k
What it Takes to be a Flutter Developer
wasabeef
0
270
FlutterKaigi 2022 Keynote
wasabeef
1
760
Flutter Hooks を使ったアプリ開発 / App Development with the Flutter Hooks
wasabeef
2
1.6k
Flutter 2021 の振り返りと今後のアプリ開発に向けて / Looking back on Flutter 2021 and for future app development.
wasabeef
4
2.3k
Other Decks in Programming
See All in Programming
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
220
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
120
すこし踏み込む CancellationToken
htkym
2
1.6k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
750
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
210
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.4k
setup-vp GitLab対応の裏側
naokihaba
0
150
mrbgem 三角測量 開発
ogom
0
170
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
320
iOSDCのペンライトを自動制御したい!
akkeylab
0
340
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Product Roadmaps are Hard
iamctodd
55
13k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
490
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
520
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Designing for humans not robots
tammielis
254
26k
Building Adaptive Systems
keathley
44
3.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
TextureView OpenGL ES Wasabeef
About Me @wasabeef_jp AbemaTV, Inc. (CyberAgent, Inc.)
What would you like to do?
What would you like to do? ・3D Graphics Game (Unity,
Unreal Engine, Cocos2d-x) ・Filter (Camera, Image, Movie)
OpenGL ES by Khronos Group
OpenGL ES “Android includes support for high performance 2D and
3D graphics with the Open Graphics Library (OpenGL®), specifically, the OpenGL ES API.”
OpenGL ES ・OpenGL ES 1.0/1.1 - API level 1+ ・OpenGL
ES 2.0 - API level 8+ ・OpenGL ES 3.0 - API level 18+ ・OpenGL ES 3.1 - API level 21+
Vulkan by Khronos Group
Vulkan
Surface
SurfaceView
SurfaceHolder
SurfaceHolder public class MySurfaceView extends SurfaceView { public MySurfaceView(Context context)
{ super(context); SurfaceHolder holder = this.getHolder(); } }
SurfaceHolder.Callback public class MySurfaceView extends SurfaceView implements SurfaceHolder.Callback { public
MySurfaceView(Context context) { super(context); getHolder().addCallback(this); } @Override public void surfaceCreated(SurfaceHolder arg0) { /***/ } @Override public void surfaceChanged( SurfaceHolder arg0, int arg1, int arg2, int arg3) { /***/ } @Override public void surfaceDestroyed(SurfaceHolder arg0) { /***/ } }
GLSurfaceView
TextureView
SurfaceTexture
SurfaceTextureListener
SurfaceTextureListener private class MySurfaceTextureListener implements SurfaceTextureListener { @Override public void
onSurfaceTextureAvailable( SurfaceTexture surface, int width, int height) { /***/ } @Override public void onSurfaceTextureSizeChanged( SurfaceTexture surface, int width, int height) { /***/ } @Override public boolean onSurfaceTextureDestroyed( SurfaceTexture surface) { /***/ } @Override public void onSurfaceTextureUpdated( SurfaceTexture surface) { /***/ } }
GLTextureView http://bit.ly/1RAnLrw
Shader
Shader public static final String SAMPLE_SHADER = "" + "void
main()\n" + "{\n" + " gl_FragColor =vec4(1.0, 0.0, 0.0, 1.0)\n” + "}";
Shader public static final String COLOR_SHADER = "" + "varying
highp vec2 textureCoordinate;\n" + "uniform sampler2D inputImageTexture;\n" + "uniform lowp mat4 colorMatrix;\n" + "uniform lowp float intensity;\n" + "void main()\n" + "{\n" + " lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);\n" + " lowp vec4 outputColor = textureColor * colorMatrix;\n" + " gl_FragColor = (intensity * outputColor) + ((1.0 - intensity) * textureColor);\n" + "}";
Shader private static int loadShader(int type, String src) { int
shader = GLES20.glCreateShader(type); if (shader != 0) { GLES20.glShaderSource(shader, src); GLES20.glCompileShader(shader); int[] compiled = new int[1]; GLES20.glGetShaderiv( shader, GLES20.GL_COMPILE_STATUS, compiled, 0); if (compiled[0] == 0) { GLES20.glDeleteShader(shader); shader = 0; } } return shader; }
Summary ・OpenGL ES2 (API level 8+) ・TextureView (API level 14+)
・SurfaceTexture ・SurfaceTextureListener ・GLTextureView (Custom) ・Shader (GLSL)
Thanks.