We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byKyle Skinner
Modified over 2 years ago
© Copyright Khronos Group, Page 1 Optimizing OpenGL ES Applications Kristof Beets 3 rd Party Relations Manager - Imagination Technologies
© Copyright Khronos Group, Page 2 Imagination: World Leader in SoC IP Cores Products - Silicon and software IP for multimedia and communication Customers - Global semiconductor, fast-moving fabless businesses and system companies People - >300 with over 75% highly skilled engineers PowerVR MBX de facto standard for Mobile 3D Graphics - In use by 6 of the top 10 semi-conductor companies - Several products already in the market and many more coming soon…
© Copyright Khronos Group, Page 3 PowerVR MBX Family OpenGL ES 1.x Compliant Family Members - PowerVR MBX - PowerVR MBX Lite High Quality, High Performance Texture Filtering - Bi-Linear Filtering with MIP-Mapping at Full Speed PowerVR Texture Compression: 2bpp and 4bpp - Allows higher quality, higher resolution textures for same bandwidth and storage cost High Quality, High Performance Anti-Aliasing Internal True Color DOT3 Per-pixel Lighting Optional PowerVR VGP - Dedicated programmable Vertex Processing Unit - Allows high polygon throughput - Advanced features: Skinning, Curved Surfaces, Lighting
© Copyright Khronos Group, Page 4 PowerVR SGX Family OpenGL ES 2.x Wireless SGX Family Members - SGX510, SGX520, SGX530 - sizes ranging from less than 2mm 2 to 8mm 2 in a 90nm process. Universal Scalable Shader Engine (USSE) - Scalable multi-threaded processing engine - Vertex, Pixel, Video, Imaging, Physics, etc. Processing - Single Compiler Advanced Geometry and Pixel Processing - Procedural Geometry, Higher Order Surfaces, etc. - Advanced Vertex Shaders - Advanced Pixel Shaders such as Parallax bump mapping - Advanced Shadow Techniques - Stencil Shadows, Shadow maps, etc. Programmable Anti-Aliasing On-chip Multiple Render Targets (MRTs) IEEE 32 Bit Floating Point Internal Accuracy Much more…
© Copyright Khronos Group, Page 5 PowerVR Butterflies Demo Demo shows a high number of butterflies in a dynamic flock - Demo originally used for Arcade Hardware - Illustrates Alpha Blending Capability - Illustrates High Number of Textures and Texture Compression Performance for "flocking algorithm only" : Fully Floating Point Algorithm (Without FPU) 72 FPS Fully Fixed Point Algorithm 304 FPS Fully Fixed Point Algorithm with ASM Optimizations 373 FPS Fully Floating Point Algorithm (With FPU) 415 FPS Optimised Algorithm Fully Floating Point (With FPU) FPS
© Copyright Khronos Group, Page 6 Butterflies Demo : Lessons Learned Floating point on non-floating point device is SLOW - about 6x slower in this case Only use Float on non-float device when ABSOLUTELY required ! - Non performance critical situations e.g. offline calculations - Fixed Point accuracy insufficient Use ASM Optimised Fixed Point where required - Only most critical ops need ASM tweaking Use Float if device supports Floating Point - E.g. Floating Point Unit has faster divide op than the Fixed Point Core But do your own benchmarking - Not all algorithms and platforms are equal... Using a smart efficient optimised algorithm benefits all cases... - Essential for high performance on Mobile HW !
© Copyright Khronos Group, Page 7 Reducing Graphics API CPU Load Every API call introduces overhead which costs valuable CPU cycles - Aim to minimize the number of API calls - Matrix Ops and Draw Calls can be expensive How to reduce the number of API calls ? - Batching (grouping) allows reduction of the number of API Calls - Different Texture can break up DrawCalls - Consider using a Texture Atlas / Texture Page -One large texture containing several sub-textures -This makes it possible to draw multiple objects in a single draw call For optimal geometry throughput use Sorted Indexed Triangles - Sorting improves memory access patterns - Sorting makes optimal use of caches - Ideally use strip ordered indexed triangles - PowerVR SDK contains Optimised Geometry Exporter and Geometry Optimisation Lib - Ideally use Multi_Draw_Arrays Extension - Submit multiple strips in a single draw call – minimal API overhead
© Copyright Khronos Group, Page 8 Further Polygon Submission Optimisations Interleave the per vertex data elements (Position, Normal, Color, Etc.) - Keep data that belongs together close together in memory ! Simplify the geometry complexity - Use a polygon reduction algorithm - Use DOT3 lighting or textures to represent fine detail Reduce the size of vertex components - Use smaller formats whenever possible - E.g. Use byte instead of float Dont store constants per vertex - Use Diffuse, Specular, Factor, etc. Colours - Make sure to disable client states that are not required - glEnableClientState / glDisableClientState - Use Vertex Shader constants if available Consider using Level Of Detail (LOD) - Dont use 1000s of polygons for an object 10s of pixels on screen DOT3No DOT3
© Copyright Khronos Group, Page 9 Draw Order / Sorting No need to sort objects front to back - Likely to bottleneck on the CPU due to increase in number of state changes (API overhead) - PowerVR Hardware handles HSR efficiently irrespective of depth render order. Do use High-level Render State Batching - Draw all opaque objects first - Group by number of Texture Layers -E.g. First all Dual Textured Objects and then all Single Textured Objects - Draw all Alpha Blended and Alpha Tested Objects Last Use High-Level Geometry Culling - Do not submit the whole world geometry every frame - Use Fog to hide sudden pop-in effect
© Copyright Khronos Group, Page 10 Let there be Light… OpenGL Lighting is quite complex and can thus be CPU & VGP heavy - OpenGL implementations need to be conformant…so no shortcuts can be taken! Use the simplest light type that works for your application - E.g. parallel lights are cheaper than spot lights Use the fewest number of lights that work for your application Pre-compute lighting whenever you can - Static models with static lights - Pre-compute offline and store in color array or textures Only enable lighting when needed - E.g. On moving objects, or if the light properties are changing - Consider caching lighting if an object stays static for long times - Calculate once use many Could implement your own lighting algorithm - Implement exactly the algorithm you need and want - Use custom IMG Vertex Program (VGP Lighting) or custom code (CPU Lighting) - Can take shortcuts and use hacks... as long as it does the job! - Do verify that its faster and/or better looking than default OpenGL Lighting… Consider pixel lighting - Light maps (as used by most PC Games instead of Vertex Lighting) - DOT3 Per Pixel Lighting
© Copyright Khronos Group, Page 11 Texturing Use Compressed Textures whenever possible ! - Various formats depending on hardware (DXT, PVRTC, ETC, …) - PVRTC2 = 2bpp & PVRTC4 = 4bpp - less bandwidth, less storage, smaller distribution size of the application - Don't use palletised textures - Less quality and less performance then PVRTC2/4 Alternatively use 16bpp Texture Formats - 32bpp is usually overkill on a 16bpp LCD Remember special types - Luminance I8 and Luminance_Alpha IA88 can be useful Always use MIPMapping - Ideally use: LINEAR_MIPMAP_NEAREST - Only use Trilinear when needed Use sensible Texture Sizes - No 1024x1024 Textures for objects that cover a quarter of a QVGA screen - Do use large compressed textures for Texture Pages/Atlas, even 2048x2048 Load all Textures up front - Before rendering create and load all textures - Consider Warm-up phase which touches all textures once - Avoid mid action texture create and uploads and/or changes
© Copyright Khronos Group, Page 12 Multi-texture vs Multi-pass Use Multi-Texturing over Multi-Pass! - Saves draw calls - Considerably reduces vertex processing work - Saves render states changes - Reduces driver overhead and thus CPU Load - Avoids potential Z fighting issues - Subsequent passes with e.g. lighting disabled can yield different depth values 2 Quads 1 Texture Each Multi-Pass 1 Quad 2 Textures in 1 go Multi-Texture Quake 3 : Light Maps Only Quake 3 : Light Maps + Base Map Drawn with a single geometry pass Possible through Multi-Texturing
© Copyright Khronos Group, Page 13 Maintain CPU and GPU Parallelism Normally CPU and 2D/3D Graphics Core work in Parallel… … but some ops can break this parallelism! Do NOT attempt to access the color buffer directly - CPU will stall until HW completes the render - And the GPU stalls while the CPU does its work - Results in lost CPU and GPU performance - Avoid glReadPixels() glCopyTexImage2D() glCopyTexSubImage2D() Find workarounds to avoid accessing the color buffer directly - E.g. use ray casting algorithm for a lens flare effect instead of glReadPixels()
© Copyright Khronos Group, Page 14 Java 3D Graphics M3G (JSR-184) layered on top of OpenGL-ES functionality - OpenGL ES performance recommendations remain valid: - Minimise API calls - especially geometry draw calls - Use Optimised Triangle Strips -Make sure your M3G Exporter tool does a good job… - Batching -E.g. use Group object to bundle meshes - Always flag opaque objects as opaque - Avoid Mid-scene texture uploads/changes - Etc. JAVA makes it easy to mix MIDP 2D and JSR184 based 3D - Do NOT mix 2D and 3D operations within the same frame - Majority of current implementations use CPU for 2D and GPU for 3D - E.g. No MIDP Text Drawing, No Filled Rectangles, etc. within 3D Frame - Future JAVA implementations will solve this performance issue
© Copyright Khronos Group, Page 15 Join the PowerVR Insider Program PowerVR Technical Support & Co-Marketing Programme - Direct Technical Support through , phone & on-site - Assure Optimal Compatibility - Highest Possible Performance - Leading Image Quality - Extensive Support for Key Partners -Including Middleware Vendors, JAVA VM & JSR Vendors, Benchmarks, Launch Titles - Free SDKs including sample code, documentation and extensive toolset - Joint Marketing Activities - Press Releases, Joint Event Participation, Website presence, etc. PowerVR Insider brings the whole ecosystem around 3D Graphics together - From Software Developers to Mobile Phone OEMs - Provide introductions between PowerVR Insiders - Assure co-operation between PowerVR Insiders To join send to:
© Copyright Khronos Group, Page 16 PowerVR MBX Content Selection of available content 3D Golf 3DMarkMobile06 Bling My Ride Chopper Fight Cube Engine Enigmo Everybody's Golf Mobile 2 GeoRallyEx Interstellar Flames Jackpot Casino Kastor Platform Onimusha: Curtain of Darkness Quake III CE Quake Mobile + Expansion Packs Ridge Racer Mobile Scaleform VGx And more than 73 native 3D-Game Titles on SKTelecom GXG Services Middleware + All available content Synergenix Mophun EA/Criterion Renderware TAO Intent Game Player Speed Sphere SSX III Stuntcar Extreme The Lost Sister Tin Star Tony Hawk Pro Skater Tony Hawk's Pro Skater 2 ToyGolf Vijay Singh Pro Golf 2005 Virtual Pool Mobile VIVID UI VIVID Message Xmen Legends Yeti3D Engine
© Copyright Khronos Group, Page 17 Example: Virtual Pool Mobile by Celeris High-detail 3D Polygonal Background Software Version OpenGL-ES PowerVR MBX Hardware Accelerated Version High Quality Texture Filtering & Increased Texture resolution Reflection Mapping Alpha-Blended Menu Increased Performance Higher Screen Resolution & Increased Polygon Counts
© Copyright Khronos Group, Page 18 Example: Quake Mobile by Pulse Interactive Quake III Arena also already available…
© Copyright Khronos Group, Page 19 Any Questions?
Next-Generation Graphics Programming on Xbox 360 Matt Lee Software Design Engineer Game Technology Group Microsoft Corporation.
The A to Z of DX10 Performance Cem Cebenoyan, NVIDIA Nick Thibieroz, AMD.
Mass Market Applications of Massively Parallel Computing Chas. Boyd.
© Copyright Khronos Group, Page 1 Khronos Overview Neil Trevett Vice President Mobile Content, NVIDIA President, Khronos Group.
Visibility Optimization for Games Sampo Lappalainen Lead Programmer Umbra Software Ltd.
1 of 50 CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © October 29, 2013 Ray Tracing Rendering and Techniques
Graphics on a Stream Processor Peter Djeu March 20, 2003.
ADAMA UNIVERSITY SCHOOL OF ENGENEERING & INFORMATION TECHNOLOGIES Sem. II,2010/11 INSTRUCTOR TARIKU W OPERATING SYSTEM (IT3016)
1 GREY BOX TESTING Web Apps & Networking Session 3 Boris Grinberg
What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals: Execute.
1 Advanced Database Application Development Performance Tuning Performance Benchmarks Standardization E-Commerce Legacy Systems.
Direct3D 10 and Beyond Peter-Pike Sloan Microsoft Corporation.
Future graphics in games Cevat Yerli Crytek CEO Anton Kaplanyan Lead researcher.
Introduction to Simulations on GPUs Kalyan S. Perumalla, Ph.D. Senior Researcher Oak Ridge National Laboratory Adjunct Professor Georgia Institute of.
Copyright 2011 John Wiley & Sons, Inc Business Data Communications and Networking 11th Edition Jerry Fitzgerald and Alan Dennis John Wiley & Sons, Inc.
Mark Sherman Danilo Centazzo. 2 Introduction to FEMAP Agenda Day 1 Introduction Install, Setup and Customize FEMAP The User interface and the On-Line.
E-MARKETING (INTERNET MARKETING). E-MARKETING Marketing: A comprehensive process that involves every aspect of a business from designing its products,
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 Parallel Hardware and Parallel Software An Introduction to Parallel Programming Peter Pacheco.
Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium.
© 2009 Wellesley Information Services. All rights reserved. A comprehensive guide to SAP NetWeaver Visual Composer Dr. Bjarne Berg.
ONYX Thrive Technical Information © 2011 ONYX Graphics, Inc.
Ahmad Aljebaly Department of Computer Science Western Michigan University.
Mobile App Development & Localisation Eric Chubb Alchemy Software Development 14 th June 2012.
Public Information Version 3.1: 1/1/2012 Introducing Instant Business Intelligence To IT BI Project Managers What you need, when you need it
Name: ………………………………………………………… Class:……………… Teacher:…………………………………………..
2010©. Introduction Graphics Rendering Pipeline Architecture Application Stages Geometry Stages Rasterizer Stages.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
D. Britton8/Nov/2006GridPP3 Last 30 Days of CSA06 RAL.
Introduction to cloud computing Jiaheng Lu Department of Computer Science Renmin University of China
© 2016 SlidePlayer.com Inc. All rights reserved.