Real-Time Graphics Architecture

Similar documents
Real-Time Graphics Architecture

20 Years of OpenGL. Kurt Akeley. Copyright Khronos Group, Page 1

Copyright Khronos Group Page 1. Vulkan Overview. June 2015

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

Open Standards for Building Virtual and Augmented Realities. Neil Trevett Khronos President NVIDIA VP Developer Ecosystems

Parallelizing Graphics Pipeline Execution (+ Basics of Characterizing a Rendering Workload)

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

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

Programming with OpenGL Part 1: Background

Early History of APIs. PHIGS and X. SGI and GL. Programming with OpenGL Part 1: Background. Objectives

SIGGRAPH Briefing August 2014

AR Standards Update Austin, March 2012

Parallelizing Graphics Pipeline Execution (+ Basics of Characterizing a Rendering Workload)

WebGL Meetup GDC Copyright Khronos Group, Page 1

Copyright Khronos Group Page 1

Graphics Pipeline & APIs

Real-Time Graphics Architecture

Copyright Khronos Group, Page 1. Khronos Overview. Taiwan, February 2012

A Proposal for OpenGL 1.4 Matt Craighead NVIDIA Corporation

Graphics Pipeline & APIs

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

Mobile AR Hardware Futures

Introduction to OpenGL ES 3.0

Introduction. What s New in This Edition

Spring 2009 Prof. Hyesoon Kim

Mention driver developers in the room. Because of time this will be fairly high level, feel free to come talk to us afterwards

Spring 2011 Prof. Hyesoon Kim

CSE 591/392: GPU Programming. Introduction. Klaus Mueller. Computer Science Department Stony Brook University

Real-Time Graphics Architecture

E.Order of Operations

Performance OpenGL Programming (for whatever reason)

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

Dave Shreiner, ARM March 2009

Real-Time Graphics Architecture

CSE 591: GPU Programming. Introduction. Entertainment Graphics: Virtual Realism for the Masses. Computer games need to have: Klaus Mueller

OpenGL Essentials Training

Copyright Khronos Group, Page 1

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

Copyright Khronos Group, Page 1. OpenCL. GDC, March 2010

Adding Advanced Shader Features and Handling Fragmentation

3D Computer Games Technology and History. Markus Hadwiger VRVis Research Center

POWERVR MBX. Technology Overview

OpenCL Overview. Shanghai March Neil Trevett Vice President Mobile Content, NVIDIA President, The Khronos Group

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

Vulkan 1.1 March Copyright Khronos Group Page 1

Drawing Fast The Graphics Pipeline

Khronos and the Mobile Ecosystem

CS179 GPU Programming Introduction to CUDA. Lecture originally by Luke Durant and Tamas Szalay

gltf Briefing September 2016 Copyright Khronos Group Page 1

Copyright Khronos Group, Page 1

Copyright Khronos Group 2012 Page 1. OpenCL 1.2. August 2012

Neural Network Exchange Format

Copyright Khronos Group, Page 1

Scheduling the Graphics Pipeline on a GPU

Rendering Grass with Instancing in DirectX* 10

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

The Bifrost GPU architecture and the ARM Mali-G71 GPU

Graphics Processing Unit Architecture (GPU Arch)

Introduction to the OpenGL Shading Language

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

CS GAME PROGRAMMING Question bank

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

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

Optimizing for DirectX Graphics. Richard Huddy European Developer Relations Manager

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

CGT521 Introduction to

PowerVR Hardware. Architecture Overview for Developers

Open Standards for Vision and AI Peter McGuinness NNEF WG Chair CEO, Highwai, Inc May 2018

1.2.3 The Graphics Hardware Pipeline

Drawing Fast The Graphics Pipeline

Shadows for Many Lights sounds like it might mean something, but In fact it can mean very different things, that require very different solutions.

GeForce4. John Montrym Henry Moreton

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

! Readings! ! Room-level, on-chip! vs.!

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

Streaming Massive Environments From Zero to 200MPH

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

December 11, 2001 Copyright 3Dlabs, Page 1

Current Trends in Computer Graphics Hardware

CS452/552; EE465/505. Clipping & Scan Conversion

Viewport 2.0 API Porting Guide for Locators

Lecture 25: Board Notes: Threads and GPUs

ASYNCHRONOUS SHADERS WHITE PAPER 0

Introduction to Shaders.

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

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

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

GDC 2014 Barthold Lichtenbelt OpenGL ARB chair

CS427 Multicore Architecture and Parallel Computing

The Ultimate Developers Toolkit. Jonathan Zarge Dan Ginsburg

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

Drawing Fast The Graphics Pipeline

Bifrost - The GPU architecture for next five billion

Working with Metal Overview

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

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

WebSphere Application Server, Version 5. What s New?

The Rendering Pipeline (1)

Transcription:

Real-Time Graphics Architecture Lecture 16: The Design of OpenGL Kurt Akeley Pat Hanrahan http://graphics.stanford.edu/cs448-07-spring/ Early SGI history (dates are approximate) 1975 1980 1985 1990 1

Historical context (circa 1990) SGI is the dominant workstation 3-D graphics player High-end multiprocessor: PowerSeries GTX, VGX Desktop: Personal Iris, Indigo Workstation 3-D APIs are proprietary, not interoperable IRIS GL (SGI) Starbase (HP) IRIS GL is a mess Evolved (accreted) by SGI from 1982 on Poorly specified with inconsistent implementations IBM licensing deal GTX/Personal IRIS development PC is becoming an interesting platform Intel 486 included on-board FPU and cache memory Microsoft exploring 3-D collaboration with SGI PHIGS/PEX history* (dates are approximate) 1975 1980 1985 1990 * Summarized from http://www.jch.com/~jch/vrml/pextimes.html ** Programmers Hierarchical Interactive Graphics System *** Convex, DEC, E&S, HP, IBM, Kubota, ShoGraphics, Stardent, Sun, Tek 2

PEX (unofficially the PHIGS Extension to X) PEX The PEX threat (circa 1990) PEX considered sub-optimal by SGI Retained scene graph* (immediate mode desired) X protocol extension (API desired) Differed from IRIS GL Designed by committee NIH (maybe, we had ignored it) But PEX will soon be very real * Actually, while PHIGS had no immediate mode, PEX had been extended by this time to include one 3

The (controversial) choice Remain proprietary Evolve IRIS GL Drive standards PEX Our own initiative Internally called GL5 Became OpenGL Talk outline Goals Design decisions Successes and failures Moving forward 4

Goals Goals for OpenGL Industry-wide acceptance (beat PEX!) Consistent implementations Innovative implementations Innovative and differentiated applications Long life High quality 5

Non-goals Make graphics programming easy OpenGL is a power tool You might lose a finger (i.e., see a black screen) Integrate digital media and 3D graphics This is a much larger task See discussion of Khronos later in the talk Goal: Industry-wide acceptance Avoid compromising performance Allow explicit application trade-offs (modes) Get it right the first time Make conservative changes from IRIS GL Collect lots of input during design Do implementation during design Create an open standard Licensing program Architecture Review Board (OpenGL ARB) to control future evolution of specification 6

Goal: Industry-wide acceptance (cont.) Achieve compatibility with multiple Operating systems (Windows, IRIX, HPUX, AIX, ) Ultimately Linux, Mac OS, OS/2, Be, ) Window systems (Windows UI, X Window System, ) Frame buffer is not part of OpenGL state Programming languages (C, FORTRAN, Java, ) No pointers, structures, function overloading No 2-D arrays at interface (row-major / column-major) Target Microsoft acceptance Omit 2D-only functions, window interface, font support Allow full application compliance with Windows standards Issue: no driver interface specified Goal: Industry-wide acceptance (cont.) Marginalize PEX API, not protocol, is the right interface But client-server mattered too Defined GLX protocol Included server-side display list storage Carefully specified client-side state Match current hardware capabilities Get input from other IHVs Meet current application needs Get input from ISVs 7

Goal: Consistent implementations Tightly written specification Conformance tests and required verification Complete implementations No sub-setting of 1.n specification Minimum resource requirements specified Required runtime error semantics (small performance cost) Check and report No other side effects Incentives to share extensions Balance desires for consistency and for innovation Result: portable applications Goal: Innovative implementations Specification not too tight Not pixel-exact Smooth antialiasing loosely defined Abstraction sometimes tilted in implementor s favor Texture images and filters are paired Evaluated attributes do not become current Extensibility Key to IHV innovation Requires IHV control of entire driver Obvious for hardware systems companies Not at all obvious for Microsoft 8

Extensibility Registry is maintained on www.opengl.org Over 340 extensions so far Names, token values, GLX protocol, Careful extension documentation Suffix/prefix rules Clearly identify all non-core commands and tokens Extension numbers Must account for all lower-numbered extensions OpenGL is more than the sum of its parts Extension specification template Extension template Name Name strings Version Number Dependencies (list) Issues Overview New procedures and functions New tokens Additions to chapter [2,3,4,5,6] Additions to GLX specification GLX protocol Dependencies (details) Errors New state (table format) Get Value Get Command Type Initial Value Attribute Set New implementation-dependent state (table format) Usage examples 9

Extension syntax rules Abbreviations (required, specifically not allowed) Compound words (required) Naming rules General (e.g., depth rather than z ) Procedures (e.g., verb-noun or adjective-noun) Defined constants (all caps, underbars) Parameters ([0],1,2, <target>, <params>) Extensions (prefixes, suffixes) Parameter order and typing rules Suffix codes Extension categories Proprietary Use corporate prefix/suffix (e.g. NV) EXT Use EXT prefix/suffix Must be implemented by at least two licensees ARB Use ARB prefix/suffix Specification controlled by the ARB 1.n No prefix/suffix Specification controlled by the ARB 10

Goal: Innovative applications Design qualities that encourage innovative use Imperative (procedural) interface In X-speak, mechanism, not policy Orthogonal mechanisms Data recirculation Similarity of pixels and texels Machine shop analogy Sufficiency of capability (e.g., stencil, blending) Intuitive usability (not ease of use) Invariant operation Taken together, these design qualities allow programmable operation, in the multi-pass sense Usages that were not anticipated by the designers But application developers will not innovate if implementations are not consistent! Goal: Long life Extensibility Enabled Directed (process in place) Strong foundation Precise specification And culture that values it Anticipation of important trends Texture mapping Integration of image processing and 3-D graphics 11

Goal: High quality Aim for beauty, not just sufficiency or correctness SGI culture supportive of this Avoid design-by-committee Build a horse, not a camel Correct well known IRIS GL deficiencies No command prefixes Can t be used by libraries (incomplete save/restore) Error reporting via printf()! Provide documentation Specification Man pages Programming guide Design Decisions 12

Unit-square pixels and (matching) texels Square Exact tiling of window area Matches window system ownership model No window compositing WIDS (later: CIDs and DIDs) Correct frustum arithmetic Consider single-pixel frustum Correct texture wrapping Not centered at integral units Non-negative in window Obvious viewport arithmetic Matching pixels and texels Obviously important (in retrospect!) (1,1) (0,0) (0.5,0.5) No direct render to texture Pixel and texel coordinates are equivalent But pixels and texels are still distinguished Allows implementation with separate memories Supports OpenGL state model Textures are OpenGL state Frame buffer contents are not Allows mutiple renderers to share frame buffer An unnecessary orthogonality? 13

No return values (except from queries) Status return values are a common library feature But they have horrible performance implications Expose pipeline latency Expose client-server latency OpenGL error system carefully engineered to be Asynchronous Distributed void glbegin(gl_polygon); GLstatus glbegin(gl_polygon); Evaluated attributes do not become current Correct semantics Force separate hardware for evaluation and vertex ops Defeat unified implementation Compromise allows practical implementation Evaluation Smear current values Vertex Operations 14

More design decisions Object IDs (not handles) No return value Scriptable Sifdv interface For application convenience and efficiency Discourage incremental matrix arithmetic No pre-multiply Stack provided for undo Application-specified clipping done in eye coordinates Allows use of singular projection matrixes Successes and Failures 15

Success with respect to goals Industry-wide acceptance Great for Unix, Linux, Apple, embedded systems Good as can be expected with Microsoft Poor for game consoles Consistent implementations Good for core features Marginal for new features Innovative implementations Industry and academic standard Interesting work-arounds for constraints Success with respect to goals (cont.) Innovative and differentiated applications Very successful Long life Fifteen years and counting High quality Generally respected But implementations on Windows suffer as Direct 3D becomes more important 16

Technical successes Imperative interface Every graphics systems aspires to have an imperative interface Generalized texture capability All primitives (with pixel texture extension) Various dimensions of texture Texel and pixel conformance Incremental in-place modification Explicit format, filter specification, MIP level, Texture matrix Formalization of fragment Mistakes Business Taking our eye off Microsoft Technical Display lists as encapsulation for objects Forced to introduce texture objects in version 1.1 Overly-abstract storage management Proxy-priority middle ground is not tenable Few fast path clues in API Too much faith in pure mechanism E.g., DL objects, window position, 2-D transform, in-place frame buffer to texture memory transfer, Persistent parameter state between Begin/End But would have broken IRIS GL programs badly 17

Mistakes (cont.) Probably should have been omitted Texture borders! (but not texture-border color) Edge flags Smooth polygon antialiasing Color index features (lighting, antialiasing, ) Needlessly complex or wrong ColorMaterial() Normal transformation Texture wrap semantics Bit fields (cannot support extensions) Viewport should accept doubles, not ints Presumption of view direction (lighting, fog) Did OpenGL help SGI? While the quality of tangible goods has increased dramatically over the last 30 years the quality of software artifacts has been steadily declining. Alex Stepanov In Industrializing Software Development, Zhejiang University, 2004 Software quality and corporate success may be inversely correlated 36 18

Lessons It is worthwhile to specify carefully Don t complete the implementation before starting on the specification! It is critical to guide system implementers and application developers to a common understanding of how to support and achieve high performance. People make and evolve standards Invest in developing a culture Keep competitive issues out of a specification s controlling body. Moving Forward 19

Future of OpenGL (from 2001 talk) On the rebound Low period in the late 90s Provides alternative to DirectX/Microsoft API control Apple commitment is a positive sign Programmability is an exciting development Fits well in OpenGL structure OpenGL may truly be a library some day Lots of 2.0 activity, ARB still functioning Tenth birthday this summer (at SIGGRAPH) Khronos - Open Media Standards Open International Membership Open Standards Any company is welcome Publicly available on web-site Funded by membership dues - $6K / year To be used by any company in any products Open Standards for Media Authoring and Acceleration Creating Market Opportunities Bringing together industry s s leading media technology experts Investing hundreds of man years to create state-of-the-art media API standards Making those standards available to the industry ROYALTY-FREE 20

Over 100 companies creating media authoring and acceleration standards Khronos Standards Ecosystem glfx Effects Framework Cross-platform graphics authoring/acceleration ecosystem Safety Critical 2D/3D Cross platform desktop 3D 3D Authoring All open standards for native 3D graphics acceleration and authoring are now being developed in Khronos. Tremendous opportunity for collaboration and synergy Dynamic Media Authoring Dynamic Media Authoring Standards 2D/3D Vector 2D Streaming Media Enhanced Audio DirectX-like set of native APIs Includes mixed media acceleration and OS portability APIs Embedded Media Acceleration APIs Composition Working Group Hardware acceleration for window systems 21

Khronos Participation Model Board decides strategy approves working groups, controls budget, ratifies specifications. $20,000 annual membership dues Promoters Contributors Any company can join Khronos to participate in any number of working groups to produce specifications. $6,000 annual membership dues A Working Group for each API standard one company one vote Openly and publicly distributed free of charge, royalty free Ratified Specifications SDKs Conformance Tests Conformance Tests and Conformance Test Process. Typically $10K per API fee Free libraries, utilities, examples Implementers Anyone can download specifications and SDKs and implement royalty-free products Adopters Conforming products can use API trademark and logo Khronos Conformance Process Non-Members Khronos Contributor or Promoter Members Become Adopter Member ($2,500 annual fee) Sign Adopters Agreement to access Test Source and Process (typically $10K per API) Port Test Source to product and generate test results Upload test results to Khronos private web-site for peer review by other Adopters Successful Review means products can use Khronos trademarks Already released Streaming Media Vector 2D COLLADA, OpenKODE coming soon 2D/3D 22

SGI / Pixar collaboration It seems to me that we are trying to merge troff and Scribe into a single hodge-podge. I don't think that we'll get a good result if we continue. It seems that a key to a high-performance interface is choosing the right boundary between what and how. Even the Pixar language has this boundary in it. It still does not support a description like 'lighted like a Sunday afternoon in September'. I am in touch with Pat Hanrahan. He will send me an updated copy of a document outline today. I am to be working on what I discuss in this note. What next? Kurt Akeley (to Forest Baskett) Fahrenheit SGI promoting and supporting PC OpenGL Microsoft asserting control of their own platform Fahrenheit is the negotiated settlement Results: Broad reach of agreement failed No new low-level standard, little at scene graph level OpenGL still exists on all Windows platforms SGI learned a lot about Microsoft s business Microsoft learned a lot about graphics Seamus s presentation at Graphics Hardware 2001 23

Direct3D For years Direct3D has patterned itself after OpenGL Immediate mode Features such as stencil buffer There are surprising examples in Direct3D 10 Geometry shaders (anticipated by evaluators) Unified shaders (anticipated by evaluators) Stream out (anticipated by feedback) Even GPU programmability is not really new Recall earlier lecture But also From the Wikipedia article on PHIGS: The rise of OpenGL and the decline of PHIGS OpenGL, unlike PHIGS, is an immediate-mode rendering system with no "state"; once an object is sent to a view to be rendered it essentially disappears. Changes to the model have to be re-sent into the system and re-rendered, dramatically increasing programmer workload. For simple projects, PHIGS was considerably easier to use and work with. However, OpenGL's "low-level" API allowed the programmer to make dramatic improvements in rendering performance by first examining the data on the CPU-side before trying to send it over the bus to the graphics engine. For instance, the programmer could "cull" the objects by examining which objects were actually visible in the scene, and sending only those objects that would actually end up on the screen. This was kept private in PHIGS, making it much more difficult to tune performance. Given the low performance systems of the era and the need for high-performance rendering, OpenGL was generally considered to be much more "powerful" for 3D programming. PHIGS fell into disuse. Version 6.0 of the PEX protocol was designed to support other 3D programming models as well, but did not regain popularity. PEX was mostly removed from XFree86 4.2.x (2002) and finally removed from the X Window System altogether in X11R6.7.0 (April 2004). 24

OpenGL specifies an architecture OpenGL is an API-based architecture specification Low-level imperative interface (like an ISA) Tight specification (like an ISA) Orthogonal operation (like an ISA) This is what mattered most Allowed hardware innovation Allowed application innovation Allowed programmability Deferred need for shaders, then allowed them In terms of stifling innovation, good ideas are far more dangerous than bad ones. They take hold, assume momentum, and therefore result in inertia. Consequently, they are hard to displace, even when they are well past their prime. Bill Buxton In Sketching User Experience, Morgan Kaufmann, 2007 50 25

To learn more www.opengl.org www.khronos.org Real-Time Graphics Architecture Lecture 16: The Design of OpenGL Kurt Akeley Pat Hanrahan http://graphics.stanford.edu/cs448-07-spring/ 26