We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5caf62 commit 60df6a0Copy full SHA for 60df6a0
src/Phong.cpp
@@ -34,7 +34,7 @@ const RGBColor Phong::shade(const ShadeRec& sr) const {
34
diffuse += Kd * std::fmax(L*N,0) * (light_color_inf * Lcolor + (1 - light_color_inf) * sr.material_ptr->color);
35
specular += Ks * pow(std::fmax(R*V,0), specular_e) * (light_color_inf * Lcolor + (1 - light_color_inf) * sr.material_ptr->color);
36
}
37
- const RGBColor ambient = Ka * sr.material_ptr->color;
+ const RGBColor ambient = Ka * (light_color_inf * sr.world_ptr->m_ambient->get_color(sr) + (1 - light_color_inf) * sr.material_ptr->color);
38
39
return (ambient + diffuse + specular);
40
0 commit comments