Shading curves: vector-based drawing with explicit gradient

Shading curves: vector-based drawing
with explicit gradient control
Henrik Lieng1,2, Flora Tasse1, Jiří Kosinka1,3, Neil Dodgson1,4
University of Cambridge1
HiOA2
Univ. of Gronningen3
Victoria University of Wellington4
Colour gradients in vector graphics
Designers use 1D colour gradients heavily in their designs
• Linear gradients and radial gradients are the two options
2
Complex colour gradients
Definition: 2D colour gradients
Adobe Illustrator: The gradient mesh tool
3
The gradient mesh tool is hard to use
4
Diffusion curves are much easier to use
5
But Laplacian diffusion does not offer
gradient control
6
Bi-Laplacian diffusion does offer
gradient control
7
But, it is hard to use…
8
Problem statement
Define a vector primitive that:
• Gives rise to complex colour gradients
• Is defined from curves
• Offers colour gradient control
• Possesses consistent and predictable behaviour
9
Inspiration from art - chiaroscuro
10
Chiaroscuro drawing
11
Shading curves and shading profiles
12
13
14
Technical details
See the CGF paper for a full overview.
16
Overview of framework
Challenges
1. Meshing
2. Surface definition
3. Rendering and compositing
Meshing – problem statement
• For each curve, create one or two meshes
• Each mesh should be defined as far out from the curve
as possible (given the extent attribute)
• When all meshes are projected to the 2D image plane,
they should:
• not overlap each other (condition 1)
• not fold (condition 2)
20
Satisfaction of conditions
21
Meshing solution – finding the
maximum extent
Hill climbing using the distance transform on the input
curves:
1. Compute the distance transform D
2. For each control point C along the curve:
1. Start on the correct side of the curve, close to C
2. Move one step along the gradient of D
3. Repeat until a local maximum is hit or the extent value is
reached
Meshing solution – finding the
maximum extent
23
Meshing solution
Meshing solution
Rendering and compositing
Surface image
Intermediate image
Result
26
Rendering and compositing
Result
Intermediate image
27
Summary of contribution
Shading curve: a new vector primitive for complex colour
gradients
Principal contibution: explicit colour gradient control via the
shading profile
Bonuses:
• Curve-based (easy to use)
• Light-weight (efficient to render, easy to implement)
CGF 34(6):228-239
doi: 10.1111/cgf.12532
29
Diffusion curves vs. shading curves
Diffusion curves (DC)
Shading curves (SC)
• Curves interacting
with each other
(colour mixing)
• Entire domain can be
filled with colours
from DCs
• Explicit colour gradient
control (via shading
profile)
• Possess consistent and
predictable behavior
due to properties of
subdivision
• Very fast to render and
easy to implement
Gradient meshes vs. shading curves
Gradient meshes (GM)
Shading curves (SC)
• Very high level of
control
• Explicit control over
the colour gradient
surface (not implicit
like SC)
• Involved with curves
and not control
meshes (easier to use)
• Control meshes are
automatically created
and managed by the
framework