function updateLightMapTextureOnMesh(texBuf, mesh, textureWidth, textureHeight) {
        var tex;
        tex = new THREE.DataTexture(new Uint8Array(texBuf), textureWidth, textureHeight);
        tex.needsUpdate = true;

        // https://github.com/mrdoob/three.js/wiki/Updates

        // we need groupsNeedUpdate because otherwise we don't have a second uv set on our mesh
        mesh.geometry.groupsNeedUpdate = true;
        mesh.geometry.uvsNeedUpdate = true;
        mesh.material.lightMap = tex;
        mesh.material.needsUpdate = true;
    }
/**
     * Updates the lightmap Texture on a given Mesh
     * @param texBuf LightMap in form of ArrayBuffer
     * @param mesh The mesh on which the lightmap is applied onto.
     * @param textureWidth Texture width.
     * @param textureHeight Texture height.
     */
Updates the lightmap Texture on a given Mesh
@param texBuf LightMap in form of ArrayBuffer
@param mesh The mesh on which the lightmap is applied onto.
@param textureWidth Texture width.
@param textureHeight Texture height.
Updates the lightmap Texture on a given Mesh @param texBuf LightMap in form of ArrayBuffer @param mesh The mesh on which the lightmap is applied onto . @param textureWidth Texture width . @param textureHeight Texture height .
function updateLightMapTextureOnMesh(texBuf, mesh, textureWidth, textureHeight) {
        var tex;
        tex = new THREE.DataTexture(new Uint8Array(texBuf), textureWidth, textureHeight);
        tex.needsUpdate = true;
        mesh.geometry.groupsNeedUpdate = true;
        mesh.geometry.uvsNeedUpdate = true;
        mesh.material.lightMap = tex;
        mesh.material.needsUpdate = true;
    }
function updateLightMapTextureOnMesh ( texBuf , mesh , textureWidth , textureHeight ) { var tex ; tex = new THREE . DataTexture ( new Uint8Array ( texBuf ) , textureWidth , textureHeight ) ; tex . needsUpdate = true ; mesh . geometry . groupsNeedUpdate = true ; mesh . geometry . uvsNeedUpdate = true ; mesh . material . lightMap = tex ; mesh . material . needsUpdate = true ; }
Updates the lightmap Texture on a given Mesh
 @param texBuf LightMap in form of ArrayBuffer
 @param mesh The mesh on which the lightmap is applied onto.
Updates the lightmap Texture on a given Mesh @param texBuf LightMap in form of ArrayBuffer @param mesh The mesh on which the lightmap is applied onto .
// https://github.com/mrdoob/three.js/wiki/Updates // we need groupsNeedUpdate because otherwise we don't have a second uv set on our mesh