Module 13C: Using The 3D Graphics APIs OpenGL ES

Similar documents
E.Order of Operations

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Programming Guide. Aaftab Munshi Dan Ginsburg Dave Shreiner. TT r^addison-wesley

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Lecture 2. Shaders, GLSL and GPGPU

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture 10

CS 130 Final. Fall 2015

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

CHAPTER 1 Graphics Systems and Models 3

Models and Architectures


OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak

Dave Shreiner, ARM March 2009

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

CS4620/5620: Lecture 14 Pipeline

Rendering Objects. Need to transform all geometry then

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Texture Mapping and Special Effects

Mattan Erez. The University of Texas at Austin

HE COMPLETE OPENGL PROGI FOR WINDOW WIND

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Spring 2009 Prof. Hyesoon Kim

CS451Real-time Rendering Pipeline

Programming Graphics Hardware

Rasterization Overview

Computer Graphics: Programming, Problem Solving, and Visual Communication

Optimizing Games for ATI s IMAGEON Aaftab Munshi. 3D Architect ATI Research

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

OpenGL. Toolkits.

PowerVR Series5. Architecture Guide for Developers

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

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

POWERVR MBX. Technology Overview

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Graphics Processing Unit Architecture (GPU Arch)

RASTERISED RENDERING

Ciril Bohak. - INTRODUCTION TO WEBGL

Introduction to OpenGL

Lecture 4 Advanced Computer Graphics (CS & SE )

Spring 2011 Prof. Hyesoon Kim

The Rasterization Pipeline

The Application Stage. The Game Loop, Resource Management and Renderer Design

CS 4620 Program 3: Pipeline

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

Graphics Pipeline & APIs

CS 354R: Computer Game Technology

CS 130 Exam I. Fall 2015

Working with Metal Overview

Introduction to Computer Graphics with WebGL

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

Computer Graphics. Shadows

03 RENDERING PART TWO

OpenGL Essentials Training

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

CS 464 Review. Review of Computer Graphics for Final Exam

Computer Graphics 10 - Shadows

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Buffers, Textures, Compositing, and Blending. Overview. Buffers. David Carr Virtual Environments, Fundamentals Spring 2005 Based on Slides by E.

Graphics Hardware, Graphics APIs, and Computation on GPUs. Mark Segal

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Drawing Fast The Graphics Pipeline

World Coordinate System

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System

Scanline Rendering 2 1/42

Real-Time Rendering. Tomas Möller Eric Haines. A K Peters Natick, Massachusetts

Rendering approaches. 1.image-oriented. 2.object-oriented. foreach pixel... 3D rendering pipeline. foreach object...

Evolution of GPUs Chris Seitz

Graphics Hardware and OpenGL

Textures. Texture coordinates. Introduce one more component to geometry

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

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

The Rendering Pipeline (1)

OpenGL refresher. Advanced Computer Graphics 2012

Structure. Woo-Chan Park, Kil-Whan Lee, Seung-Gi Lee, Moon-Hee Choi, Won-Jong Lee, Cheol-Ho Jeong, Byung-Uck Kim, Woo-Nam Jung,

Illumination and Shading

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Discrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of

Interpolation using scanline algorithm

Graphics Pipeline & APIs

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

Hot Chips Bringing Workstation Graphics Performance to a Desktop Near You. S3 Incorporated August 18-20, 1996

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

The Rasterization Pipeline

Lecturer Athanasios Nikolaidis

The OpenGL R Graphics System: A Specification (Version 1.3)

- Rasterization. Geometry. Scan Conversion. Rasterization

TSBK03 Screen-Space Ambient Occlusion

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

1.2.3 The Graphics Hardware Pipeline

GPU Memory Model. Adapted from:

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Mattan Erez. The University of Texas at Austin

Introduction to the OpenGL Shading Language

Transcription:

Module 13C: Using The 3D Graphics APIs OpenGL ES BREW TM Developer Training Module Objectives See the steps involved in 3D rendering View the 3D graphics capabilities 2 1

3D Overview The 3D graphics library uses the industry standard OpenGL ES API Supports custom 3D hardware rendering in handsets 3 OpenGL ES Lightweight API for advanced 3D graphics capabilities on mobile devices It is based on well-defined subset profiles of the industry standard OpenGL 3D API available on Unix and the PC 4 2

Strong Industry Support for OpenGL-ES Promoting Members Contributing Members 5 A Few Definitions Rendering The process of creating life-like images on a screen using mathematical models and formulas to add shading, color, lighting, and textures to a 2D or 3D wire frame Rendering Engine "Rendering Engine" generically applies to the part of the graphics engine that draws 3D primitives, usually triangles or other simple polygons. In most implementations, the rendering engine is responsible for interpolation of edges and "filling in" the triangle 6 3

All About Triangles V 1 Vertex Edge Face V 2 The simplest polygon V 3 1,014 vertices 1,816 triangles 7 Reducing Vertices: Triangle Strip V 1 V 4 V 6 Triangle Vertices T 2 T 4 1 2 1,2,3 1,3,4 T 1 T 3 T 5 3 3,5,4 4 4,5,6 V 2 V 3 V 5 V 7 5 5,7,6 Example: 5 triangles = 15 vertices, but represented as a strip there is only 7 vertices 8 4

Reducing Vertices: Triangle Fan V 6 V 5 Triangle Vertices T 4 1 1,2,3 T 5 T 3 V 1 V 4 2 1,3,4 V 7 3 1,4,5 T 6 T 2 4 1,5,6 V 2 T 1 V 3 5 6 1,6,7 1,7,2 Example: 6 triangles = 18 vertices, but represented as a fan there is only 7 vertices 9 Shading Triangles Flat Shading Each triangle is rendered with only one color, the color of the triangle is the average color of the 3 vertices Smooth Shading Shading is a more complex process using algorithms to create a color gradient across the surface of each triangle 10 5

Alpha Blending The alpha value is really a mask -- it specifies how the pixel's colors should be merged with another pixel when the two are overlaid, one on top of the other. Rendering overlapping objects that include an alpha value is called alpha blending. 25% 50% 75% 100% Alpha = 64 Alpha =128 Alpha =192 Alpha = 255 Alpha value is normally provided in the range (0-1), shown here normalized to (0-255) 11 Lighting Ambient Equal light in all directions. Background light level caused by multiple reflections from all objects in the scene. Diffuse Diffuse light comes from one direction, then as it hits a surface, it is scattered equally in all directions. Specular Light comes from one direction, then, bounces off in a preferred direction as it hits a surface. Material properties of the surface (shininess, emissive values) change the appearance or highlights of the light. 12 6

Perspective Correction Takes into account the effect of the Z value in a 3D scene while mapping texels (texture mapping pixels) onto the surface of polygons Without perspective correction, textured objects will appear to shift and 'tear' in an unrealistic way Texture coordinates are interpolated linearly when applied to objects If the object is projected into 3D space adjustment needs to be made to the texture coordinates No perspective correction With perspective correction 13 A Real Basic 3D Pipeline Vertex List Model View Transformation Clipping Texture Lighting Rasterization 14 7

Hardware Acceleration Hardware acceleration increases the 3D rendering capabilities in various ways Increases number of triangles calculated per second for smother looking images Increases pixel fill rate per second for smoother animation Allows better blending and lighting techniques for more realistic images DSP hardware acceleration Custom 3D hardware, like on a PC 15 OpenGL-ES Graphics Available Functions Geometry Processing Vertex Arrays Points, Lines, Triangles Matrix Stack Viewport, DepthRange Vertex Lighting ShadeModel Rasterization Points & anti-aliased points Lines & anti-aliased lines Polygons Face Culling PolygonOffset - fill mode Texture Mapping 2D Textures Wrap repeat, edge_clamp Compressed Texture TexSubImage, CopyTexImage Multitexture (1 texture supported) RGBA pixel and packed pixel formats, L, LA All Filters Fragment Processing Fog Scissor Test Alpha Test Depth Test Blending Logic Op Dither Framebuffer Operations/Miscellaneous Clear ReadPixels / Alpha Test / Dither Flush/Finish Hint Get-static state (constants) 16 8

OpenGL and BREW Download from BREW developer s site BREW SDK Extension for OpenGL ES Include files #include <gles/gl.h> #include <gles/egl.h> #include "igl.h" 2 BREW Interfaces AEECLSID_GL - Interface to GL AEECLSID_EGL - Interface to platform specific layer sitting between GL and BREW device Libraries for Windows and ARM 17 OpenGL and BREW if( ISHELL_CreateInstance(m_applet.m_pIShell, AEECLSID_GL, (void **)&m_pigl)!= SUCCESS ) return FALSE; else IGL_Init(m_pIGL); if( ISHELL_CreateInstance(m_applet.m_pIShell, AEECLSID_EGL, (void **)&m_piegl)!= SUCCESS ) return FALSE; else IEGL_Init(m_pIEGL); 18 9

OpenGL and BREW Uses IDISPLAY_GetDeviceBitMap() to get pointer to screen s bitmap buffer Pointer passed to EGL routines EGL routines use dual buffers and manager buffer swapping IBitmap* pdbitmap; IDISPLAY_GetDeviceBitMap(pMe->pIDisplay, &pme->pdbitmap); 19 OpenGL and BREW BREW applet is predominately a shell Game logic isolated from BREW - most of the program consists of calls to gl functions contained within the libraries Key Events passed to game logic Timers, File IO, Networking handled by BREW 20 10

Examples BREW OpenGL ES Sample code ogles_demo_02 www.gamedev.net search brew www.opengl.org http://www.khronos.org/opengles 21 11