Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: include/private/SkShadowParams.h

Issue 2224163005: Made shadows blurry (thru implementing variance mapping) (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Trying different include path Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/private/SkRecords.h ('k') | samplecode/SampleShadowing.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 #ifndef SkShadowParams_DEFINED
8 #define SkShadowParams_DEFINED
9
10 /** \struct SkShadowParams
11
12 This struct holds information needed for drawing shadows.
13
14 fShadowRadius - radius of the shadow blur
15
16 fBiasingConstant - A constant used in variance shadow mapping to directly
17 0.0 - 1.0 reduce light bleeding. Essentially sets all shadows
18 ~.25 below a certain brightness equal to no light, and does
19 a linear step on the rest. Essentially makes shadows
20 darker and more rounded at higher values.
21
22 fMinVariance - Too low of a variance (near the outer edges of blurry
23 ~512, 1024 shadows) will lead to ugly sharp shadow brightness
24 distortions. This enforces a minimum amount of variance
25 in the calculation to smooth out the outside edges of
26 blurry shadows. However, too high of a value for this will
27 cause all shadows to be lighter by visibly different
28 amounts varying on depth.
29
30 fType - Decides which algorithm to use to draw shadows.
31 */
32 struct SkShadowParams {
33 SkScalar fShadowRadius;
34 SkScalar fBiasingConstant;
35 SkScalar fMinVariance;
36
37 enum ShadowType {
38 kNoBlur_ShadowType,
39 kVariance_ShadowType,
40
41 kLast_ShadowType = kVariance_ShadowType
42 };
43 static const int kShadowTypeCount = kLast_ShadowType + 1;
44
45 ShadowType fType;
46 };
47
48 #endif
OLDNEW
« no previous file with comments | « include/private/SkRecords.h ('k') | samplecode/SampleShadowing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698