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

Unified Diff: samplecode/SampleShadowing.cpp

Issue 2294323003: made point light shadows (Closed)
Patch Set: made req changes (comments) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkShadowShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleShadowing.cpp
diff --git a/samplecode/SampleShadowing.cpp b/samplecode/SampleShadowing.cpp
index 5715e1a6052f528f118015a131372dcf90cd00a8..35ef2c1d8b30191fc0b988013c8ba6dfedcfc092 100644
--- a/samplecode/SampleShadowing.cpp
+++ b/samplecode/SampleShadowing.cpp
@@ -22,10 +22,10 @@ public:
, fClearShadowMaps(false)
, fSelectedRectID(-1)
, fSelectedSliderID(-1)
- , fLightDepth(600.0f) {
+ , fLightDepth(400.0f) {
this->setBGColor(0xFFCCCCCC);
- this->updateLights(200, 200);
+ this->updateLights(100, 100);
fTestRects[0].fColor = 0xFFEE8888;
fTestRects[0].fDepth = 80;
@@ -53,7 +53,7 @@ public:
fShadowParams.fShadowRadius = 4.0f;
fShadowParams.fBiasingConstant = 0.3f;
- fShadowParams.fMinVariance = 1024;
+ fShadowParams.fMinVariance = 2048; // we need a higher min variance for point lights
fShadowParams.fType = SkShadowParams::kVariance_ShadowType;
}
@@ -162,6 +162,7 @@ protected:
void updateLights(int x, int y) {
SkLights::Builder builder;
+ builder.setAmbientLightColor(SkColor3f::Make(0.2f, 0.2f, 0.2f));
builder.add(SkLights::Light::MakePoint(SkColor3f::Make(0.2f, 0.4f, 0.6f),
SkVector3::Make(x - 50,
350 - y,
@@ -172,8 +173,6 @@ protected:
450 - y,
fLightDepth),
100000));
- builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.2f, 0.2f, 0.2f),
- SkVector3::Make(0.2f, 0.2f, 1.0f)));
fLights = builder.finish();
}
« no previous file with comments | « no previous file | src/core/SkShadowShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698