Skip to content

Commit

Permalink
Corrected light intensity. Before fix
Browse files Browse the repository at this point in the history
cb3dcff
there was an error where number of light was always 24
  • Loading branch information
buddhi1980 committed Aug 7, 2016
1 parent cb3dcff commit 996fe4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mandelbulber2/src/shaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,9 @@ sRGBAfloat cRenderWorker::LightShading(const sShaderInputData &input, const cLig
CVector3 lightVector = d;
lightVector.Normalize();

double intensity = 100.0 * light->intensity / (distance * distance) / number;
// intensity of lights is divided by 6 because of backward compatibility. There was an error
// where number of light was always 24
double intensity = 100.0 * light->intensity / (distance * distance) / number / 6;
double shade = input.normal.Dot(lightVector);
if (shade < 0) shade = 0;
shade = (1.0 - input.material->shading) + shade * input.material->shading;
Expand Down

0 comments on commit 996fe4e

Please sign in to comment.