Made shadows blurry (thru implementing variance mapping)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2224163005
Review-Url: https://codereview.chromium.org/2224163005
diff --git a/gm/shadowmaps.cpp b/gm/shadowmaps.cpp
index f953550..6c9738b 100644
--- a/gm/shadowmaps.cpp
+++ b/gm/shadowmaps.cpp
@@ -76,6 +76,11 @@
SkVector3::Make(0.1f, 0.2f, 1.0f)));
builder.add(SkLights::Light::MakeAmbient(SkColor3f::Make(0.4f, 0.4f, 0.4f)));
fLights = builder.finish();
+
+ fShadowParams.fShadowRadius = 4.0f;
+ fShadowParams.fBiasingConstant = 0.3f;
+ fShadowParams.fMinVariance = 1024;
+ fShadowParams.fType = SkShadowParams::kVariance_ShadowType;
}
protected:
@@ -95,11 +100,12 @@
// It's used to generate the depth maps.
sk_sp<SkPicture> pic(make_test_picture(kWidth, kHeight));
canvas->setLights(fLights);
- canvas->drawShadowedPicture(pic, nullptr, nullptr);
+ canvas->drawShadowedPicture(pic, nullptr, nullptr, fShadowParams);
}
private:
sk_sp<SkLights> fLights;
+ SkShadowParams fShadowParams;
typedef GM INHERITED;
};