opengl on android · i better performance than opengl es 1.x in many cases i android 2.2 and higher...

16
OpenGL on Android Lecture 8 Android Native Development Kit 8 April 2014 NDK OpenGL on Android, Lecture 8 1/16

Upload: others

Post on 24-Sep-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

OpenGL on AndroidLecture 8

Android Native Development Kit

8 April 2014

NDK OpenGL on Android, Lecture 8 1/16

Page 2: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

OpenGL ES

OpenGL ES on Android

Demo

Debugging and Profiling

NDK OpenGL on Android, Lecture 8 2/16

Page 3: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Outline

OpenGL ES

OpenGL ES on Android

Demo

Debugging and Profiling

NDK OpenGL on Android, Lecture 8 3/16

Page 4: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

OpenGL ES

I Cut down version of OpenGL

I Fixed point support

I Found in many mobile platforms (Android, iOS, Blackberry,Symbian, 3DS, etc.)

I Designed for slower GPUs and CPUs

NDK OpenGL on Android, Lecture 8 4/16

Page 5: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Version 1.x

I OpenGL ES 1.0 based on OpenGL 1.3 and OpenGL ES 1.1based on OpenGL 1.5

I Common and Common-Lite (only fixed point) profile

I Fixed-function rendering pipeline

I Reduced features: no quad and polygon primitives, nostippling, only multisample AA, reduced drawing modes, nodisplay lists, etc.

I OpenGL ES 1.1 adds better multitexture support, VBOs, clipplanes, mipmap generation

I Android 1.0 and higher

NDK OpenGL on Android, Lecture 8 5/16

Page 6: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Version 2.0

I Based on OpenGL 2.0, but reduced fixed-function pipelinesupport

I Not compatible with OpenGL ES 1.x

I OpenGL ES Shading Language

I ESSL only has forward branches and fixed iteration loops

I Transforming and Lighting functions replaced by shaders

I Better performance than OpenGL ES 1.x in many cases

I Android 2.2 and higher

NDK OpenGL on Android, Lecture 8 6/16

Page 7: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Version 3.0

I Compatible with OpenGL ES 2.0 and OpenGL 4.3

I Standardized texture compression

I Better texturing support

I New Shading Language version with full support for integerand floating point

I Improved flow control

I Easier portability

I Android 4.3 and higher

NDK OpenGL on Android, Lecture 8 7/16

Page 8: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Outline

OpenGL ES

OpenGL ES on Android

Demo

Debugging and Profiling

NDK OpenGL on Android, Lecture 8 8/16

Page 9: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

GL Surface

I Manages a surface (a piece of memory which can be displayedon screen)

I Manages an EGL display (an OpenGL rendering context)

I Dedicated rendering thread

I Can provide debug information

NDK OpenGL on Android, Lecture 8 9/16

Page 10: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

EGL

I Virtual display which contains a rendering context

I 2D and 3D rendering

I Allows having multiple smaller surfaces on the actual screen ordrawing to offscreen buffer

I Used by SurfaceFlinger and other compositors (Wayland, Mir)or libraries (SDL)

NDK OpenGL on Android, Lecture 8 10/16

Page 11: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Outline

OpenGL ES

OpenGL ES on Android

Demo

Debugging and Profiling

NDK OpenGL on Android, Lecture 8 11/16

Page 12: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Demo

Demo

NDK OpenGL on Android, Lecture 8 12/16

Page 13: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Outline

OpenGL ES

OpenGL ES on Android

Demo

Debugging and Profiling

NDK OpenGL on Android, Lecture 8 13/16

Page 14: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Android tools

I Logging

I Debugging Developer Options: Overdraw, Clipping

I Profiling Developer Options: Performance metrics on screenor through ADB, Traces

I Tracer for OpenGL ES: Visualize traces

NDK OpenGL on Android, Lecture 8 14/16

Page 15: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Intel GPA

I Intel Atom processors

I More information: GPU, CPU, Battery usage

I More detailed analysis

I Identifies possible bottlenecks

I Realtime

I Works over Wifi

NDK OpenGL on Android, Lecture 8 15/16

Page 16: OpenGL on Android · I Better performance than OpenGL ES 1.x in many cases I Android 2.2 and higher NDK OpenGL on Android, Lecture 8 6/16. Version 3.0 I Compatible with OpenGL ES

Vendor specific tools

I Low level information

I Different interface and capabilities for each vendor

I Optimizations not always portable

I PowerVR, Tegra, Adreno, etc

NDK OpenGL on Android, Lecture 8 16/16