Skip to content
Snippets Groups Projects
Commit d945526f authored by Yoel's avatar Yoel
Browse files

calculateLightEmission does not need to transform

parent 7ae411b3
No related branches found
No related tags found
No related merge requests found
......@@ -15,14 +15,14 @@ LightSingleGroup::LightSingleGroup(const util::Mat4& matrix,
util::SurfacePoint LightSingleGroup::sampleLight() const {
auto sample = light->sampleLight();
return util::SurfacePoint(transform.toWorld.transformPoint(sample.point()),
transform.toWorldN.transformDir(sample.normal()),
sample.material);
auto result = util::SurfacePoint(
transform.toWorld.transformPoint(sample.point()),
transform.toWorldN.transformDir(sample.normal()), sample.material);
return result;
}
util::Vec3 LightSingleGroup::calculateLightEmission(const util::SurfacePoint& p,
const util::Vec3& d) const {
return light->calculateLightEmission(p,
transform.fromWorld.transformDir(d));
return light->calculateLightEmission(p, d);
}
} // namespace shapes
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment