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

Similar documents
Hardware Accelerated Graphics for High Performance JavaFX Mobile Applications

Coming to a Pixel Near You: Mobile 3D Graphics on the GoForce WMP. Chris Wynn NVIDIA Corporation

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

Feeding the Beast: How to Satiate Your GoForce While Differentiating Your Game

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Dave Shreiner, ARM March 2009

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

Evolution of GPUs Chris Seitz

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

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

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

Profiling and Debugging Games on Mobile Platforms

Mattan Erez. The University of Texas at Austin

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

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

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

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

Vulkan Multipass mobile deferred done right

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

GeForce4. John Montrym Henry Moreton

GoForce 3D: Coming to a Pixel Near You

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Multimedia in Mobile Phones. Architectures and Trends Lund

Lecture 2. Shaders, GLSL and GPGPU

M3G Overview. Tomi Aarnio Nokia Research Center

POWERVR MBX & SGX OpenVG Support and Resources

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

Working with Metal Overview

Programming Graphics Hardware

Graphics Hardware. Instructor Stephen J. Guy

Mattan Erez. The University of Texas at Austin

GPU Memory Model Overview

Module Introduction. Content 15 pages 2 questions. Learning Time 25 minutes

Spring 2011 Prof. Hyesoon Kim

Mali Developer Resources. Kevin Ho ARM Taiwan FAE

Rendering Objects. Need to transform all geometry then

DX10, Batching, and Performance Considerations. Bryan Dudash NVIDIA Developer Technology

Textures. Texture coordinates. Introduce one more component to geometry

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

Graphics Processing Unit Architecture (GPU Arch)

Could you make the XNA functions yourself?

Spring 2009 Prof. Hyesoon Kim

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

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

Direct3D API Issues: Instancing and Floating-point Specials. Cem Cebenoyan NVIDIA Corporation

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

Shaders (some slides taken from David M. course)

Squeezing Performance out of your Game with ATI Developer Performance Tools and Optimization Techniques

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

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

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

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

Free Downloads OpenGL ES 3.0 Programming Guide

Rendering Grass with Instancing in DirectX* 10

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

JSR 248: Taking Java Platform, Micro Edition (Java ME) to the Next Level

Windowing System on a 3D Pipeline. February 2005

Applications and Implementations

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

AGDC Per-Pixel Shading. Sim Dietrich

GeForce3 OpenGL Performance. John Spitzer

Optimisation. CS7GV3 Real-time Rendering

Falanx Microsystems. Company Overview

Coding OpenGL ES 3.0 for Better Graphics Quality

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

How to Work on Next Gen Effects Now: Bridging DX10 and DX9. Guennadi Riguer ATI Technologies

Canonical Shaders for Optimal Performance. Sébastien Dominé Manager of Developer Technology Tools

2.11 Particle Systems

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

The Handheld Graphics. Market. Size, needs, and opportunities. Jon Peddie Research

CS 130 Final. Fall 2015

Real-World Applications of Computer Arithmetic

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

CS427 Multicore Architecture and Parallel Computing

EECS 487: Interactive Computer Graphics

Lecture 13: OpenGL Shading Language (GLSL)

ARM. Mali GPU. OpenGL ES Application Optimization Guide. Version: 2.0. Copyright 2011, 2013 ARM. All rights reserved. ARM DUI 0555B (ID051413)

<Insert Picture Here> Symmetric multilanguage VM architecture: Running Java and JavaScript in Shared Environment on a Mobile Phone

Ciril Bohak. - INTRODUCTION TO WEBGL

Introduction to Shaders.

Shaders. Slide credit to Prof. Zwicker

Adding Advanced Shader Features and Handling Fragmentation

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

COMP371 COMPUTER GRAPHICS

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

Mobile HW and Bandwidth

Copyright Khronos Group, Page 1

Applications and Implementations

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

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

Applications of Explicit Early-Z Z Culling. Jason Mitchell ATI Research

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

CS 354R: Computer Game Technology

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

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

Introduction to OpenGL ES 3.0

Shadow Techniques. Sim Dietrich NVIDIA Corporation

Performance OpenGL Programming (for whatever reason)

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

Baback Elmieh, Software Lead James Ritts, Profiler Lead Qualcomm Incorporated Advanced Content Group

Transcription:

Whiz-Bang Graphics and Media Performance for Java Platform, Micro Edition (JavaME) Pavel Petroshenko, Sun Microsystems, Inc. Ashmi Bhanushali, NVIDIA Corporation Jerry Evans, Sun Microsystems, Inc. Nandini Ramani, Sun Microsystems, Inc. Session TS-5585 2007 JavaOne SM Conference Session TS-5585

Goal of this Session Learn what's happening in the Java Platform, Micro Edition (Java Platform ME ) to enable high performance graphics and how you can leverage hardware acceleration capabilities to create compelling graphical applications 2007 JavaOne SM Conference Session TS-5585 2

Agenda CLDC Platform and Graphics Java Specification Requests (JSRs) SW versus HW Performance Khronos Media Acceleration APIs JSR 226 Scalable Vector Graphics JSR 239 Java Binding for OpenGL ES API Performance Optimizations VM, Library, CPU, System Bus, and GPU JSR 239 Advanced Effects Q&A 2007 JavaOne SM Conference Session TS-5585 3

Platform Overview Java Technology MIDlet Graphics and Media JSRs CLDC Virtual Machine Native Gfx Libraries OS GPU CPU 2007 JavaOne SM Conference Session TS-5585 4

Platform Implementation Focus for this talk Java Technology MIDlet JSR 226 (SVG Tiny) JSR 239 (OpenGL ES) CLDC VM JSR 135/234 (Media) Khronos APIs OS GPU CPU 2007 JavaOne SM Conference Session TS-5585 5

Native Graphics Performance Software versus hardware Until recently, most mobile 2D/3D APIs were implemented in software 2D/3D hardware, when available, was typically accessed through a proprietary API Sun is working to enable Java technology APIs to leverage standard native graphics APIs when available Provide good application performance transparently Allow for hardware-specific tuning for ultimate performance 2007 JavaOne SM Conference Session TS-5585 6

Khronos Media Acceleration APIs Applications (Java Application or Native) Media Silicon CPUs, DSP, Hardware Accelerators 2007 JavaOne SM Conference Session TS-5585 7

Khronos Media Acceleration APIs (Continued) Khronos APIs are supported by a large number of hardware vendors for mobile devices Royalty-free, cross-platform OpenVG (2D) Low-level API for 2D vector graphics OpenGL ES (3D) Full function 3D graphics on embedded systems OpenMAX (Media) Comprehensive streaming media acceleration 2007 JavaOne SM Conference Session TS-5585 8

JSR 226 Scalable 2D Vector Graphics API for Java Platform, Micro Edition (Java ME) Java API to draw, manipulate and animate SVG Tiny 1.1 content Part of Mobile Service Architecture (JSR-248) wide deployment Rich UI through SVG Complex behavior through Java platform DOM API connects SVG and Java platform Richer UI than MIDP alone 2007 JavaOne SM Conference Session TS-5585 9

JSR 226 Features Graphical Objects Rendering Abc Abc Transform Animation Abc t 2007 JavaOne SM Conference Session TS-5585 10

JSR 226 and OpenVG JSR 226 Vector Graphics Hardware 2007 JavaOne SM Conference Session TS-5585 11

Demo JSR 226 Demo 2007 JavaOne SM Conference Session TS-5585 12

JSR 239 Java Binding for OpenGL ES API OpenGL ES is embedded subset of OpenGL JSR 239 defines Java binding to OpenGL ES API 1.0 and 1.1 Immediate mode API Highly flexible control of rendering Low level hardware oriented 3D API 3D viewing pipeline, lighting and shading, texture mapping, cubemaps, fog Access to latest and greatest hardware features 2007 JavaOne SM Conference Session TS-5585 13

JSR 239 and OpenGL ES JSR 239 3D Graphics Hardware 2007 JavaOne SM Conference Session TS-5585 14

JSR 239 Game Demo 2007 JavaOne SM Conference Session TS-5585 15

Demo JSR 239-Based Game 2007 JavaOne SM Conference Session TS-5585 16

VM Development Goals for Graphics Performance CLDC HI VM Optimize for interactive user experience Maximize performance of real-world applications Minimize and manage pauses Faster startup Make use of coprocessors and accelerators if available 2007 JavaOne SM Conference Session TS-5585 17

High Performance in Limited Memory Optimizing compilers Dynamic adaptive compiler Ahead-of-time compiler Optimize fast path for speed, slow path for size Manually optimized assembly interpreter and runtime Generational mark and compact garbage collector Memory is scarce, so heap occupancy is high Sliding young generation Separate areas for large objects and compiled code 2007 JavaOne SM Conference Session TS-5585 18

Most Effective Compiler Optimizations Constant folding Common-subexpression elimination Null-pointer check elimination Method in-lining Speculative devirtualization Register allocation Optimized arraycopy 2007 JavaOne SM Conference Session TS-5585 19

Pause Management Incremental schedulable compilation Compiler runs as a co-routine Can be suspended after every bytecode Can suspend itself after a given time interval Improvements in Garbage Collector Young generation size is managed to limit a minor collection pause Only user program allocations can cause collections Compiler allocates in a separately managed area Prevention of pause clustering 2007 JavaOne SM Conference Session TS-5585 20

Coprocessors and Hardware Accelerators Support of video accelerators is essential for gaming experience Compiler needs to be aware of JSR implementation Floating-point coprocessors ARM VFP, 3x3 matrix multiplication Float: 36 times faster than software FP Double: 54 times faster ARM Jazelle makes cold startup faster Instruction set extensions (XScale, Thumb2EE) 2007 JavaOne SM Conference Session TS-5585 21

Future VM and Compiler Optimization Plans Improve general-purpose compiler optimizations Array index bounds check elimination Better common-subexpression elimination for loops Quick native functions and compiler intrinsics Matrix and vector operations in a few ARM VFP instructions More support for JSR implementation Partial compilation of large methods Pause logging and analysis tools 2007 JavaOne SM Conference Session TS-5585 22

Creating Compelling JSR 239 Applications 3D application performance tips Advanced rendering effects Demos 2007 JavaOne SM Conference Session TS-5585 23

Handheld Device Systems Handheld System CPU GPU System Bus Performance problems can occur at any of these levels Feed each part carefully to avoid performance problems 2007 JavaOne SM Conference Session TS-5585 24

CPU Level 3D Optimizations Simplify CPU work (collision detecting, Skinning ) Avoid per triangle culling Batch geometry Avoid redundant state changes Avoid CPU assisted driver paths 2007 JavaOne SM Conference Session TS-5585 25

CPU Level 3D Optimizations (Cont.) CPU cache is small Use coherent algorithms Use fixed point if hardware does not support floating point OpenGL ES 1.0 lighting Directional lights are fastest Point lights are more expensive Spot lights are the most expensive Cost of additional light scales linearly 2007 JavaOne SM Conference Session TS-5585 26

System Bus Level 3D Optimizations Remodel objects for smaller screen size Use VBO s (Vertex Buffer Objects) for static data Use compressed texture formats Avoid bus transfer by not overflowing GPU video memory Batch by texture 2007 JavaOne SM Conference Session TS-5585 27

What s in Nvidia s GoForce 5500 GPU? Overview HW geometry pipeline High performance texturing support Programmable Fragment Shader support Pixel Buffer support Vertex Buffer Objects support QCIF, QVGA, VGA and XGA screen size support Support for per-pixel fogging, alpha blending, alpha testing, bilinear filtering, perspective correction 2007 JavaOne SM Conference Session TS-5585 28

High Performance Texturing Multitexturing (four simultaneously active textures) Texture filtering Texture mipmapping (using Trilinear Interpolation) Compressed texture support (DXT1, DXT3, DXT5) High quality texture support 16/32 bpp Supports texture size up to 1024X1024 texels Render to texture support (PBuffers) 2007 JavaOne SM Conference Session TS-5585 29

Multitexturing for Lighting Fake Phong Highlights Using Multi-Texture Stuntcar Extreme (Images Courtesy of Fathammer) 2007 JavaOne SM Conference Session TS-5585 30

Leveraging Multi-Texture Four Full Res (256 x 256) 4-bit = 128kb Full Res Base + four 1/4 res lightmaps = 40kb Store diffuse maps in lower resolution and use multi-texture to save memory 2007 JavaOne SM Conference Session TS-5585 31

VBOs Support for Vertex Buffer Objects Store vertex data in video memory Greatly reduces system bus bandwidth requirements Available via extension to OpenGL ES 1.0 Support for Both Fixed-Point and Floating-Point Vertex Formats Good for embedded CPUs that don t provide hardware support for floating-point math If the program has large amount of static data performance can be improved by 50 100% 2007 JavaOne SM Conference Session TS-5585 32

Rendering to Texture and Pixel Buffers PBuffers are the method of rendering to texture For extremely powerful effects Live motion blur High-speed texture blurring and downsizing Light blooming Environment mapped bump mapping Fluid flow or plasma effects All of these are possible on the GPU with very few polygons and passes 2007 JavaOne SM Conference Session TS-5585 33

Example Effects: Image Processing Original Image Increasing Saturation Decreasing Saturation Sharpening Blurring Edge Detection 2007 JavaOne SM Conference Session TS-5585 34

Example Effects Motion Blur 2007 JavaOne SM Conference Session TS-5585 35

Fragment Shaders JSR 239 is extensible NVIDIA GoForce 4800/5500 DOT3 bump/normal mapping Environment-mapped bump mapping Image processing Motion Blur Edge Detect Bloom 2007 JavaOne SM Conference Session TS-5585 36

Example Effects Glow Bump Mapping HDR Blooming 2007 JavaOne SM Conference Session TS-5585 37

Example Effects Environment-Mapped Bump Mapping 2007 JavaOne SM Conference Session TS-5585 38

Fragment Shaders Short programs that generate a fragment color to be passed to the final pixel processing stages Replaces the OpenGL ES Texturing Pipeline Operates on the Current Fragment Four 4D constant registers (set by the application) Current interpolated 4D color Eight interpolated 2D texture coordinates Up to 12 lookups into up to four textures 2007 JavaOne SM Conference Session TS-5585 39

See the Difference 2007 JavaOneSM Conference Session TS-5585 40

Example: User Interface 2007 JavaOne SM Conference Session TS-5585 41

Example: User Interface 2007 JavaOne SM Conference Session TS-5585 42

Example: User Interface GPU: GoForce 5500 Each application will render into a separate pbuffer Demo heavily uses Fragment Shaders PBuffers HW Blending 2007 JavaOne SM Conference Session TS-5585 43

DEMO JSR-239 Demo 2007 JavaOne SM Conference Session TS-5585 44

For More Information SVG-related sessions at JavaOne SM conference TS-5525, TS-5628, TS-5743 JSR 226 and JSR 239 http://jcp.org/en/jsr/detail?id=226 http://jcp.org/en/jsr/detail?id=239 Khronos APIs http://www.khronos.org Nvidia Handheld Developer Program http://developer.nvidia.com Email: mobile-dev@nvidia.com 2007 JavaOne SM Conference Session TS-5585 45

Q&A 2007 JavaOne SM Conference Session TS-5585 46

Whiz-Bang Graphics and Media Performance for Java Platform, Micro Edition (JavaME) Pavel Petroshenko, Sun Microsystems, Inc. Ashmi Bhanushali, NVIDIA Corporation Jerry Evans, Sun Microsystems, Inc. Nandini Ramani, Sun Microsystems, Inc. Session: TS-5585 2007 JavaOne SM Conference Session TS-5585