Fix ambient term.

This commit is contained in:
Vincent Lejeune 2014-08-07 01:02:30 +02:00
parent 79fba1779e
commit 986fd8050a
2 changed files with 9 additions and 1 deletions

View File

@ -504,6 +504,14 @@ void IrrDriver::generateDiffuseCoefficients()
testSH(sh_rgba, sh_w, sh_h, blueSHCoeff, greenSHCoeff, redSHCoeff);
// Diffuse env map is x 0.25, compensate
for (unsigned i = 0; i < 9; i++)
{
blueSHCoeff[i] *= 4;
greenSHCoeff[i] *= 4;
redSHCoeff[i] *= 4;
}
for (unsigned i = 0; i < 6; i++)
delete[] sh_rgba[i];
}

View File

@ -97,7 +97,7 @@ struct UniformHelper
template<unsigned N = 0, typename... Args>
static void setUniformsHelper(const std::vector<GLuint> &uniforms, const core::dimension2df &v, Args... arg)
{
glUniform2fWraper(uniforms[N], v.X, v.Y);
glUniform2fWraper(uniforms[N], v.Width, v.Height);
setUniformsHelper<N + 1>(uniforms, arg...);
}