getIrradianceAt method
Implementation
Vector3 getIrradianceAt(Vector3 normal, Vector3 target) {
var x = normal.x, y = normal.y, z = normal.z;
var coeff = coefficients;
target.copy(coeff[0]).multiplyScalar(0.886227);
target.addScaledVector(
coeff[1], 2.0 * 0.511664 * y);
target.addScaledVector(coeff[2], 2.0 * 0.511664 * z);
target.addScaledVector(coeff[3], 2.0 * 0.511664 * x);
target.addScaledVector(
coeff[4], 2.0 * 0.429043 * x * y);
target.addScaledVector(coeff[5], 2.0 * 0.429043 * y * z);
target.addScaledVector(
coeff[6], 0.743125 * z * z - 0.247708);
target.addScaledVector(coeff[7], 2.0 * 0.429043 * x * z);
target.addScaledVector(
coeff[8], 0.429043 * (x * x - y * y));
return target;
}