Commit b3dd919e authored by Emeric Verschuur's avatar Emeric Verschuur

Correction de l'atténuation pour la lumière plane

parent bb6d3d2e
......@@ -228,6 +228,7 @@ LrColor LrSceneRayTracing::computeFromSource(const LrRay &ray, LrHit &hit)
//vecteur du point d'impact vers la lumiere
LrVector vectorLight(tmpOrig, ((LrEntityLight*)(*itObjs))->getPos());
Real dist = vectorLight.getNorme();
LrColor colorTmp = LrColor::BLACK;
vectorLight.normalize();
if ((vectorLight*hit.normal) > 0.0f)
{
......@@ -235,16 +236,13 @@ LrColor LrSceneRayTracing::computeFromSource(const LrRay &ray, LrHit &hit)
if (m_binder->getIntersection(rayLight, NULL, 0.0f, dist) == false)
{
colorResult += (((LrEntityLight*)(*itObjs))->getColor())*hit.optic->compute(rayLight.getDirection(),-ray.getDirection(),hit.normal,hit.tangent,hit.u,hit.v);
colorTmp += (((LrEntityLight*)(*itObjs))->getColor())*hit.optic->compute(rayLight.getDirection(),-ray.getDirection(),hit.normal,hit.tangent,hit.u,hit.v);
}
}
colorResult += colorTmp/nbRayOnLight;
}
colorResult=colorResult/nbRayOnLight;
}
return colorResult;
return colorResult /*/ m_lights.size()*/;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment