© 2014 Adobe Systems Incorporated. All Rights Reserved.
GPU Accelerated Rendering In Adobe Illustrator CCVineet Batra | Senior Computer Scientist | Adobe Systems
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Introduction
Adobe’s very first application when released over 27 years ago
Industry-standard for vector graphics
Sophisticated graphics capabilities for printing, compositing and photo-realistic shading
Rich feature set including text, images, layers, transparency, blending modes and filters
Uses Adobe PDF standard for its underlying rendering capabilities
2
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Introduction
3
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Rich Feature Set
BeautifulIllustrations
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Vectors are not Pixels!
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Vectors are not Pixels!
Level of Detail
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Rendering : Building Blocks
• Transparency• Mask• Blend
Paths Paint Composite
• Color• Image• Pattern• Gradient
• Cubic Beziers• Fill & Stroke• Dash• Join• Cap• Miter
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Rendering : CPU Pipeline
8
• Generate path coverage• Super-sampling Anti-aliasing• Overscan
• Compute color values• Compute alpha values• Combine with coverage
• Based on Porter-Duff image composition model
• Additional transparency attributes and blend modes
The entire pipeline is resolution dependent!
Rasterize Paint CompositeBlit
© 2014 Adobe Systems Incorporated. All Rights Reserved.
CPU Rendering Performance
Intel(R) Xeon(R) CPU E3-1240 V2 @3.40GHz, 4 cores, 8 GB RAM
Performance
Pixels1680
X
1050
3840 X
2160
Time(ms) 178 608
FPS ~6 ~1.5
Complexity
11K+ Paths
2K+ Transparent Objects
~2K Gradients
© 2014 Adobe Systems Incorporated. All Rights Reserved.
CPU Rendering Performance (contd.)
Performance
Pixels1680
X
1050
3840 X
2160
Time(ms) 928 2073
FPS ~1 ~0.5
Complexity
~130K Paths
~66K Transparent Objects
Intel(R) Xeon(R) CPU E3-1240 V2 @3.40GHz, 4 cores, 8 GB RAM
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Challenges in Vector Graphics Rendering
11
Increasing screen resolutiono CPUs not able to keep up with fill rate
o HD, Retina, 4K, …
Interactive user experience Illustrator users want actual appearance while drawing
Increased expectations around responsiveness due to proliferation of touch devices
Increased complexity of artwork based on natural drawing paradigms
Changing technological landscapeo Increasing gap between pixel density and CPU compute power
o GPUs are mainstream and making full use of GPUs is essential for any modern computing platform
o Current graphics APIs on GPU are not optimal for compositing vector graphics
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Moving Rendering to GPU
Considerations and Constraints
o GPU vendors have different compliance with OpenGL standard
o No native support for cubic Bezier curves
Resolution dependent tessellation
o No native support for Adobe PDF graphics model
Transparency compositing
Blend Modes
o Non-RGB color spaces
o Anti-aliasing quality
12
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Using NVIDIA GPUs
NV Path Rendering
o Intrinsic support for cubic Bezier curves
o Understands Adobe PDF path rendering attributes (e.g. dash, cap, etc.)
o Supports SVG path formats as well
o Resolution-independent 2D graphics
o Allows use of programmable shaders to generate complex appearance
o API provides high level of abstraction
13
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Using NV Path Rendering
14
Creation & DeletionglGenPathsNVglPathCommandsNVglDeletePathsNV
FillglStencilFillPathNVglCoverFillPathNV
StrokeglStencilStrokePathNVglCoverStrokePathNV
Dash glPathDashArrayNV
Path Parameters glPathParameteriNV
Stroke Width GL_PATH_STROKE_WIDTH_NV
Cap & JoinGL_PATH_END_CAPS_NVGL_PATH_JOIN_STYLE_NV
Miter GL_PATH_MITER_LIMIT_NV
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Using NVIDIA GPUs
NV Blend Equation Advanced
o Provides native support for Adobe PDF Blend modes
o Faster performance than shader based blending
o Implemented in hardware in upcoming cards (Maxwell and later)
o Included in Khronos standard specification
15
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Using NV Blend Equation Advanced
16
glBlendEquation
© 2014 Adobe Systems Incorporated. All Rights Reserved.
GPU Rendering Performance
Performance
Pixels1680
X
1050
3840 X
2160
CPU178 ms 608 ms
6 fps 1.5 fps
GPU 38 ms 55 ms
26 fps 18 fps
Gain ~4.7x ~11x
Complexity
~11K Paths
~2K Transparent Objects
~2K Gradients
Intel(R) Xeon(R) CPU E3-1240 vs NVIDIA GeForce GTX 780 Ti
© 2014 Adobe Systems Incorporated. All Rights Reserved.
GPU Rendering Performance
Performance
Pixels1680
X
1050
3840 X
2160
CPU928 ms 2073 ms
~1 fps ~0.5 fps
GPU131 ms 170 ms
8 fps 6 fps
Gain ~7x ~12x
Complexity
~130K Paths
~66K Transparent Objects
Intel(R) Xeon(R) CPU E3-1240 vs NVIDIA GeForce GTX 780 Ti
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Demo
19
© 2014 Adobe Systems Incorporated. All Rights Reserved.
GPU Rendering Performance
Performance
Pixels1680
X
1050
3840 X
2160
CPU928 ms 2073 ms
~1 fps ~0.5 fps
GPU131 ms 170 ms
8 fps 6 fps
Gain ~7x ~12x
Complexity
~130K Paths
~66K Transparent Objects
Intel(R) Xeon(R) CPU E3-1240 vs NVIDIA GeForce GTX 780 Ti
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Remaining Challenges
Text
o No support for rich typographic features Unicode, Open Type fonts etc.
o No Font Hinting, require bitmaps for quality
Non-RGB color spaces
o CMYK
o Spot colors
o Color Profiles
Thin Strokes
o GPUs struggle to render thin strokes
Transparency groups
o Isolated, Non-isolated and knockout groups
o Requires lot of texture copying (slow)
21
© 2014 Adobe Systems Incorporated. All Rights Reserved.
Questions
22
UPCOMING GTC EXPRESS WEBINARSWednesday, September 17 CUDA 6.5 – Performance Overview
Jonathan Cohen, NVIDIA
Wednesday, September 24 Convolutional Networks: A Unified Machine Learning Approach to Computer PerceptionYann LeCun, Facebook & NYU
Wednesday, October 15 Essential CUDA Optimization TechniquesChris Mason, Acceleware
Register at www.gputechconf.com/gtcexpress
GTC 2015 CALL FOR SUBMISSIONS
Closes October 6
Submit proposals for:
TalksPosters
For more information and to submit a proposal go to:
www.gputechconf.com/presenters
© 2014 Adobe Systems Incorporated. All Rights Reserved.