Added simplistic lambert implementation
This commit is contained in:
parent
d00599ced6
commit
9dcbefe5a5
1 changed files with 6 additions and 2 deletions
|
@ -8,6 +8,10 @@ Color LambertShader::shade(Scene const &scene, Ray const &ray) const {
|
|||
Color fragmentColor;
|
||||
|
||||
// IMPLEMENT ME
|
||||
|
||||
return fragmentColor;
|
||||
for (auto& light : scene.lights()) {
|
||||
auto illum = light->illuminate(scene, ray);
|
||||
auto lightAngle = dotProduct(ray.normal, normalized(illum.direction));
|
||||
fragmentColor += illum.color * std::abs(lightAngle);
|
||||
}
|
||||
return fragmentColor * diffuseColor;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue