SlideShare a Scribd company logo
Ziv Gilad
Ziv.gilad@gmail.com
OpenGL - Bringing the 3D World into the Android
First - few Examples
Few Examples from the WebGL
World:
• Trigger Rally
• Jellyfish Simulation
• Train Demo
• Mammoth
What is OpenGL?
• Hardware-accelerated 3D graphics
• API for rendering 2D and 3D
• Cross-language
• Multi-platform
• Part of the Khronos Group
• Royalty-free
• Client-based rendering
• Immediate mode rendering
Android Support
• Android uses OpenGL ES
• OpenGL ES 1.0 and 1.1
• Android 1.0 and higher
• OpenGL ES 2.0
• Android 2.2 (API level 8) and higher
• OpenGL ES 3.0
• Android 4.3 (API level 18) and higher
may support
• Requires device manufacturer support
WebGL for Android
• Android also supports OpenGL for
the Web
• WebGL is the OpenGL ES JavaScript APIS
• Browser Support:
• FireFox for Mobile 4
• Chrome for Android 25
• Opera Mobile 12
3D Models
• Defined using meshes
• Mesh composed of triangles
• Triangles are 3 vertices
• Vertices are x, y, z triples
• No surface properties
• No color
• No Mateial
3D Model Example
3D Models
• Can be written in Notepad
• In practice we use 3D creation tools
• Blender
• Clara.io
• Maya
• Cinema4D
• Unity
• 3ds Max
Create a vertex array
Create Simple Model
Demo
Vertices Example
Create an index array
Create Simple Model
OpenGL Pipeline
Vertex Buffer Attributes
Vertex Shader
Fragmant (Pixel)
Shader
Frame Buffer
Uniforms Varyings
Coordinates,
Colors,
Normals
Transitions
• glsl-transition
Transition Example
Vertex Shader
• Invoked per each vertex
• Shader Input:
• Per vertex – Attributes
• Globally for all vertices – Uniforms
• Manipulate vertex position:
• Scale
• Rotate
• Translate
• Can send data to fragmant shader - Varying
Vertex Affine Transform
• Rotation:
• Scaling:
• Translation:
Cameras, Perspective,
Viewports
• Camera position and orientation
• Model – View matrix
• Field of view (FOV)
• Perspective matrix
• Viewport
• 2D projection of 3D
scene
Demo
Wireframe Cube Example
Demo
Colored Cube Example
Vertices vs Fragments
• More fragments than vertices
Demo
Colored Cube Interpolation
Example
Vertices vs Fragments
• More fragments than vertices
• Vertex shader varying are
interpolated
Textures
What if we want to display this image
On this surface?
Textures
And get the following result?
Textures
• Display image on the surface
• Use texture mapping
• Apply real time effects
Demo
Textured Cube - Image
Demo
Textured Cube – Two Textures
Lights and materials
• Lightning model use physical principles
• Final Color
• Lights
• Normals
• Material
Phong Reflection
Model
Picking
• Create offscreen framebuffer
• Label objects with unique colors
• Off-screen – on screen render
• Read Pixel Data
Summary
• OpenGL – hardware
accelerated 3D graphics
• Vertex Shader - manipulates
per-vertex data
• Fragment Shader - calculates
color of individual pixels
• Textures display images on
the surface of geometries
Questions?
Ziv Gilad
Ziv.gilad@gmail.com

More Related Content

PDF
Cloud Shadows to Crepuscular Rays
PDF
THE VANISHING TRICK FOR SELF-DRIVING CARS - Weilin Xu - DEF CON 26 CAAD VILLAGE
PDF
3D in Android
PDF
Android OpenGL ES remote rendering 蕭從恩
PPTX
OpenGL ES Presentation
PDF
認識那條鯨魚 Docker 初探
ODP
Remote Android Rendering
PDF
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Cloud Shadows to Crepuscular Rays
THE VANISHING TRICK FOR SELF-DRIVING CARS - Weilin Xu - DEF CON 26 CAAD VILLAGE
3D in Android
Android OpenGL ES remote rendering 蕭從恩
OpenGL ES Presentation
認識那條鯨魚 Docker 初探
Remote Android Rendering
Leaving Flatland: Getting Started with WebGL- SXSW 2012

Similar to OpenGL - Bringing the 3D World into the Android (20)

PDF
OpenGL ES on Android
PPTX
OpenGL basics
PDF
Android open gl2_droidcon_2014
PDF
Open gl
PDF
Computer Graphics - Lecture 01 - 3D Programming I
PPT
Advanced Graphics Workshop - GFX2011
KEY
Getting Started with WebGL
PDF
Introduction of openGL
PPTX
OpenGL Shading Language
PDF
Open GL ES Android
PPT
Rendering: Vertices, Indices, UVs and Shaders
PDF
OpenGL ES 2.x Programming Introduction
PPTX
Getting started with open gl es 2
PDF
"Graphical fun With WebGL shaders", Martin Splitt
PDF
iOS Visual F/X Using GLSL
PPTX
HTML5DevConf 2013 (October): WebGL is a game changer!
PDF
WebGL Fundamentals
PDF
The Power of WebGL - Hackeando sua GPU com JavaScript
OpenGL ES on Android
OpenGL basics
Android open gl2_droidcon_2014
Open gl
Computer Graphics - Lecture 01 - 3D Programming I
Advanced Graphics Workshop - GFX2011
Getting Started with WebGL
Introduction of openGL
OpenGL Shading Language
Open GL ES Android
Rendering: Vertices, Indices, UVs and Shaders
OpenGL ES 2.x Programming Introduction
Getting started with open gl es 2
"Graphical fun With WebGL shaders", Martin Splitt
iOS Visual F/X Using GLSL
HTML5DevConf 2013 (October): WebGL is a game changer!
WebGL Fundamentals
The Power of WebGL - Hackeando sua GPU com JavaScript
Ad

More from DroidConTLV (20)

PDF
Mobile Development in the Information Age - Yossi Elkrief, Nike
PDF
Doing work in the background - Darryn Campbell, Zebra Technologies
PDF
No more video loss - Alex Rivkin, Motorola Solutions
PDF
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
PDF
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
PDF
MVVM In real life - Lea Cohen Tannoudji, Lightricks
PDF
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
PDF
Building Apps with Flutter - Hillel Coren, Invoice Ninja
PDF
New Android Project: The Most Important Decisions - Vasiliy Zukanov
PDF
Designing a Design System - Shai Mishali, Gett
PDF
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
PDF
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
PDF
Flutter State Management - Moti Bartov, Tikal
PDF
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
PDF
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
PDF
DroidconTLV 2019
PDF
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
PDF
Introduction to React Native - Lev Vidrak, Wix
PDF
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
PDF
Educating your app – adding ML edge to your apps - Maoz Tamir
Mobile Development in the Information Age - Yossi Elkrief, Nike
Doing work in the background - Darryn Campbell, Zebra Technologies
No more video loss - Alex Rivkin, Motorola Solutions
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
MVVM In real life - Lea Cohen Tannoudji, Lightricks
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Building Apps with Flutter - Hillel Coren, Invoice Ninja
New Android Project: The Most Important Decisions - Vasiliy Zukanov
Designing a Design System - Shai Mishali, Gett
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Flutter State Management - Moti Bartov, Tikal
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
DroidconTLV 2019
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Introduction to React Native - Lev Vidrak, Wix
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Educating your app – adding ML edge to your apps - Maoz Tamir
Ad

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPT
Teaching material agriculture food technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25 Week I
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Teaching material agriculture food technology

OpenGL - Bringing the 3D World into the Android

Editor's Notes

  • #5: Multi Platform - Linux, MacOS X, and Windows Cross-language – c++, C# and Java to Python and Lua