Skip to content

Commit

Permalink
lights bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
EgeCiklabakkal committed Feb 22, 2019
1 parent bd8af97 commit 91a6aec
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ rgb Scene::rayColor(const Ray& r, int recursion_depth) const
rcolor += diffuseColor(r, record, light_ptr) +
specularColor(r, record, light_ptr);
}

rcolor += reflectionColor(r, record, recursion_depth);
}
// Add color from reflections
rcolor += reflectionColor(r, record, recursion_depth);

// color is in bytes
return rcolor;
Expand Down Expand Up @@ -236,9 +236,9 @@ void Scene::loadFromXML(const std::string& fname)
ss << child->GetText() << std::endl;
ss >> ambient_light.intensity[0] >> ambient_light.intensity[1] >> ambient_light.intensity[2];
element = element->FirstChildElement("PointLight");
PointLight *point_light = new PointLight();
while(element)
{
PointLight *point_light = new PointLight();
child = element->FirstChildElement("Position");
ss << child->GetText() << std::endl;
child = element->FirstChildElement("Intensity");
Expand All @@ -251,7 +251,6 @@ void Scene::loadFromXML(const std::string& fname)

lights.push_back(point_light);
element = element->NextSiblingElement("PointLight");

}

// Materials
Expand Down

0 comments on commit 91a6aec

Please sign in to comment.