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

Unified Diff: src/core/SkRadialShadowMapShader.cpp

Issue 2323383002: made point lights linear attenuation; also fixed point light depth bug (Closed)
Patch Set: added 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 | « samplecode/SampleShadowing.cpp ('k') | src/core/SkShadowShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRadialShadowMapShader.cpp
diff --git a/src/core/SkRadialShadowMapShader.cpp b/src/core/SkRadialShadowMapShader.cpp
index 24b54a5e2be3a1f2271c194b7e2dddbf076e1ff7..29773a63b513f3aaa6eb8fc6be87f92b708f6cb2 100644
--- a/src/core/SkRadialShadowMapShader.cpp
+++ b/src/core/SkRadialShadowMapShader.cpp
@@ -142,7 +142,9 @@ public:
// Modify the input texture coordinates to index into our 1D output
fragBuilder->codeAppend("float distHere;");
- fragBuilder->codeAppend("float closestDistHere = 0;");
+
+ // we use a max shadow distance of 2 times the max of width/height
+ fragBuilder->codeAppend("float closestDistHere = 2;");
fragBuilder->codeAppend("vec2 coords = vMatrixCoord_0_0_Stage0;");
fragBuilder->codeAppend("coords.y = 0;");
fragBuilder->codeAppend("vec2 destCoords = vec2(0,0);");
« no previous file with comments | « samplecode/SampleShadowing.cpp ('k') | src/core/SkShadowShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698