Coding OpenGL ES 3.0 for Better Graphics Quality

Similar documents
Hands-On Workshop: 3D Automotive Graphics on Connected Radios Using Rayleigh and OpenGL ES 2.0

Rendering Objects. Need to transform all geometry then

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

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

GLSL Overview: Creating a Program

Mobile HW and Bandwidth

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

CS451Real-time Rendering Pipeline

Lecture 2. Shaders, GLSL and GPGPU

Computer graphics 2: Graduate seminar in computational aesthetics

Vulkan and Animation 3/13/ &height=285&playerId=

GeForce3 OpenGL Performance. John Spitzer

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

EE 4702 GPU Programming

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Vulkan: Architecture positive How Vulkan maps to PowerVR GPUs Kevin sun Lead Developer Support Engineer, APAC PowerVR Graphics.

Mobile Performance Tools and GPU Performance Tuning. Lars M. Bishop, NVIDIA Handheld DevTech Jason Allen, NVIDIA Handheld DevTools

Real - Time Rendering. Pipeline optimization. Michal Červeňanský Juraj Starinský

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

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

The Graphics Pipeline

Shaders. Slide credit to Prof. Zwicker

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

Profiling and Debugging Games on Mobile Platforms

Copyright Khronos Group Page 1

Mali & OpenGL ES 3.0. Dave Shreiner Jon Kirkham ARM. Game Developers Conference 27 March 2013

Mali Developer Resources. Kevin Ho ARM Taiwan FAE

LPGPU Workshop on Power-Efficient GPU and Many-core Computing (PEGPUM 2014)

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Models and Architectures

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

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

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL

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

Com S 336 Final Project Ideas

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

Optimisation. CS7GV3 Real-time Rendering

Lecture 25: Board Notes: Threads and GPUs

Rasterization Overview

Dave Shreiner, ARM March 2009

Deferred Splatting. Gaël GUENNEBAUD Loïc BARTHE Mathias PAULIN IRIT UPS CNRS TOULOUSE FRANCE.

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

Game Graphics & Real-time Rendering

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

Starting out with OpenGL ES 3.0. Jon Kirkham, Senior Software Engineer, ARM

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

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

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

Spring 2009 Prof. Hyesoon Kim

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

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

The Rendering Pipeline (1)

GPU Memory Model. Adapted from:

CS475/CS675 - Computer Graphics. OpenGL Drawing

Windowing System on a 3D Pipeline. February 2005

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Working with Metal Overview

GPU Memory Model Overview

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

Spring 2011 Prof. Hyesoon Kim

The Ultimate Developers Toolkit. Jonathan Zarge Dan Ginsburg

PowerVR Hardware. Architecture Overview for Developers

Shader Series Primer: Fundamentals of the Programmable Pipeline in XNA Game Studio Express

Could you make the XNA functions yourself?

Getting fancy with texture mapping (Part 2) CS559 Spring Apr 2017

OpenGL with Qt 5. Qt Developer Days, Berlin Presented by Sean Harmer. Produced by Klarälvdalens Datakonsult AB

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

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

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

PERFORMANCE OPTIMIZATIONS FOR AUTOMOTIVE SOFTWARE

2.11 Particle Systems

OpenGL on Android. Lecture 7. Android and Low-level Optimizations Summer School. 27 July 2015

Course Recap + 3D Graphics on Mobile GPUs

Ciril Bohak. - INTRODUCTION TO WEBGL

Graphics Hardware. Instructor Stephen J. Guy

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

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

OPENGL RENDERING PIPELINE

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

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

POWERVR MBX & SGX OpenVG Support and Resources

ArcGIS Runtime: Maximizing Performance of Your Apps. Will Jarvis and Ralf Gottschalk

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

CS452/552; EE465/505. Image Processing Frame Buffer Objects

CSE4030 Introduction to Computer Graphics

Introduction to Computer Graphics with WebGL

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

VR Rendering Improvements Featuring Autodesk VRED

Vulkan Multipass mobile deferred done right

Lecture 9: Deferred Shading. Visual Computing Systems CMU , Fall 2013

SIGGRAPH Briefing August 2014

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

OpenGL BOF Siggraph 2011

Introduction to OpenGL ES 3.0

Achieving High-performance Graphics on Mobile With the Vulkan API

Lecture 13: OpenGL Shading Language (GLSL)

Introduction to OpenGL

Moving Mobile Graphics Advanced Real-time Shadowing. Marius Bjørge ARM

PowerVR Series5. Architecture Guide for Developers

Transcription:

Coding OpenGL ES 3.0 for Better Graphics Quality Part 2 Hugo Osornio Rick Tewell A P R 1 1 t h 2 0 1 4 TM External Use

Agenda Exercise 1: Array Structure vs Vertex Buffer Objects vs Vertex Array Objects (30 minutes elapsed) Exercise 2: Copying Buffer Objects (40 Minutes Elapsed) Exercise 3: Instanced Rendering (50 Minutes Elapsed) Exercise 4: Primitive Restart (60 Minutes Elapsed) Exercise 5: Texture Compression (70 Minutes elapsed) Exercise 6: Multiple Render Targets (90 Minutes) Exercise 7: Transform Feedback (110 Minutes) External Use 1

Exercise 1 Array Structure vs Vertex Buffer Objects vs Vertex Buffer Objects +Vertex Array Objects Vertex Array Structure Approach Simple and inefficient Vertex Buffer Object Efficient yet tricky cumbersome if you have to switch configurations Vertex Array Objects Efficient way to switch between configurations! External Use 2

Introduction In order to fully grasp the advantages of Vertex Array Objects. Let s first understand how did OpenGL ES 2.0 handled Vertex Attributes using: Array of Structures. Vertex Buffer Objects. External Use 3

Array of Structures How does it work? Vertex shaders require a set of attributes that are supplied per vertex in order to be able to define position, color, texture coordinates and normals. Vertex Arrays are stored in a single buffer structure. These structures are located in client memory space (In your application s memory). And EVERY TIME a draw function is called, the vertex attributes are copied to the GPU. External Use 4

Array of Structures - Coding PENDING TO INCLUDE HANDS ON STEPS. Coding Exercise will be 10 minutes long. External Use 5

Vertex Buffer Object How does it work? Vertex Buffer Objects allow us to allocate vertex data in memory directly accessible for the GPU (remember that using Vertex Arrays, the Vertex Attribute Data needed to be copied from Client Space to GPU space) thus saving us the copy process on each primitive draw call. There are 2 type of buffers that can be created for a vertex shader to use. Array Buffer Object: Store Vertex Data, vertex position, color, normal, texture coordinates. Element Array Buffer Object: Store Indices to be used by the gldrawelements* functions. External Use 6

Vertex Buffer Object - Coding PENDING TO INCLUDE HANDS ON STEPS estimated exercise time 10 minutes. External Use 7

Vertex Array Object How does it work? As you noticed with the previous example, you require a lot of API calls to set, enable and bind a vertex buffer object. And so, switching between 2 different vertex array configurations will involve CPU time spent on those calls. In OpenGL ES 3.0, the concept of Vertex Array Objects was introduced. This object includes all states required to switch between vertex array/vertex buffer object configurations, therefore we avoid plenty of API calls to set attributes, EVERYTIME the configurations are done. External Use 8

Vertex Array Object - Coding PENDING TO INCLUDE HANDS ON STEPS estimated time 10 minutes External Use 9

Exercise 2 Copying Buffer Objects Advantages How to do it External Use 10

Copying Buffer Objects How does it work? On previous examples we used the glbufferdata and glbuffersubdata to copy information from Client Space to Device Space. OpenGL ES 3.0 provides a way to copy data to one buffer object to another buffer object without using Client Memory space, that is, entirely on GPU memory. Its usage is quite simple, glbindbuffer(gl_copy_read_buffer, source_buffer); glbindbuffer(gl_copy_write_buffer, dest_buffer); glcopybuffersubdata(gl_copy_read_buffer, GL_COPY_WRITE_BUFFER, source_offset, write_offset, data_size); External Use 11

Copying Buffer Objects- Coding PENDING TO INCLUDE HANDS ON STEPS (5 minutes) External Use 12

Exercise 3 Instanced Rendering What is it? How to do it External Use 13

Instanced Rendering How does it work? Instanced Rendering: Useful to render meshes/objects that have similar geometry with different attributes (transformation matrix, color, size) using only ONE draw call. EXTREMELY USEFUL on crowd drawing, where you need to draw the same object multiple times. Imagine that you have 100 objects. In order to draw them all, you might use 100 gldraw* functions, however, for each call, your CPU will lose valuable time. With gldraw*instanced you will only lose that time once instead of 100 times. External Use 14

Copying Buffer Objects- Coding PENDING TO INCLUDE HANDS ON STEPS (10 minutes) External Use 15

Exercise 4 Primitive Restart What is it? How to do it External Use 16

Primitive Restart What is it? In OpenGL ES 2.0, if you wanted to draw triangle strips from disconnected primitives, you had to add a degenerate triangle (A triangle with collinear vertices) to the Array Attribute. Primitive Restart lets you store a special value within the Array, so you can set the OpenGL State Machine, to restart an OpenGL Rendering instruction, with the next data Item. External Use 17

Primitive Restart - Coding PENDING TO INCLUDE HANDS ON STEPS (10 minutes) External Use 18

Exercise 5 Texture Compression What is it? How to do it External Use 19

Texture Compression What is it? OpenGL ES 2.0 did not define formats for Compressed Images. It defined a mechanism to load compressed image data. This unleashed every big time GPU vendor to create HW specific compression extensions, and the one to pay was the OpenGL developer, having to support different compression formats on different platforms. OpenGL ES 3.0 defined ETC2 and EAC as standard compressed textures format. External Use 20

Texture Compression - Coding PENDING TO INCLUDE HANDS ON STEPS (10 minutes) External Use 21

Exercise 6 Multiple Render Targets What is it? How to do it External Use 22

Multiple Render Targets What is it? It is a feature that allows the pipeline to Render images to multiple color buffers at once. The fragment shader outputs several colors, normals, depths or texture coordinates. A key thing to understand is that you are not writing the same data to all the render targets. Great for deferred shading, where in order to create a scene, you have to render over it more than once to get the expected result. External Use 23

Multiple Render Targets - Coding PENDING TO INCLUDE HANDS ON STEPS (20 minutes) External Use 24

External Use 25

Exercise 7 Transform Feedback What is it? How to do it External Use 26

Transform Feedback - What is it? OpenGL ES 3.0 introduces a new feature that allows the vertex shader outputs to selectively be written to an output buffer (in addition to, or instead of being passed to the fragment shader). Simply put, we can retrieve the vertices after they've passed through the vertex or geometry shaders. This enables you to execute GPU based animation. External Use 27

Transform Feedback - Coding PENDING TO INCLUDE HANDS ON STEPS (20 minutes) External Use 28

www.freescale.com 2014 Freescale Semiconductor, Inc. External Use