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
introduction to TextureView + OpenGL ES
Search
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
2.9k
About Flutter Architecture
wasabeef
1
330
2023 Flutter/Dart Summary
wasabeef
0
140
I/O Extended 2023 - Dart と Flutter の新機能
wasabeef
0
240
I/O Extended 2023 - Flutter 活用事例
wasabeef
10
3.1k
What it Takes to be a Flutter Developer
wasabeef
0
260
FlutterKaigi 2022 Keynote
wasabeef
1
740
Flutter Hooks を使ったアプリ開発 / App Development with the Flutter Hooks
wasabeef
2
1.5k
Flutter 2021 の振り返りと今後のアプリ開発に向けて / Looking back on Flutter 2021 and for future app development.
wasabeef
4
2.2k
Other Decks in Programming
See All in Programming
不幸な GC
chencmd
0
670
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
270
Dockerfile CMD for Node.js
grazie1999
0
120
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
400
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
580
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
370
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.5k
仕様駆動開発の消費期限
watany
20
8.9k
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
370
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
570
リアルな遅延を測る仕様
kota_yata
1
120
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Claude Code のすすめ
schroneko
67
230k
Ethics towards AI in product and experience design
skipperchong
2
350
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Chasing Engaging Ingredients in Design
codingconduct
0
280
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
The Curse of the Amulet
leimatthew05
2
14k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
950
Docker and Python
trallard
47
4.1k
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.