function calcLightAttenuation(lightDistance, cutoffDistance, decayExponent) {
        if (decayExponent > 0.0 && cutoffDistance !== 0.0) {
            return Math.pow(Math.clip(1.0 - lightDistance / cutoffDistance, 0, 1), decayExponent);
        }
        return 1.0;
    }
/**
     * This method calculates the light attenuation for point lights. The code is
     * ported to JavaScript from the three.js glsl shaders.
     * @param lightDistance
     * @param cutoffDistance
     * @param decayExponent
     * @returns {number}
     */
This method calculates the light attenuation for point lights. The code is
ported to JavaScript from the three.js glsl shaders.
This method calculates the light attenuation for point lights . The code is ported to JavaScript from the three . js glsl shaders .
function calcLightAttenuation(lightDistance, cutoffDistance, decayExponent) {
        if (decayExponent > 0.0 && cutoffDistance !== 0.0) {
            return Math.pow(Math.clip(1.0 - lightDistance / cutoffDistance, 0, 1), decayExponent);
        }
        return 1.0;
    }
function calcLightAttenuation ( lightDistance , cutoffDistance , decayExponent ) { if ( decayExponent > 0.0 && cutoffDistance !== 0.0 ) { return Math . pow ( Math . clip ( 1.0 - lightDistance / cutoffDistance , 0 , 1 ) , decayExponent ) ; } return 1.0 ; }
This method calculates the light attenuation for point lights.
This method calculates the light attenuation for point lights .