Chromium Code Reviews| Index: src/core/SkLightingShader.cpp |
| diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp |
| index 02f14b34ddc9215c72070aeedc769a8f36418cd2..8a2aaa3bcb4c34a90b00b906abb65e7a2a620cb2 100644 |
| --- a/src/core/SkLightingShader.cpp |
| +++ b/src/core/SkLightingShader.cpp |
| @@ -49,7 +49,7 @@ public: |
| */ |
| SkLightingShaderImpl(sk_sp<SkShader> diffuseShader, |
| sk_sp<SkNormalSource> normalSource, |
| - const sk_sp<SkLights> lights) |
| + sk_sp<SkLights> lights) |
| : fDiffuseShader(std::move(diffuseShader)) |
| , fNormalSource(std::move(normalSource)) |
| , fLights(std::move(lights)) {} |
| @@ -134,6 +134,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 |
|
jvanverth1
2016/07/14 17:27:09
Add a TODO: to this comment or remove it.
|
| } |
| } |
| @@ -176,6 +177,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 |