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

Unified Diff: src/core/SkLightingShader.cpp

Issue 2118553002: adding new GM to demostrate new shadows (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fixed codez Created 4 years, 6 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
« gm/victor-shadows.cpp ('K') | « include/private/SkRecords.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index f32aa9f411b1f30a93c6f081713f0385c87f1051..c404b39719593f29860964e7dbe512ce16e1402c 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -164,6 +164,7 @@ public:
// TODO: handle more than one of these
fLightColor = lights->light(i).color();
fLightDir = lights->light(i).dir();
+ // get the handle to the shadow map if there is one
}
}
@@ -210,6 +211,9 @@ public:
this->emitChild(0, nullptr, &dstNormalName, args);
fragBuilder->codeAppendf("vec3 normal = %s.xyz;", dstNormalName.c_str());
+
+ // TODO: make this a loop and modulate the contribution from each light
+ // based on the shadow map
fragBuilder->codeAppendf("float NdotL = clamp(dot(normal, %s), 0.0, 1.0);",
lightDirUniName);
// diffuse light
« gm/victor-shadows.cpp ('K') | « include/private/SkRecords.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698