function uniformf(cacheId, programObj, varName, varValue) {
      var varLocation = curContextCache.locations[cacheId];
      if(varLocation === undef) {
        varLocation = curContext.getUniformLocation(programObj, varName);
        curContextCache.locations[cacheId] = varLocation;
      }
      // the variable won't be found if it was optimized out.
      if (varLocation !== null) {
        if (varValue.length === 4) {
          curContext.uniform4fv(varLocation, varValue);
        } else if (varValue.length === 3) {
          curContext.uniform3fv(varLocation, varValue);
        } else if (varValue.length === 2) {
          curContext.uniform2fv(varLocation, varValue);
        } else {
          curContext.uniform1f(varLocation, varValue);
        }
      }
    }
/*
     * Sets a uniform variable in a program object to a particular
     * value. Before calling this function, ensure the correct
     * program object has been installed as part of the current
     * rendering state by calling useProgram.
     *
     * On some systems, if the variable exists in the shader but isn't used,
     * the compiler will optimize it out and this function will fail.
     *
     * @param {String} cacheId
     * @param {WebGLProgram} programObj program object returned from
     * createProgramObject
     * @param {String} varName the name of the variable in the shader
     * @param {float | Array} varValue either a scalar value or an Array
     *
     * @returns none
     *
     * @see uniformi
     * @see uniformMatrix
    */
Sets a uniform variable in a program object to a particular
value. Before calling this function, ensure the correct
program object has been installed as part of the current
rendering state by calling useProgram.

On some systems, if the variable exists in the shader but isn't used,
the compiler will optimize it out and this function will fail.

@param {String} cacheId
@param {WebGLProgram} programObj program object returned from
createProgramObject
@param {String} varName the name of the variable in the shader
@param {float | Array} varValue either a scalar value or an Array

@returns none

@see uniformi
@see uniformMatrix
Sets a uniform variable in a program object to a particular value . Before calling this function ensure the correct program object has been installed as part of the current rendering state by calling useProgram . On some systems if the variable exists in the shader but isn ' t used the compiler will optimize it out and this function will fail . @param { String } cacheId @param { WebGLProgram } programObj program object returned from createProgramObject @param { String } varName the name of the variable in the shader @param { float | Array } varValue either a scalar value or an Array @returns none @see uniformi @see uniformMatrix
function uniformf(cacheId, programObj, varName, varValue) {
      var varLocation = curContextCache.locations[cacheId];
      if(varLocation === undef) {
        varLocation = curContext.getUniformLocation(programObj, varName);
        curContextCache.locations[cacheId] = varLocation;
      }
      if (varLocation !== null) {
        if (varValue.length === 4) {
          curContext.uniform4fv(varLocation, varValue);
        } else if (varValue.length === 3) {
          curContext.uniform3fv(varLocation, varValue);
        } else if (varValue.length === 2) {
          curContext.uniform2fv(varLocation, varValue);
        } else {
          curContext.uniform1f(varLocation, varValue);
        }
      }
    }
function uniformf ( cacheId , programObj , varName , varValue ) { var varLocation = curContextCache . locations [ cacheId ] ; if ( varLocation === undef ) { varLocation = curContext . getUniformLocation ( programObj , varName ) ; curContextCache . locations [ cacheId ] = varLocation ; } if ( varLocation !== null ) { if ( varValue . length === 4 ) { curContext . uniform4fv ( varLocation , varValue ) ; } else if ( varValue . length === 3 ) { curContext . uniform3fv ( varLocation , varValue ) ; } else if ( varValue . length === 2 ) { curContext . uniform2fv ( varLocation , varValue ) ; } else { curContext . uniform1f ( varLocation , varValue ) ; } } }
Sets a uniform variable in a program object to a particular
 value.
Sets a uniform variable in a program object to a particular value .
// the variable won't be found if it was optimized out.