Fixed only phong merge
This commit is contained in:
parent
63a0ec8f28
commit
9121a3281a
1 changed files with 1 additions and 12 deletions
|
@ -31,16 +31,5 @@ Color PhongShader::shade(Scene const &scene, Ray const &ray) const {
|
|||
fragmentColor += specular * illum.color;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &light: scene.lights()) {
|
||||
auto illum = light->illuminate(scene, ray);
|
||||
|
||||
Vector3d reflection = 2 * dotProduct(illum.direction, ray.normal) * ray.normal - illum.direction;
|
||||
Color diffuse = diffuseCoefficient * dotProduct(illum.direction, -ray.normal) * diffuseColor;
|
||||
Color specular = specularCoefficient * specularColor
|
||||
* std::pow(dotProduct(ray.direction, reflection), shininessExponent);
|
||||
fragmentColor += illum.color * diffuse + illum.color * specular;
|
||||
}
|
||||
|
||||
return fragmentColor;
|
||||
return fragmentColor;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue