overview and applications - khronos group...•only pixels inside a set of scissor rectangles are...
TRANSCRIPT
© Copyright Khronos Group, 2011 - Page 1
Overview and Applications
December 2011, DevU @ SIGGRAPH ASIA
Hwanyong LEE CTO and Technical Marketing Director, HUONE
Sales Representative in Korea, KHRONOS Group
© Copyright Khronos Group, 2011 - Page 2
Khronos Family of Standards
Embedded 3D Cross platform
desktop 3D
3D Digital Asset Exchange format
Advanced Audio Vector 2D
Context and Surface Management
Mobile OS Abstraction
Au
tho
rin
g a
nd
a
cce
ssib
ilit
y
Ap
pli
ca
tio
n
Acce
lera
tio
n
Parallel Computing
Plugin-free 3D Web Content
Steaming Media Safety Critical 3D
Syste
m
Inte
gra
tio
n
Window System Acceleration
A coordinated ecosystem of compute, graphics and media
standards and APIs
Video, Audio and Image Acceleration
Codec Creation
Hundreds of man years invested by industry experts to create a coordinated visual computing ecosystem for accelerated parallel computation, 3D, video, audio and
image processing on desktop, embedded and mobile systems
© Copyright Khronos Group, 2011 - Page 3
OpenVG
• Royalty-free open standard API
• Low-level 2D vector graphics rendering API
• OpenGL-style programming model
• Advanced feature set enables
- SVG,
- Flash,
- PDF, Postscript,
- Java (JSR 287, 271, 226)
- etc.
• Portable content
• Map Applications
• Hardware Acceleration
© Copyright Khronos Group, 2011 - Page 4
OpenVG Rendering Pipeline
© Copyright Khronos Group, 2011 - Page 5
OpenVG Renderer - Big State Machine
Input Object
Path Image Paint Font Mask
Context Stroke – Line Width, Dash End-cap – Butt, Round, Square Join – Bevel, Round, Miter (limit) Fill Rule – Non-zero / Even-odd Path Draw – Stroke, Fill, Fill and Stroke Image Draw – Normal, Multiply, Stencil Blending – Potter-Duff, Additive, Multiply, Darken, Lighten Transform – {Fill, Stroke} Paint to User, {Path, Image, Font} User to Screen Color Transform Scissoring and Masking
Output Object
Canvas
Path Image Mask
Aux. Command Path - Manipulate, Interpolate, Transform Canvas – Manipulate, Read, Write, Copy Image - Filter, Child VGU
© Copyright Khronos Group, 2011 - Page 6
Path
• Move
• Line
• Bezier (Quadratic, Cubic)
- Smooth Curves
• Elliptical Arcs
• Absolute / Relative Coordinates
• Path Interpolation / Transform
• Path Queries:
- Bounding Boxes
- Transformed Bounding Boxes
- Point along path
- Tangent along path
(sx, sy)
(px, py)
(ox, oy)
© Copyright Khronos Group, 2011 - Page 7
Stroking • Stroking takes a path and defines an outline around it:
- Line Width
- End cap style (Butt, Round, or Square)
- Line join style (Bevel, Round, or Miter)
- Miter limit (to convert long miters to bevels)
- Dash array and offset
Miter Length
25 10 30 10 30 10 30 ...
Dash array = { 10, 20, 30, 40} / Dash Phase = 35
© Copyright Khronos Group, 2011 - Page 8
Transformations • Paths use 2x3 affine transformations
• Images use 3x3 perspective transformations
• Transformation functions
- vgLoadIdentity
- vgLoadMatrix
- vgGetMatrix
- vgMultMatrix
- vgScale
- vgRotate
- vgTranslate
- vgShear
© Copyright Khronos Group, 2011 - Page 9
Transformation
PAINT Coordinate
Fill Paint Coordinate Fill Paint Coordinate
FILL_PAINT_TO_USER STROKE_PAINT_TO_USER
USER Coordinate
PATH USER Coordinate IMAGE USER Coordinate GLYPH USER Coordinate
SURFACE Coordinate
SURFACE Coordinate
PATH_USER_TO_SURFACE IMAGE_USER_TO_SURFACE GLYPH_USER_TO_SURFACE
© Copyright Khronos Group, 2011 - Page 10
Rasterization (continued) • The goal of rasterization is to determine a filtered alpha value for each pixel,
based on the geometry around that pixel
• Filters may be up to 3 pixels in diameter
0
0
0
0
0
.4
.6
0
0
.3
0
0
0
.9
.4
0
.1
.8
0
0
0
1
.3
0
.4
1
0
.1
.1
1
.7
.2
.5
1
.3
.9
1
1
1
1
.2
.9
.5
1
1
1
1
1
0
.4
.2
.9
1
.8
1
1
0
0
0
.2
.5
0
.3
.5
.8
© Copyright Khronos Group, 2011 - Page 11
Scissoring • Only pixels inside a set of scissor rectangles are drawn
• Scissoring is disabled by default
Display
Scissor Rectangles
Pixels drawn
Pixels not drawn
© Copyright Khronos Group, 2011 - Page 12
Masking • In addition to scissoring, a per-pixel mask may be applied
• The mask has an alpha value at each pixel that is multiplied by the alpha from
the rendering stage
• May be used to “cut out” an area, create area transitions
• Mask values may be modified using image data
- Fill, Clear, Set, Add, Subtract, Intersect
´ =
´ =
© Copyright Khronos Group, 2011 - Page 13
Mask Operation
• Clear, Fill, Set, Intersect, Union, Subtract
• Render to Mask
© Copyright Khronos Group, 2011 - Page 14
Paint Generation • Paint is generated pixel-by-pixel and applied to geometry
• The alpha from the previous stage (rendering + masking) is used to
determine how much paint to apply
• Separate paint objects for stroking, filling
• Paint is transformed by an affine transform
• Four types of paint are supported:
- Flat color paint
- Linear gradient paint: points (x1, y1) and (x2, y2), color ramp
- Radial gradient paint: center (x, y), focus (x, y), radius, color ramp
- Pattern paint based on an image, tiling mode
© Copyright Khronos Group, 2011 - Page 15
Paint Generation
© Copyright Khronos Group, 2011 - Page 16
Image Drawing
• Drawing Mode
Normal
Multiply
Stencil
© Copyright Khronos Group, 2011 - Page 17
Image API’s
• Child Image
• Image Convolution
• Image Filters (LUT)
© Copyright Khronos Group, 2011 - Page 18
Blending • Combine masked alpha from path with paint alpha
• Blend the result onto the drawing surface
• Blending is a function of:
- The paint (R, G, B) color
- The masked alpha value (path alpha ´ mask alpha ´ paint alpha)
- The destination (R, G, B) color
- The destination alpha value (1 if no stored alpha)
• There are 8 blending functions:
- Porter-Duff “source” mode (copy source to destination)
- Porter-Duff “source over destination”/ “destination over source”
- Porter-Duff “source in destination”/ “destination in source”
- Lighten (choose lighter of source and destination)
- Darken (choose darker of source and destination)
- Multiply (black source pixel forces black, white leaves unchanged)
- “Screen”(white source pixel forces white, black leaves unchanged)
- Additive (add pixel values, add alpha up to 1)
© Copyright Khronos Group, 2011 - Page 19
Blending * Image Draw Mode • Combine masked alpha from path with paint alpha
• Multiply and Stencil make different Result
© Copyright Khronos Group, 2011 - Page 20
Color Transform
• Scale and Bias of R, G, B, A
• Useful for making
- Color/Bright Adjustment
- Transition Effect (Dissolve, Fade-in/out)
© Copyright Khronos Group, 2011 - Page 21
Font
• OpenVG does NOT have Font System!
But, OpenVG has API for making Font System
• Making Font DB and
- Make Image of Glyph or
- Make Path of Glyph or
- Draw Glyph on canvas buffer
• Hinting by Font System or OpenVG Renderer
• Several font companies already supports OpenVG render
© Copyright Khronos Group, 2011 - Page 22
OpenVG with Native Graphics Processor
• CPU sending data and commands to OpenVG hardware
• OpenVG rendering pipeline is in the hardware
CPU Native Vector
Graphics Hardware
© Copyright Khronos Group, 2011 - Page 23
Software Implementation
• Many implementation alternatives
• Everything is processed on the CPU (or +FPU)
- Power consumption is often the CPU maximum power
CPU
© Copyright Khronos Group, 2011 - Page 24
OpenVG with a 3D GPU (tessellation)
• 3D hardware is not tailored for tessellating arbitrary paths to triangles
which causes significant pre-processing to the CPU
• Frame-rates can be discontinuous when tessellation computed infrequently
CPU
GPU Tessellation-based implementations require complex
polygon tessellation in the software driver
© Copyright Khronos Group, 2011 - Page 25
OpenVG with a 3D GPU (stencil)
• Path subdivision is computationally simpler than path tessellation
• Stencil buffer rasterization consumes a lot of memory bandwidth
CPU
GPU Triangles are rasterized
into stencil buffer to determine path areas
Stencil-based implementations require path subdivision in the software driver
© Copyright Khronos Group, 2011 - Page 26
OpenVG with Multimedia Hardware
• Using double buffer, fast image processing, BitBlt •
CPU
MM
Most of rasterization (Vector Graphics)
Selective hardware acceleration
© Copyright Khronos Group, 2011 - Page 27
Major Vector Graphics Technologies
SVG (Tiny)
OpenVG
JSR 226, 287, 271 OMA - DCD, MMS, WAP
HTML5 Canvas 2D
WebKit
GTK+
Cairo Graphics
MPEG Part 20
OpenGL (ES)
Lite ProfileAdobe Flash Player Lite versionVersion 10.1 later
Google Skia
Nokia Qt
Support / Dependent
Partial / Experimental Support
Blackberry JDE
© Copyright Khronos Group, 2011 - Page 28
Applications
• GUI
- Mobile Devices GUI – Samsung - Bitmap Graphics, Flash lite, OpenVG, Flash lite on OpenVG
- Qt Rendering on OpenVG
• Mapping
- GPS, map drawing
• Flash lite player
- Flash 10.1 Accelerating on OpenGL ES 2.0
• SVG Mobile Player
- MMS, DCD, MPEG4-LASeR, WAP, eBook, WebKit
- Java Bindings - JSR226, JSR271, JSR287
• Games
© Copyright Khronos Group, 2011 - Page 29
Applications: GUIs
TouchWiz GUI Croix GUI Magic Touch GUI
Multimedia Player BEAT DJ Simplified Main Menu
© Copyright Khronos Group, 2011 - Page 30
Nokia 500
• OpenVG accelerating Smart Phone
• UI Acceleration
© Copyright Khronos Group, 2011 - Page 31
Applications: Web, eBook, Rich Media
© Copyright Khronos Group, 2011 - Page 32
Applications: Monitoring, Mapping
© Copyright Khronos Group, 2011 - Page 33
OpenVG Roadmap
• OpenVG Lite Profile – Streamlined, refactored
- Investigations - No addition of feature
- No removal of major feature
- Most of major features can be accelerated on OpenGL ES 2.0
- Reduce HW and SW complexity
by reducing CTS complexity and pass conditional score
and limited and fixed Color Space
- Major Target Application – SVGTiny 1.1/1.2 , Flash Lite Player
- CTS - Making it more effective and more accessible to new vendor
• HUONE’s AlexVG StudyKit will be released in KITE
- With ppt File
© Copyright Khronos Group, 2011 - Page 34
Examples of OpenVG Application
•Demo