Mobile graphics API Overview

Similar documents
EDAF80 Introduction to Computer Graphics. Seminar 3. Shaders. Michael Doggett. Slides by Carl Johan Gribel,

Lecture 5 Vertex and Fragment Shaders-1. CITS3003 Graphics & Animation

Mobile Application Programing: Android. OpenGL Operation

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

Mobile Application Programing: Android. OpenGL Operation

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

OPENGL RENDERING PIPELINE

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico

What was removed? (1) OpenGL ES vs. OpenGL

CS GPU and GPGPU Programming Lecture 7: Shading and Compute APIs 1. Markus Hadwiger, KAUST

Introduction to Shaders.

Mobile Application Programming: Android. OpenGL Operation

The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)!

Shaders. Slide credit to Prof. Zwicker

The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)!

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

More frames per second. Alex Kan and Jean-François Roy GPU Software

Programming shaders & GPUs Christian Miller CS Fall 2011

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

Dave Shreiner, ARM March 2009

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Broken Age's Approach to Scalability. Oliver Franzke Lead Programmer, Double Fine Productions

Programmable Graphics Hardware

12.2 Programmable Graphics Hardware

Lecture 13: OpenGL Shading Language (GLSL)

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

Architectures. Michael Doggett Department of Computer Science Lund University 2009 Tomas Akenine-Möller and Michael Doggett 1

Introduction to Computer Graphics. Hardware Acceleration Review

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

GLSL 1: Basics. J.Tumblin-Modified SLIDES from:

Copyright Khronos Group, Page 1

CPSC 436D Video Game Programming

Shading Language Update

Understanding M3G 2.0 and its Effect on Producing Exceptional 3D Java-Based Graphics. Sean Ellis Consultant Graphics Engineer ARM, Maidenhead

Understanding Shaders and WebGL. Chris Dalton & Olli Etuaho

Performance Analysis and Culling Algorithms

WebGL and GLSL Basics. CS559 Fall 2016 Lecture 14 October

GPU Quality and Application Portability

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

COMP371 COMPUTER GRAPHICS

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

2D graphics with WebGL

Today. Rendering - III. Outline. Texturing: The 10,000m View. Texture Coordinates. Specifying Texture Coordinates in GL

Hardware Accelerated Graphics for High Performance JavaFX Mobile Applications

Copyright Khronos Group, Page 1

Zeyang Li Carnegie Mellon University

Introduction to OpenGL ES 3.0

Engine Development & Support Team Lead for Korea UE4 Mobile Team Lead

Spring 2011 Prof. Hyesoon Kim

Technical Game Development II. Reference: Rost, OpenGL Shading Language, 2nd Ed., AW, 2006 The Orange Book Also take CS 4731 Computer Graphics

Why modern versions of OpenGL should be used Some useful API commands and extensions

CSE 167: Introduction to Computer Graphics Lecture #13: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Power Efficiency for Software Algorithms running on Graphics Processors. Björn Johnsson Per Ganestam Michael Doggett Tomas Akenine-Möller

Spring 2009 Prof. Hyesoon Kim

WebGL A quick introduction. J. Madeira V. 0.2 September 2017

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Bringing it all together: The challenge in delivering a complete graphics system architecture. Chris Porthouse

Sign up for crits! Announcments

WebGL: Hands On. DevCon5 NYC Kenneth Russell Software Engineer, Google, Inc. Chair, WebGL Working Group

The Transition from RenderMan to the OpenGL Shading Language (GLSL)

Technical Game Development II. Reference: Rost, OpenGL Shading Language, 2nd Ed., AW, 2006 The Orange Book Also take CS 4731 Computer Graphics

CS4621/5621 Fall Basics of OpenGL/GLSL Textures Basics

EDAF80 Introduction to Computer Graphics. Seminar 1. Hierarchical Transformation. Michael Doggett. Some slides by Carl Johan Gribel,

Programming Graphics Hardware

GPGPU on Mobile Devices

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Whiz-Bang Graphics and Media Performance for Java Platform, Micro Edition (JavaME)

Shaders (some slides taken from David M. course)

Shaders CSCI 4239/5239 Advanced Computer Graphics Spring 2014

The Rasterization Pipeline

BCA611 Video Oyunları için 3B Grafik

Programmable Graphics Hardware

Shader Programming 1. Examples. Vertex displacement mapping. Daniel Wesslén 1. Post-processing, animated procedural textures

OpenGL ES 2.0 : Start Developing Now. Dan Ginsburg Advanced Micro Devices, Inc.

A Trip Down The (2011) Rasterization Pipeline

Supplement to Lecture 22

Shaders CSCI 4229/5229 Computer Graphics Fall 2017

Shaders. Introduction. OpenGL Grows via Extensions. OpenGL Extensions. OpenGL 2.0 Added Shaders. Shaders Enable Many New Effects

Evolution of GPUs Chris Seitz

Computer Graphics with OpenGL ES (J. Han) Chapter 6 Fragment shader

CS559 Computer Graphics Fall 2015

Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

CS179: GPU Programming

Water Simulation on WebGL and Three.js

Shading Languages. Ari Silvennoinen Apri 12, 2004

LSU EE Homework 3 Solution Due: 16 November 2012

OPENGL AND GLSL. Computer Graphics

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

Copyright Khronos Group Page 1

CMSC427 OpenGL and JOGL

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Introduction to GLSL. Announcements. Agenda. Course Contents. Patrick Cozzi University of Pennsylvania CIS Fall 2012

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics.

Developer Tools. Robert Strzodka. caesar research center Bonn, Germany

CGT520 Lighting. Lighting. T-vertices. Normal vector. Color of an object can be specified 1) Explicitly as a color buffer

Transcription:

Mobile graphics API Overview Michael Doggett Department of Computer Science Lund University 2009 Michael Doggett and Tomas Akenine-Möller 1

Register Please check to see if your name is on the list, if not add it to the end. 2009 Michael Doggett and Tomas Akenine-Möller 2

First part of this course: Is about writing a mobile 3D application that works on your (modern) mobile phone today Programming assignment 1: simple game To pull that off, we need graphics APIs 2009 Michael Doggett and Tomas Akenine-Möller 3

Important features of graphics APIs (for mobiles)? Open for everyone Cross-platform API Should work everywhere Write application only once Should be neat Lean & mean no unnecessary fat Powerful Expressive Etc 2009 Michael Doggett and Tomas Akenine-Möller 4

Mobile APIs (there are other APIs as well more about that later today) ES=Embedded systems Low-level API: focus on rendering triangles Under the hood: either software implementation or dedicated graphics hardware Built upon OpenGL for desktop computers Highly successful real-time graphics API There is Java API for this (JSR239) 2009 Michael Doggett and Tomas Akenine-Möller 5

Different layers These yellow comments are all about OpenGL ES JSR 239 Defining official Java Bindings to OpenGL ES Usable directly by applications Usable by higherlevel graphics libraries Close to the hardware API provides portability AND flexibility Brings advanced 2D/3D graphics to a wide range of OS platforms Hardware OpenGL ES Engines Java Applications Scenegraph C++ Scenegraph APIs M3G C/C++ Applications Game Engines Middleware Libraries Software OpenGL ES Engines [Slide courtesy of Tom Olsen, Texas Instruments] 2009 Michael Doggett and Tomas Akenine-Möller 6

...involves many companies... [i.e., not only one, or a few] 2009 Michael Doggett and Tomas Akenine-Möller 7

Over 100 companies creating media authoring and acceleration standards 2009 Michael Doggett and Tomas Akenine-Möller 8

OpenGL ES Is for everyone! Example: PS3 uses it IPhone uses it PlayStation III Many mobile phones use it today: IPhone SGX 535 NOKIA N900 PowerVR SGX 530 Sony Ericsson Satio OpenGL ES 2 through PowerVR SGX 530 MS Zune Nvidia Tegra Sony Ericsson W900i GoForce 4800 2009 Michael Doggett and Tomas Akenine-Möller 9

OpenGL ES differences OpenGL 1.0 released in 1992 for desktops OpenGL too big for mobiles Mobile has limited resources (e.g., memory, floating-point hw, etc) ES is mostly a subset of full OpenGL Eliminated redundant/unneeded/expensive functionality Compact and efficient <=50 kb footprint possible Let s look at some design decisions... 2009 Michael Doggett and Tomas Akenine-Möller 10

Example OpenGL / OpenGL ES 1 differences Slide courtesy of Kari Pulli, Nokia 2009 Michael Doggett and Tomas Akenine-Möller 11

OUT in GL ES 2.0 The rendering atom Slide courtesy of Kari Pulli, Nokia 2009 Michael Doggett and Tomas Akenine-Möller 12

More differences... Slide courtesy of Kari Pulli, Nokia 2009 Michael Doggett and Tomas Akenine-Möller 13

The result... Compact API Support for everything needed for mobile graphics Versions: OpenGL ES 1.x is for fixed-function hardware 1.0 in 2003, and 1.1 in 2004 OpenGL ES 2.0 is for programmable shader hardware 2009 Michael Doggett and Tomas Akenine-Möller 14

1.x vs 2.x 2009 Michael Doggett and Tomas Akenine-Möller 15

OpenGL ES 2.0: Shaders Go Mobile Graphics industry has going through a programmable revolution Shader programs running on the GPU enable amazing new visual effects Graphics APIs will need to support shading languages Enabling new visual effects to be created by developers Doom 3 s Zombies Unreal s Rocks Slide courtesy of Tom Olson, Texas Instruments Inc. Halo s Ice Far Cry s Water 2009 Michael Doggett and Tomas Akenine-Möller 16

Done with OpenGL ES... 2009 Michael Doggett and Tomas Akenine-Möller 17

Done with OpenGL ES 2.0... Adrenaline Golf uses GL2 shaders for water reflection on iphone 3GS 2009 Michael Doggett and Tomas Akenine-Möller 18

Scene Graphs Organizes geometry and other things in a hierarchy (usually a tree-like structure) called the scene graph In 2D space Scene graph 2009 Michael Doggett and Tomas Akenine-Möller 19

Scene graph: what for? Example: at each node, we can set a transform Gives us hierarchical animation E.g., the planets rotate around the sun, but moons rotate around planets (which rotate around the sun) Original positions of objects: mygroup myleftgroup myrightgroup y x Let s try this: myrightgroup.translate(2,1,0); 2009 Michael Doggett and Tomas Akenine-Möller 20

Scene graph example (cont d) myrightgroup.translate(2,1,0); mygroup y myleftgroup myrightgroup x 2009 Michael Doggett and Tomas Akenine-Möller 21

Scene graph example (cont d) Look in the RenderChimp.h for a quick intro and other.h files for comments More details in Magnus SceneGraph intro on Tuesday Group *g; g = scenegraph.creategroup(...); g->attachchild(node *child); g->detachchild(node *child); g->getchild(u32 index); etc Example: mygroup- >attachchild(myleftgroup); TriangleMesh *mesh0, *mesh1; Light *mylight; Camera *mycamera; Sprite *mysprite; mesh0->attachchild(mesh1);...and more. mesh0 = scenegraph.createtrianglemesh(...); mesh0->translate(...); mesh0->scale(...); mesh0->rotate(...); mesh0->settranslate(...); mesh0->setscale(...); etc 2009 Michael Doggett and Tomas Akenine-Möller 22

There are other APIs as well Mobile Direct3D For Microsoft Windows CE and Windows Mobile 2009 Michael Doggett and Tomas Akenine-Möller 23

OpenGL Shading Language (GLSL) OpenGL ES 2.0 shading language C like language for programming GPUs Basically the same language for vertex and fragment shaders/programs 2009 Michael Doggett and Tomas Akenine-Möller 24

GLSL - Types Types float, int, bool, vec2, vec3, vec4, etc... sampler2d, samplercube Type qualifiers const // compile-time constant uniform // constant across primitive attribute // vertex shader per vertex input varying // interpolated data from vertex to pixel Different quantities for vertex and fragment shader Precision qualifiers for float and int lowp (s1.8fixed), mediump (se5m10), highp (se8m16) Must be specified for floats in fragment shader 2009 Michael Doggett and Tomas Akenine-Möller 25

GLSL - Built-In Types Most GLSL built-ins removed Vertex shader outputs gl_position Fragment shader outputs gl_fragcolor, gl_fragdepth 2009 Michael Doggett and Tomas Akenine-Möller 26

OpenGL Shading Language Structures and arrays Operators work with 1-4 component types {x, y, z, w}, {r, g, b, a}, {s, t, p, q} vector.wzyx // swizzles User defined functions Built-in functions sin, cos, pow, log2, sqrt, normalize, noise,... 2009 Michael Doggett and Tomas Akenine-Möller 27

OpenGL Shading Language Flow control if, if-else, for, while, do-while discard // fragment only Preprocessor directives e.g #define, #undef, #if, #else, #endif, etc comments // /* */ 2009 Michael Doggett and Tomas Akenine-Möller 28

Simple shaders Vertex shader uniform mat4 ModelViewProjection; attribute vec3 Vertex; attribute vec3 Color; varying mediump vec4 icolor; void main(void) { gl_position = ModelViewProjection * vec4(vertex.xyz, 1.0); icolor = Color; } Fragment shader varying mediump vec4 icolor; void main() { gl_fragcolor = icolor; } 2009 Michael Doggett and Tomas Akenine-Möller 29

Shader development ATI RenderMonkey Nvidia FX Composer Mac OpenGL Shader Builder 2009 Michael Doggett and Tomas Akenine-Möller 30

Next week Time to start working on programming assignment #1: Simple game Will be released tomorrow Tuesday: seminar/lecture at 10:00 About Scene Graph, C++ and the assignment Check out the discussion forum every now and then Ahhh, and then after that......the real fun begins! 2009 Michael Doggett and Tomas Akenine-Möller 31

The end 2009 Michael Doggett and Tomas Akenine-Möller 32