Open GL ES BOF Aug05 Draft nt1

74
© Copyright Khronos Group, 2005 - Page 1 OpenGL ES BOF Neil Trevett Vice President Embedded Content, NVIDIA President, Khronos Group Chairman OpenGL ES Working Group

Transcript of Open GL ES BOF Aug05 Draft nt1

© Copyright Khronos Group, 2005 - Page 1

OpenGL ES BOF

Neil TrevettVice President Embedded Content, NVIDIA

President, Khronos GroupChairman OpenGL ES Working Group

© Copyright Khronos Group, 2005 - Page 2

AgendaAgenda

•Intro and Khronos News overview – Neil Trevett, NVIDIA•Embedded 3D market overview – Jon Peddie, JPR•OpenGL ES 1.1 Extension Pack overview, Tom McReynolds, NVIDIA•OpenGL ES 2.0 API overview - Robert Simpson, Bitboys•OpenGL Shading Language ES overview - John Kessenich, 3Dlabs•EGL 1.2 overview - Jon Leech, SGI•OpenGL ES-SC 1.0 overview - Chris Hall, Seaweed Systems•Q&A

© Copyright Khronos Group, 2005 - Page 3

Khronos News – SIGGRAPH 2005Khronos News – SIGGRAPH 2005•Khronos membership now well over 80 companies

-New members from all parts of embedded industry food chain – large and small

•Sony and NVIDIA are now Promoters-Khronos leadership role in media authoring and acceleration standards for diverse platforms

•OpenGL ES 2.0 released at Siggraph 2005-Shader programmability comes to embedded platforms-Also OpenGL ES 1.1 Extension Pack, OpenGL ES-SC 1.0, EGL 1.2

•OpenVG 1.0 released at Siggraph 2005-Industry’s first API for hardware acceleration of high-quality, scalable vector graphics

•OpenSL ES audio acceleration working group formed-Industry’s first unified audio hardware acceleration API

•COLLADA joins Khronos -Project originally initiated by Sony Computer Entertainment and to be used on PlayStation 3

-Now open to participation by any Khronos member-Encourages strong tool chain for all OpenGL ES platforms

•OpenML is now open source-Available on Source Forge

© Copyright Khronos Group, 2005 - Page 5

OpenGL ES and Sony PlayStation 3OpenGL ES and Sony PlayStation 3•OpenGL ES will be available for Playstation 3

-Sony made public announcement at GDC in San Francisco in March 2005

-All interactive demos at E3 were using OpenGL ES•Many ISVs code for PlayStation first and then port to other platforms-Tools are essential to hide platform variability

•Powerful portability for console and handset titles-Previous generation console games can be deployed on 100s of millions of cell phonesApplication

portability across a wide

range of platforms

THE POWER OF COOPERATIVE OPEN STANDARDSA growing infrastructure of OpenGL ES tools and platforms are creating the world’s largest opportunity for games

developers

© Copyright Khronos Group, 2005 - Page 6

OpenGL ES 1.1

OpenGLOpenGL 1.3

OpenGL 1.5

OpenGL 2.0

OpenGL ES Roadmap – Two TracksOpenGL ES Roadmap – Two TracksSpec release 2003 2004 2005

OpenGL ES 2.X

OpenGL ES 1.0

GLSL

OpenGL ES 1.1Extension Pack

OpenGL ES 2.0ProvisionalSpecification

Enhanced functionality for emerging hardware, seamless

acceleration for M3G, additional power management

Package of extensions that enhance functionality and reduce variability and will be included in OpenGL ES 1.2

Eliminate redundancy and workstation

functionality -> simple,

streamlined API

Minimized Fixed

Function

Shader programmability

using GLSL.Eliminate

redundant fixed functionality –>

simple, streamlined API

Roadmap track for

programmable hardware

Roadmap track for

fixed function hardware

Minimize differences between 1.X and 2.X tracks.

Full backwards compatibility in each track.

Platforms can ship either or both libraries.

StreamlinedSubset

NewFunctionality

M3G (JSR-184)

acceleration

requirements

OpenGL ES 1.X

© Copyright Khronos Group, 2005 - Page 7

Pipeline – Spec, Silicon, ShipmentPipeline – Spec, Silicon, Shipment

Specification

ReleasedImplementations can start

SiliconFinalized

Made available to handset vendors

HandsetsShip

With new generation

acceleration

12 months 12 months Two year pipeline from spec to

handset

Specification

ReleasedImplementations can

start

SiliconFinalized

Made available to handset vendors

HandsetsShip

With new generation acceleration

Specification

ReleasedImplementations can

start

SiliconFinalized

Made available to handset vendors

HandsetsShip

With new generation acceleration

New specification

every 12 months –> new

handset features every

year

OpenGL ES 1.1 Extension Pack and OpenGL ES 2.0 are ensuring that the silicon design

pipelines are being kept full for fixed

function and programmable 3D

silicon

© Copyright Khronos Group, 2005 - Page 8

Safety Critical – OpenGL ES-SC 1.0Safety Critical – OpenGL ES-SC 1.0•Targeted at avionics and automotive applications

-Enabling OpenGL ES drivers that can be DO-178B certified•Good quorum from avionics and automotive graphics vendors-Seaweed, 3Dlabs, ALT, Barco, Esmertec, Quantum3D in working group

-Positive specification review by major avionics companies and software tools vendors

Common

Safety Critical

Generic, minimum footprint, full function

3D enables diverse graphics applications

Some games-only functionality removed for absolute minimum code size

and complexity to ease safety certifications.

Display list functionality restored for legacy and auto-

generated code

© Copyright Khronos Group, 2005 - Page 9

Accelerated Accelerated Vector GraphicsVector Graphics

© Copyright Khronos Group, 2005 - Page 10

Strong Demand for Vector GraphicsStrong Demand for Vector Graphics•Vector Graphics are the foundation for high-quality 2D-Based on Bezier curves – not polygons – for scaling and positioning at full quality

-Easy porting of content to different screen sizes•Many applications use high-quality 2D vector graphics primitives-Portable mapping and GPS applications, E-book readers and text packages

-Advanced user interfaces and screen savers, 2D Games•Many vector graphics formats already in use

-Flash, SVG, PDF, Postscript, Vector fonts etc. etc.•But all 2D vector graphics runs un-accelerated!

-Not effective on low-powered handset CPUs

© Copyright Khronos Group, 2005 - Page 11

OpenVG – Accelerated Vector Graphics!OpenVG – Accelerated Vector Graphics!•Low-level API for 2D vector graphics

-With a focus on enabling hardware acceleration -Should also allow efficient SW implementations

•OpenVG ACCELERATES existing formats-NOT a competitor to Flash, SVG etc.

•Open, royalty-free standard

•Fast Track Development Schedule

2Q04 3Q04 4Q04 1Q05 2Q05

1st OpenVG face-to-

face meeting

Draft OpenVG1.0 specificati

on completed

OpenVG working group

started

Applications

2D Hardware Acceleration

SVG/Flash/Font Package

etc..

3Q05

Samples and

conformance tests

4Q05

OpenVG 1.0

specification public release

© Copyright Khronos Group, 2005 - Page 12

Benefits of Hardware AccelerationBenefits of Hardware Acceleration

Interactive

performance

High-quality rendering, including advanced anti-

aliasing

Low power consumptio

nVector graphics

acceleration brings high value to handheld

devices

© Copyright Khronos Group, 2005 - Page 13

OpenVG Design PhilosophyOpenVG Design Philosophy•Provide a low-level hardware acceleration abstraction layer-Based on Bezier curves – not polygons-Similar level to OpenGL ES for 3D graphics

•Use OpenGL-style syntax where possible-Make learning OpenVG as easy as possible for OpenGL developers

•Allow flexibility in the way acceleration can be implemented-Encourages healthy market competition between hardware vendors

© Copyright Khronos Group, 2005 - Page 14

Accelerated Accelerated Embedded AudioEmbedded Audio

© Copyright Khronos Group, 2005 - Page 15

Embedded Audio CrisisEmbedded Audio Crisis•Currently many closed proprietary audio APIs of varying functionality-Even playing a simple sound is different on different platforms

•No standard way to access any available hardware-Lots of work for developers to re-write code for every platform

•Newer multimedia devices incorporating more advanced audio functionality-The situation gets worse!

•A standard, low-level hardware API is needed!

© Copyright Khronos Group, 2005 - Page 16

Khronos Audio Working GroupKhronos Audio Working Group•Will define unified audio acceleration API for embedded market-Open process, royalty -free

•Application-oriented “developer” API-Standardized access to higher-level features such as:

-3D positional audio-MIDI playback-DSP effects

•Cross-platform foundation for a wide range of higher-level audio APIs-Including JSR-234

•Enables seamless transition from software to hardware platforms-Ease of porting across multiple targets

•Similar abstraction-level to OpenGL ES-Complements “system” level audio component of OpenMAX

© Copyright Khronos Group, 2005 - Page 17

Audio Target RequirementsAudio Target Requirements•Target user: application developers•Target markets: embedded systems: mobile and gaming•Founding members

-Creative Labs-Beatnik-NVIDIA-Sonaptic-QSound Labs

•Working group about to start definition process-Aiming for finished spec in less than 12 months-Any interested company very welcome to join!

© Copyright Khronos Group, 2005 - Page 18

Evolving Collada as an Evolving Collada as an Open StandardOpen Standard

July 2005July 2005

© Copyright Khronos Group, 2005 - Page 19

MEDIAAUTHORING

Synergistic Development ofAuthoring and Acceleration

Standards

MEDIAACCELERATION

Authoring requirements for embedded devices and

platforms

Tools and standards to create and distribute compelling embedded content

© Copyright Khronos Group, 2005 - Page 20

Collada - Tools and Playback Collada - Tools and Playback SynergySynergy•Digital Asset Exchange Schema – making ISVs more productive-Enables 3D authoring tools to work together to raise the power of tool chains

•Packaging format for content delivery- Includes new-generation programmable shader effects

•Strong synergy between COLLADA and OpenGL ES 2.0-Collada enables shaders to authored and packaged using OpenGL ES Shading Language 3ds

max

Collada enables leading 3D authoring

tools to work effectively together to create OpenGL ES applications and

assetsAssets and shaders can be communicated between tools and

packaged for OpenGL ES deliveryUbiquitous

acceleration API for 3D content and shaders using OpenGL ES 2.0

Tightly Integrated 3D Authoring and

Deployment Stack

© Copyright Khronos Group, 2005 - Page 21

Conditioning PipelineConditioning Pipeline

3D Acceleration in small footprint

Media Engines – CPUs, DSP, Hardware Accelerators etc.

Media LibrariesVideo Codecs, Imaging and Sound libraries etc. etc.

UserApplications Media Frameworks

E.g. OpenMAX IL, Symbian MDF, GStreamer, DirectShow, MMAPI

2D Vector Graphics

Acceleration

Graphics APIs

Automatic conditioning can help hide platform variability from developers

OpenMAX DL codec and media library

portability

Authoring Applications

Collada is a vital bridge

between modelers and run-time engines Collada

enables assets and shaders to be conditioned for real-time

delivery- including adapting content

specifically to the

capability of different platforms

without losing key asset data

© Copyright Khronos Group, 2005 - Page 22

Creating an Industry QuorumCreating an Industry Quorum•Khronos is outreaching to key constituencies

-Games developers, middleware vendors and authoring tool vendors

•Khronos and the ARB have a close liaison relationship-Collada can significantly impact both authoring and playback markets

Many Collada participants are already Khronos

members

Games Developers

Middleware Vendors

Authoring Tool Vendors

© Copyright Khronos Group, 2005 - Page 23

Benefits of Bringing Collada into Benefits of Bringing Collada into KhronosKhronos•Gives the industry confidence that the spec is truly open-Khronos has a well proven democratic process - “One company, One vote”

•Strong synergy in evolving authoring and acceleration APIs together-Plus close collaboration with the OpenGL ARB

•Proven, fast-track process – including outreach, education and testing-Collada can truly meet the needs of the industry in a timely way

•Many Collada participants are already Khronos members-3D technology industry leaders

© Copyright Khronos Group, 2005 - Page 24

OpenGL ES 1.1 OpenGL ES 1.1 Extension PackExtension Pack

Tom McReynoldsNVIDIA

© Copyright Khronos Group, 2005 - Page 25

OpenGL ES 1.1 Extension PackOpenGL ES 1.1 Extension Pack•Collection of optional extensions to OpenGL ES 1.1

-Intent is to make functionality mandatory in OpenGL ES 1.2-As soon as we have implementation feedback and experience with OpenGL ES 1.1

•Reduce options and variability for easier application porting-Mandate at least one visual with depth AND stencil buffer of at least 4-bits

•Enhanced functionality for improved quality, performance and power-Cube maps - for more realistic 3D environments-Frame buffer objects – simplified and more powerful surface management

-Larger matrix palettes – for higher quality skinning-Enhanced texturing and stencil modes

•Silicon implementations can start today-Keeps the silicon design pipeline full

2003 2004

OpenGL ES 1.0 Specification Silicon HandsetsOpenGL ES 1.1

2005 2006 2007

Specification Silicon Handsets

OpenGL ES 1.2 Extension Pack SpecSilicon Handsets1.1

Implementation Experience

OpenGL ES 1.2 Handsets can ship

in 2007

© Copyright Khronos Group, 2005 - Page 26

Texture CrossbarTexture Crossbar•Adds capability to use the texture color from other texture units as sources to the COMBINE unit

Texture Com bine

0

Texture Com bine

1

CT0 CT1

Cf

Cprev C’f

Cf = fragm ent primary color input to texturing C’f = fragm ent color output from texturing CTj = texture color from texture lookup j Cprev = color output from previous com bine unit

O penGL ES 1.1 Texture Com bine

Texture Com bine

0

Texture Com bine

1

CT0 CT1

Cf

Cprev C’f

Cf = fragm ent prim ary color input to texturing C’f = fragm ent color output from texturing CTj = texture color from texture lookup j Cprev = color output from previous combine unit

Texture Environm ent Crossbar

© Copyright Khronos Group, 2005 - Page 27

Texture, Blending and StencilOpsTexture, Blending and StencilOps•Mirrored Texture Addressing•Blending Extensions

-Additional Blending Equations-FUNC_SUBTRACT -FUNC_REVERSE_SUBTRACT

-BlendFuncSeparate, BlendEquationSeparate-Separate blending functions and equations for RGB and alpha

•New StencilOp functions-INCR_WRAP and DECR_WRAP

© Copyright Khronos Group, 2005 - Page 28

Cube MapsCube Maps•Accurate real-time reflections in handheld 3D games-Given normal & position, compute reflection vector-Use reflection vector as texture coordinate-Per-pixel computed reflection vector is used to index one of 6 faces of cube

-Generate per-pixel reflection value•Per-pixel “specular” lighting

-Per-vertex specular highlight requires very finely tessellated geometry

-With cube-maps you can compute specular color per pixel-Reduces need for complex geometry

© Copyright Khronos Group, 2005 - Page 29

Extended Matrix PaletteExtended Matrix Palette•OES_matrix_palette in OpenGL ES 1.1 recommends

-Minimum matrix palette size of 9 matrices and -Up to 3 matrices / vertex

•Problems-Requires games to break geometry into smaller primitive lists - not efficient for hardware

-Many cases where 4 matrices/vertex is required•OES_extended_matrix_palette increases minimums

-Matrix palette size = 32-# of matrices / vertex = 4

© Copyright Khronos Group, 2005 - Page 30

Frame Buffer ObjectsFrame Buffer Objects•Simplified version of EXT_framebuffer_object•Efficient method for executing Render to Texture•No additional GL contexts are needed

-Switching between framebuffers is faster than doing a context switch (eglMakeCurrent)

•Format of framebuffer is determined by texture or pixel format-Much easier to use than EGLConfig

•Images (renderbuffers / textures) can be shared across framebuffers

© Copyright Khronos Group, 2005 - Page 31

OpenGL ES 2.0 OpenGL ES 2.0 OverviewOverviewRobert Simpson

Bitboys

© Copyright Khronos Group, 2005 - Page 32

OpenGL ES 2.0 PhilosophyOpenGL ES 2.0 Philosophy•Adds GLSL ES shading language derived from GLSL in OpenGL 2.0-Proven, open standard for vertex and fragment shader programming

•Eliminates fixed functionality that can be replaced with shaders -Only one way to do things – reduces implementation cost -Eliminating mixed fixed and programmable modes SIGNIFICANTLY reduces complexity

-Not 100% backward compatible with OpenGL ES 1.x-Though changes are minimized and removed functionality can be replaced with shaders

•Wider range of precision options for use in embedded devices-Low, mid and high precision variables

•Standardize on Frame Buffer Objects in the core-Significant simplification of surface management-Selected compatible subset of functionality from desktop FBO extension

•ROYALTY FREE texture compression scheme - ETC-Developed and contributed by Sony Ericsson-4 bits per pixel – enhanced quality compared to S3TC-Optional extension – will be made part of core for OpenGL ES 2.1

© Copyright Khronos Group, 2005 - Page 33

OpenGL ES 2.0 - What’s NewOpenGL ES 2.0 - What’s New•No Fixed Function Pipeline

-The fixed function vertex T & L and fragment pipeline no longer supported

•Common Profile Only-API entry points use single precision floating point or integer variants

•Vertex and Attribute Data Formats-Byte, Unsigned Byte, Short, Unsigned Short, Int, Unsigned Int,

-Fixed (16.16), Float, -Half Float (optional)

•Compressed Texture Formats-Paletted compressed textures

-Carried over from OpenGL ES 1.0-Optional Compressed Format

-Ericsson Texture Compression for RGB textures - ETC•Floating-Point Textures

-Adds texture internal formats with 16-bit and 32-bit FP components

-Supported as optional extensions

© Copyright Khronos Group, 2005 - Page 34

OpenGL ES 2.0 - What’s NewOpenGL ES 2.0 - What’s New

•Framebuffer Objects – same as EXT_framebuffer_object except…-No support for accum buffers or MRTs-Support for 3D textures is optional-Support for rendering directly into a mip level is optional

-Adds a new 16-bit RGB565 internal format for RenderBufferStorage

-8-bit stencil buffer is required

© Copyright Khronos Group, 2005 - Page 35

OpenGL ES 2.0 - What’s GoneOpenGL ES 2.0 - What’s Gone

•User Clip Planes•Enable/Disable(MULTISAMPLE)

-Multisampling is enabled if an EGL config that has samples > 1 is selected

•Anti-aliased lines•Points & anti-aliased points

-Only point sprites are supported•Occlusion Queries

© Copyright Khronos Group, 2005 - Page 36

OpenGL ES 2.0 - What’s OptionalOpenGL ES 2.0 - What’s Optional

•MapBuffer / UnmapBuffer•3D Textures•Non-power of 2 textures

-With support for all OpenGL ES wrap modes-Mip-mapping

•Half-float vertex and attribute data•Half-float and float texture formats

© Copyright Khronos Group, 2005 - Page 37

Vertex Arrays (vs. OpenGL 2.0)Vertex Arrays (vs. OpenGL 2.0)In• glVertexAttribPointer• glEnableVertexAttribArray• glDrawArrays• glDrawElements• Triangles, tri strips, tri fans, line, line strips, line loop, point sprites

Out• glVertexPointer• glTexCoordPointer• glColorPointer• glNormalPointer• glSecondaryColorPointer• glFogCoordPointer• glEdgeFlagPointer• glEnableClientState, glDisableClientState

• glArrayElement, glMultiDrawArrays, glDrawRangeElements

• Quads, quad strips, polygons and points

© Copyright Khronos Group, 2005 - Page 38

Vertices (vs. OpenGL 2.0)Vertices (vs. OpenGL 2.0)

In• glVertexAttrib{1234}f[v]

Out• Immediate Mode

- glBegin/glEnd- glVertex- All other glVertexAttrib* variants

• All other per-primitive attributes- glMultiTexCoord, glNormal, glColor, glFogCoord, glSecondaryColor, etc.

• Color index mode

© Copyright Khronos Group, 2005 - Page 39

Buffer Objects (vs. OpenGL 2.0)Buffer Objects (vs. OpenGL 2.0)In• glBindBuffer• glDeleteBuffers• glGenBuffers• glBufferData• glBufferSubData

Optional• glMapBuffer• glUnmapBuffer

© Copyright Khronos Group, 2005 - Page 40

Transformations (vs. OpenGL 2.0)Transformations (vs. OpenGL 2.0)

In• glViewport

Out• Everything else!

- glMatrixMode- glLoadMatrix- glPush/PopMatrix- glTranslate/glRotate/glScale

- glTexGen- glFrustum/glOrtho

© Copyright Khronos Group, 2005 - Page 41

Colors and Coloring (vs. OpenGL Colors and Coloring (vs. OpenGL 2.0)2.0)In• glFrontFace

Out• glMaterial• glLight• glLightModel• glColorMaterial• glShadeModel

© Copyright Khronos Group, 2005 - Page 42

Points, Lines, Polys (vs. OpenGL Points, Lines, Polys (vs. OpenGL 2.0)2.0)

In• Mutisampling

- Implementations not required to provide a multisample buffer

• glLineWidth• glPointSize• Culling• glPolygonOffset

Out• Point and line smooth• glPointParameters

- Now done in the vertex shader• Line and polygon stippling• GL_POLYGON_SMOOTH• glPolygonMode

- No point or line mode

© Copyright Khronos Group, 2005 - Page 43

OpenGL ES 2.0 – Pixels and BitmapsOpenGL ES 2.0 – Pixels and Bitmaps

In• glPixelStorei

- For loading textures and reading from the screen

- Only supports GL_PACK_ALIGNMENT and GL_UNPACK_ALIGNMENT

• glReadPixels- Limited number of formats

Out• Imaging subset (filters, histograms, minmax)

• glDrawPixels• glCopyPixels• glPixelZoom• glBitmap• glRasterPos

© Copyright Khronos Group, 2005 - Page 44

Textures (vs. OpenGL 2.0)Textures (vs. OpenGL 2.0)In• Most common formats

- GL_RGB, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA

• 2D/3D/Cubemaps- glTexImage/glTexSubImage- glCopyTexImage/- glCopyTexSubImage

• Compressed texture entry points

• Texture parameters- All filtering modes- Clamp-to-edge, repeat, and mirror-repeat wrap modes

Out• Texture Environment

- No fixed function blending!• 1D Textures• Texture Parameters

- No LOD control- No texture border- Thus, no clamp-to-border or clamp wrap modes

- Generate mipmaps• Texture Priorities

- glPrioritizeTextures- glAreTexturesResident

• Dynamic texture state queries- glGetTexImage, glGetTexParameter

• Fog

© Copyright Khronos Group, 2005 - Page 45

Per-Fragment Ops (vs. OpenGL 2.0)Per-Fragment Ops (vs. OpenGL 2.0)In• Stencil Test• Scissor Test• Sample Coverage• Alpha Blending

- Add, Subtract, ReverseSubtract

- glBlendEquationSeparate- glBlendFuncSeparate

• Depth Test• Dithering

Out•Occlusion Queries •Alpha Test•Some alpha blend modes

- MIN, MAX, LOGIC_OP•glDrawBuffer and glDrawBuffers- No MRTs

•Accumulation Buffer

© Copyright Khronos Group, 2005 - Page 46

OpenGL Shading OpenGL Shading Language ESLanguage ESJohn Kessenich

3Dlabs

© Copyright Khronos Group, 2005 - Page 47

Overview of GLSL ESOverview of GLSL ES•Language is very close to desktop OpenGL GLSL-As in OpenGL 2.0

•Compilation can occur off-device-Load binary interface

•Parallel track to the desktop GLSL-Both languages are version 1.10-ES differences driven by special ES market needs

•Most built-in state is removed-Significantly reduces implementation complexity

•Reduced expectations for-Size -Complexity-Suite of examples and conformance tests will establish baseline

© Copyright Khronos Group, 2005 - Page 48

OpenGL ES 2.0 Programmable PipelineOpenGL ES 2.0 Programmable Pipeline

APIVertexShader RasterizerPrimitive

Assembly

FragmentShader

DepthStencil

AlphaTest Dither

ColourBufferBlend

VertexBufferObjects

Vertices

Triangles/Lines/Points

PrimitiveProcessing

Frame Buffer

TextureEnvironment

ColourSum Fog

Fragment shaders replace Fixed

Function Texture, Color and Fog

Transformand

Lighting

Vertex shaders replace Fixed Function

Transform and Lighting

© Copyright Khronos Group, 2005 - Page 49

Vertex ShaderVertex Shader

Attribute 0

Uniforms Textures

Attribute 1Attribute 2Attribute 3Attribute 4Attribute 5Attribute 6Attribute 7

Varying 0Varying 1Varying 2Varying 3Varying 4Varying 5Varying 6Varying 7

Temporary variables

gl_Positiongl_FrontFac

ing

Vertex Shader

© Copyright Khronos Group, 2005 - Page 50

// Example Vertex Shader// Example Vertex Shader#version 110attribute vec4 Vertex;attribute vec2 VertexSt;uniform mat4 Transform;

varying mediump vec2 TexCoord;invariant gl_Position;

void main(){gl_Position = Transform * Vertex;TexCoord = VertexSt;}

© Copyright Khronos Group, 2005 - Page 51

Fragment ShaderFragment ShaderUniforms Textures

Temporary variables

gl_Position

gl_FragColor

Varying 0Varying 1Varying 2Varying 3Varying 4Varying 5Varying 6Varying 7

gl_FrontFacing

Fragment Shader

gl_Position

© Copyright Khronos Group, 2005 - Page 52

// Example Fragment Shader// Example Fragment Shader#version 110precision mediump float;

uniform sampler2D Sampler;varying vec2 TexCoord;

void main(){lowp vec4 color = texture2D(Sampler, TexCoord);color *= 0.5;gl_FragColor = color;}

© Copyright Khronos Group, 2005 - Page 53

Basic Similarity to GLSLBasic Similarity to GLSL•Basic Types-float, bool, and int-vectors and matrices

•Control flow-if-then-else-for, while, do-while, break, and continue-Function calls-Discard

•Almost the same built-in functions•Same pre-processor-#version-#extension

© Copyright Khronos Group, 2005 - Page 54

Extensions to GLSLExtensions to GLSL•Standard noise functions are now an extension

-noise1(), noise2(), noise3(), noise4()•Standard derivative functions are now an extension-dfDx(), dfDy(), fwidth()

•Example use of an extension…

#ifdef GL_OES_standard_noise#extension GL_OES_standard_noise : enable…… = noise1D(…);

#else// use substitute for noise…

#endif

© Copyright Khronos Group, 2005 - Page 55

Removals from GLSLRemovals from GLSL•1D Textures•Shadow Textures•Fewer attributes (8) and uniforms (384)•User clipping•Setting fragment depth from fragment shader•Built-in State

-All attributes-Most uniforms (still have depth-range) -All varying-Still have special variables

-gl_Position, gl_FragColor, gl_FrontFacing, gl_FragCoord, …

© Copyright Khronos Group, 2005 - Page 56

Additions to Desktop GLSLAdditions to Desktop GLSL•Portability to desktop

#ifdef GL_ES// ES specific code

#endif•Support for power management

-Multiple precisions•Support for removal of built-in state

-Invariance mechanism-Point sprite texture coordinates

© Copyright Khronos Group, 2005 - Page 57

PrecisionPrecision•Lower precision takes less power

-Language enables explicit expression of required precision

•lowp-good for color-(-2, 2) with 8 bits of precision-8 bit integers

•mediump-good for fragment/texture coordinates, others-(-214,214) with 10 bits of precision-10 bit integers

•highp-good for geometry, dependent lookups, others-(-262,262) with 16 bits of precision-16 bit integers

© Copyright Khronos Group, 2005 - Page 58

Precision ModifiersPrecision Modifiers•Apply to floating point types or integer types

lowp vec4 color;lowp int loopCounter;highp vec4 Position;

•Establish defaultprecision mediump float;precision lowp int;

•Vertex side starts with default as highp•Fragment side has no default for floating point•Make your varying variables match

© Copyright Khronos Group, 2005 - Page 59

InvarianceInvariance•Get the same result from the same computation

-For multi-passing-Typically for geometry, so vertices line up between passes

-Only applied to output variables-Generalization of ftransform()

•Exampleinvariant gl_Position; // makes existing variable invariantinvariant varying vec2 c; // make new invariant variable

•Make everything invariant-For debug purposes#pragma STDGL invariant(all)

© Copyright Khronos Group, 2005 - Page 60

Point SpritesPoint Sprites•Vertex shader writes gl_Position and gl_PointSize•New built-in fragment variable

mediump vec2 gl_PointCoord•Read it in the fragment shader•Provides (s,t) texture coordinates for fragment

-Position of fragment within the point•Can be used for

-Texture lookup-Procedural generation of point

© Copyright Khronos Group, 2005 - Page 61

CompilationCompilation•Flexible model•Online Compilation

-Standard API entry points-Can release compiler resources when done-Implementation could remotely do the compile

•Offline Compilation-Platform provided tools-Platform defined binary format-API to load binary online is part of OpenGL

© Copyright Khronos Group, 2005 - Page 62

Future OpenGL ES 2.X Pipeline?Future OpenGL ES 2.X Pipeline?

API

VertexShader Rasterizer

FragmentShader

VertexBufferObjects

SampleShader

ObjectShader

UniformShader

PrimitiveAssembly

PrimitiveProcessing

Frame Buffer

© Copyright Khronos Group, 2005 - Page 63

ConclusionConclusion•Talked about all significant differences•Orders of magnitude more stayed the same•Biggest change is precision qualification

-For power management

© Copyright Khronos Group, 2005 - Page 64

EGL 1.2EGL 1.2Jon Leech

SGI

© Copyright Khronos Group, 2005 - Page 65

Combined 2D and 3D GraphicsCombined 2D and 3D Graphics•EGL portable layer for graphics resource management-Graphics context management, Surface/buffer binding, Rendering synchronization

•EGL 1.2 add supports for OpenVG as well as OpenGL ES-Enables OpenVG and OpenGL ES to share rendering surfaces

•Use cases of OpenVG combined with OpenGL ES-OpenVG renders front/back buffer of OpenGL ES application (surface sharing)

-OpenVG renders to OpenGL ES texture buffer-OpenGL ES renders on OpenVG image buffer-Share OpenVG objects among multiples OpenVG graphics contexts

EGL 1.2Surface/bufferGraphics context

EGL 1.2 enables advanced, rendering

techniques that combine high-

performance 2D and 3D graphics

© Copyright Khronos Group, 2005 - Page 66

OpenGL ES-SC 1.0 OpenGL ES-SC 1.0 OverviewOverviewChris Hall

Seaweed Systems Inc.

© Copyright Khronos Group, 2005 - Page 67

Why OpenGL ES Safety Critical?Why OpenGL ES Safety Critical?•Graphics drivers can cause more crashes than any other component-Why you don’t want a regular graphics driver running in the plane which is flying you home!

•Need Certified/Certifiable Software-Every line of code is an opportunity for at least 1 bug

•Every line of certified code costs a lot of money-Total cost of producing certifiable software is 5-10x the cost of writing the software

-Process, requirements, testing, verification, validation and documentation•Today’s Applications – Avionics

-FAA is looking very carefully at COTS Graphics chips-FAA has mandated DO-178B certification process for software

•Many Avionics companies standardizing on OpenGL ES-SC -Rather than a range of arbitrary and proprietary OpenGL subsets-OpenGL ES-SC 1.0 will be used primarily for 2D displays-OpenGL ES-SC 1.1 will be defined for emerging 3D safety critical applications

•An open standard enables a certified pipeline product to be widely used-Significantly reducing implementation and certification costs

© Copyright Khronos Group, 2005 - Page 68

Emerging Safety Critical Emerging Safety Critical ApplicationsApplications•Avionics

-Avionics – not just safe implementations, but very low-power

-Less functionality in the chip, more implementation in software

•Automotive-Safety critical graphics will be key for integrated dashboard applications

•Medical Devices-Real-time display of medical data will require more OpenGL pipeline functionality

•Non-embedded Safety-Critical Applications – using desktop machines-Air Traffic control, Nuclear power plant control, Railway junction control, etc.

-COTS graphics parts and open standard drivers will be increasingly required

© Copyright Khronos Group, 2005 - Page 69

Differences to OpenGL ES 1.0Differences to OpenGL ES 1.0

•OES_single_precision is core extension•EXT_paletted_texture and EXT_shared_texture_palette required extensions-With some limitations-Critical to most Avionics 2D mapping applications-Separation of color table from the texture data allows rapid color table changes

•Uses only float, int, and unsigned byte types-Type conversion is wasted code for this class of applications

© Copyright Khronos Group, 2005 - Page 70

Additions to OpenGL ES 1.0Additions to OpenGL ES 1.0

•Begin/End paradigm is supported-In addition to vertex arrays-Data as code

•Display lists are supported -But not deletion

•DrawPixels and Bitmap are supported•Polygon and Line stippling are supported•Line antialiasing

-For high quality 2D applications

© Copyright Khronos Group, 2005 - Page 71

Things Removed from OpenGL ES 1.0Things Removed from OpenGL ES 1.0

•Texture matrix•Compressed textures•Multisampling•Copy tex_image•Fog•Dithering

© Copyright Khronos Group, 2005 - Page 72

Less Complexity than OpenGL ES 1.0Less Complexity than OpenGL ES 1.0

•Critical for reducing certification costs-Texturing-Alpha functionality-Blend functionality-Depth functionality

© Copyright Khronos Group, 2005 - Page 73

OpenGL ES-SC AcknowledgementsOpenGL ES-SC Acknowledgements

•Thanks also to the common profile working group…•And the many avionics companies who provided feedback.

•Claude Knaus, Esmertec - Editor•Bruce Stockwell, Seaweed Systems – Working Group Chair

© Copyright Khronos Group, 2005 - Page 74

Amy Questions?Amy Questions?