Computer Graphics on Mobile Devices VL SS2010 3.0 ECTS

Similar documents
Android and OpenGL. Android Smartphone Programming. Matthias Keil. University of Freiburg

Performance Optimization and Debug Tools for mobile games with PlayCanvas

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

How To Understand The Power Of Unity 3D (Pro) And The Power Behind It (Pro/Pro)

Lecture 1 Introduction to Android

How To Teach Computer Graphics

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Android Basics. Xin Yang

Introduction to Computer Graphics

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

Android Development. Marc Mc Loughlin

GearVRf Developer Guide

Game Development in Android Disgruntled Rats LLC. Sean Godinez Brian Morgan Michael Boldischar

Introduction to NaviGenie SDK Client API for Android

How to develop your own app

Optimizing Unity Games for Mobile Platforms. Angelo Theodorou Software Engineer Unite 2013, 28 th -30 th August

How To Develop For A Powergen 2.2 (Tegra) With Nsight) And Gbd (Gbd) On A Quadriplegic (Powergen) Powergen Powergen 3

How To Develop Android On Your Computer Or Tablet Or Phone

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Praktikum Entwicklung Mediensysteme (für Master)

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Parallel Web Programming

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

Optimizing AAA Games for Mobile Platforms

Computer Graphics Hardware An Overview

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Introduction to GPGPU. Tiziano Diamanti

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

Introduction to Android

Multithreading and Java Native Interface (JNI)!

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Developing Android Apps for BlackBerry 10. JAM854 Mike Zhou- Developer Evangelist, APAC Nov 30, 2012

Beginning Android 4. Games Development. Mario Zechner. Robert Green

Color correction in 3D environments Nicholas Blackhawk

Workshop on Android and Applications Development

Android Developer Fundamental 1

ANDROID INTRODUCTION TO ANDROID

Press Briefing. GDC, March Neil Trevett Vice President Mobile Ecosystem, NVIDIA President Khronos. Copyright Khronos Group Page 1

Android Application Development: Hands- On. Dr. Jogesh K. Muppala

Hello World. by Elliot Khazon

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Android Application Development

Arduino & Android. A How to on interfacing these two devices. Bryant Tram

A Study on Android development kits and the Phone Gap Framework

4. The Android System

Android Programming and Security

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

Admin. Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources. Recap: TinyOS. Recap: J2ME Framework

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

ELET4133: Embedded Systems. Topic 15 Sensors

GPU Profiling with AMD CodeXL

Android Architecture. Alexandra Harrison & Jake Saxton

TEGRA X1 DEVELOPER TOOLS SEBASTIEN DOMINE, SR. DIRECTOR SW ENGINEERING

MMI 2: Mobile Human- Computer Interaction Android

OpenCV on Android Platforms

Frameworks & Android. Programmeertechnieken, Tim Cocx

Android Tutorial. Larry Walters OOSE Fall 2011

Android Environment SDK

Creating a 2D Game Engine for Android OS. Introduction

Android Application Development. Daniel Switkin Senior Software Engineer, Google Inc.

OpenGL & Delphi. Max Kleiner. 1/22

Mobile Application Development

Web Based 3D Visualization for COMSOL Multiphysics

Issues of Hybrid Mobile Application Development with PhoneGap: a Case Study of Insurance Mobile Application

Mobile Application Development 2014

Jordan Jozwiak November 13, 2011

Mobile Application Development Android

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series. By: Binesh Tuladhar Clay Smith

-Android 2.3 is the most used version of Android on the market today with almost 60% of all Android devices running 2.3 Gingerbread -Winner of

OpenGL Performance Tuning

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

CS378 -Mobile Computing. Android Overview and Android Development Environment

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

Developing Android Apps: Part 1

Developer Tools. Tim Purcell NVIDIA

The Future Of Animation Is Games

Chapter 2 - Graphics Programming with JOGL

Chapter 2 Getting Started

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

Getting Started: Creating a Simple App

Android Development Exercises Version Hands On Exercises for. Android Development. v

Des Moines Area Community College

Developing an Android App. CSC207 Fall 2014

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

An Introduction to 3D Computer Graphics, Stereoscopic Image, and Animation in OpenGL and C/C++ Fore June

TEACHING GRAPHICS PROGRAMMING ON MOBILE DEVICES

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Experiences with 2-D and 3-D Mathematical Plots on the Java Platform

Graphics Input Primitives. 5. Input Devices Introduction to OpenGL. String Choice/Selection Valuator

Google Android Syllabus

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Android For Java Developers. Marko Gargenta Marakana

Getting started with Android and App Engine

Transcription:

Computer Graphics on Mobile Devices VL SS2010 3.0 ECTS Peter Rautek

Rückblick Motivation Vorbesprechung Spiel VL Framework Ablauf Android Basics Android Specifics Activity, Layouts, Service, Intent, Permission, etc. Entwicklung mit Eclipse Peter Rautek 1

Overview Development with Eclipse Overview Demo Advanced Android Topics 3D Graphics The Java Way The C/C++ Way Debugging OpenGL Configuration, Resources and Localization OpenGL ES History Overview Lab Phase II Peter Rautek 2

Development with Eclipse Breakpoints Variables Perspectives LogCat Filters Callstack Subclipse Team item Browser Import Peter Rautek 3

OpenGL The Java Way Implement the lifecycle methods in Activity onpause onresume Extend the GLSurfaceView Call the setrenderer method in GLSurfaceView Implement the GLSurfaceView.Renderer onsurfacecreated onsurfacechanged ondrawframe Peter Rautek 4

GLSurfaceView Manages memory (surface), composited into the view system Manages OpenGL rendering to the surface Requires a implementation of the GLSurfaceView.Renderer interface Rendering runs in own thread On-demand vs. continuous rendering OpenGL debugging Default: 16-bit R5G6B5, 16-bit depth buffer Peter Rautek 5

Renderer Runs in separate thread onsurfacecreated Called when The activity is started The OpenGL context was destroyed and recreated Load Textures onsurfacechanged Called when size/orientation changes ondrawframe Peter Rautek 6

OpenGL The Java Way Pro Very easy to implement Con Lower performance Garbage collection can lead to hickups Threading problem Game engine loop runs in render thread Thread synchronization Check out the API demos! Peter Rautek 7

OpenGL The C/C++ Way Native development kit (NDK) Native implementation Generate make files Build shared library Use SDK tools to build application Load shared library from Java static { System.loadLibrary( mylibrary ); } Declare native methods private static native void nativemyfunction(); Call native functions from GLSurfaceView Two demo apps in the NDK san-angeles: OpenGL 1.x hello-gl2: OpenGL 2.x Android 2.0 and higher Not running in emulator Peter Rautek 8

OpenGL The C/C++ Way Pro Performance Con Harder to implement Cumbersome development Debugging Check out the NDK demos! Peter Rautek 9

Debugging OpenGL Context Wrapper (see AboutActivity) @Override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mglsurfaceview.setglwrapper(new GLWrapper(){ private Writer logger = new Writer(){ //implementing the writer interface }; } }); @Override public GL wrap(gl gl) { } return GLDebugHelper.wrap( gl, GLDebugHelper.CONFIG_CHECK_GL_ERROR GLDebugHelper.CONFIG_LOG_ARGUMENT_NAMES, logger); Peter Rautek 10

Android Development Multithreading User interface (Activity) Rendering (GLSurfaceView.Renderer) Your own threads Synchronization Necessary to avoid concurrency problems Handler class provides message queue Example: Display frame rate Peter Rautek 11

Performance Always know your frame rate! Log (+easy, -floods your Log, -bad visibility) Onscreen OpenGL Overlay Write text to bitmap Render as texture GUI Overlay Use FrameLayout Overlay TextView Peter Rautek 12

GUI Overlay Peter Rautek 13

Android Development How to add sources No short answer to this <sdk>\platforms\android-1.6\ Create sources -> <sdk>\platforms\android-1.6\sources Copy sources to this folder Additional info and sources for other versions: http://code.google.com/p/android/issues/detail?id=979 Peter Rautek 14

Resources and Configurations Configurations depend on Device Screen size Keyboard User preference Language Situation Orientation Solution Multiple resources in one apk Peter Rautek 15

Resources and Configurations Change of configuration Destroying activity Restarting activity with new configuration Resource folders Loading of resource in appropriate folder Depending on Peter Rautek 16

Example: Different Languages Localization res/values/string.xml The default must contain all strings res/values-de/string.xml The de folder may contain localized strings for German version res/values-fr/string.xml The fr folder may contain localized strings for French version Peter Rautek 17

Example: Switching Orientation Orientation res/layout-port/main.xml res/layout-land/main.xml Handle orientation change Fixed orientation (no change occurs) Specifiy in AndroidManifest file Custom behavior Specify in AndroidManifest file Implement onconfigurationchanged() Peter Rautek 18

Overview Development with Eclipse Overview Demo Advanced Android Topics 3D Graphics The Java Way The C/C++ Way Debugging OpenGL Configuration, Resources and Localization OpenGL ES History Overview Lab Phase II Peter Rautek 19

OpenGL Who, What, and Most Importantly Why? Application Renderengine / Scenegraph / Graphics Library Windows/Linux OpenGL Hardware Vienna University of Technology 20

OpenGL Specification Since 2006 under control of Khronos Group Non profit consortium Open standards Royalty free Working Groups OpenGL, OpenGL ES, OpenCL, COLLADA, OpenVG, OpenSL ES, EGL, WebGL, etc. Members AMD, Apple Inc., ARM Holdings, Creative Labs, id Software, Ericsson, Intel Corporation, Motorola, Nokia, Nvidia, Samsung Electronics, Sony Computer Entertainment, Sun Microsystems, Texas Instruments, etc. Links: www.khronos.org, www.opengl.org Vienna University of Technology 21

OpenGL Design Goals Platform independent Language independent Consistency Conformance tests and required verification Not pixel exact, but invariant across passes Complete implementations Missing features emulated in software Clean interface State machine Most states are orthogonal Extensibility Favors innovation Vienna University of Technology 22

OpenGL in a Nutshell Small number of primitives Defined by vertices Vienna University of Technology 23

OpenGL in a Nutshell Shading wire frame hidden line flat shading gouraud textured combination Vienna University of Technology 24

Graphics Pipeline Application Scene traversal Object, and camera movement Animation Occlusion/Visibility Culling Level of Detail (LoD) selection Geometry Transformation (model, world, view) View Projection Culling (e.g., back-face) Perspective Division Clipping Screen space transformation Triangle Setup Rasterization Texturing Fragment Shading Depth Buffering Application Command Geometry Rasterization Texture Fragment Display Vienna University of Technology 25

OpenGL vs. OpenGL ES Specification OpenGL ES 1.0 written against OpenGL 1.3 OpenGL ES 1.1 written against OpenGL 1.5 OpenGL ES 2.0 written against OpenGL 2.0 Differences Single vs. Double Fixed vs. Floating No glbegin(), glend(), glvertex() No display lists etc. Peter Rautek 26

Example Supported Not supported Fixed point Single precision Other restrictions Additional enumerant Peter Rautek 27

Short History of OpenGL (ES) 1991 OpenGL ARB created 1992 OpenGL 1.0 (June 30) 1995 OpenGL 1.1 1996 OpenGL specification made public 1998 OpenGL 1.2 2000 OpenGL goes open source 2001 OpenGL 1.3 2001 OpenGL ES 1.0 2002 OpenGL 1.4 2003 OpenGL 1.5 2003 OpenGL ES 1.1 2004 OpenGL 2.0 (shaders) 2004 OpenGL ES 2.0 2008 OpenGL 3.0 2010 OpenGL 4.0 Vienna University of Technology 28

OpenGL ES 1.0 vs. 2.0 Main novelty: shading language GLSL Vertex and fragment shaders Replace fixed functionality Shader: high-level language (C-like) OpenGL driver: compiler and linker for shaders Vertex-, texture coordinates etc.: abstract input values to shader function Arbitrary calculations possible Vienna University of Technology 29

Overview Development with Eclipse Overview Demo Advanced Android Topics 3D Graphics The Java Way The C/C++ Way Debugging OpenGL Configuration, Resources and Localization OpenGL ES History Overview Lab Phase II Peter Rautek 30

Phase II Targeting und Localization Language, screen size Implement a stub LevelActivity, GLSurfaceView, Renderer Framework Integration Icon, return values, documentation Implement your level Functions, game play, first hardware tests Detailed instructions online Peter Rautek 31

Ankündigung - Nächste VO Anton Pirker Cross-Platform Development Laptop mitnehmen Eclipse Java Android Peter Rautek 32

Where to Start - Links Graphics Pipeline Overview (by Dave Salvator) http://www.extremetech.com/article2/0,2845,9722,00.asp Many, many more google for it! Open GL ES Specifications: Android http://www.khronos.org/opengles/spec/ GLSurfaceView http://developer.android.com/reference/android/opengl/glsurfaceview.html Resources and Internationalization http://developer.android.com/guide/topics/resources/resources-i18n.html NDK http://developer.android.com/sdk/ndk/index.html API demos http://developer.android.com/resources/samples/apidemos/src/com/example /android/apis/graphics/index.html Peter Rautek 33

Danke für Ihre Aufmerksamkeit Fragen? Peter Rautek 34