Measure light intensity

Hi there,
I couldn’t solve this problem. At the end, what I did was using this code to capture the color of any pixel in the canvas (by collecting the information of each pixel on the screen using a “render target”).

var rtTexture = new THREE.WebGLRenderTarget(
    sizes.width,
    sizes.height,
    {minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat, type: THREE.FloatType})

function capture()
{
    renderer.clear()
    renderer.setRenderTarget( rtTexture )
    renderer.render( scene, camera )

    renderer.setRenderTarget( null )
    renderer.render( scene, camera )

    var read = new Float32Array( 4 )
    renderer.readRenderTargetPixels( rtTexture, sizes.width / 2 , sizes.height / 2, 1, 1, read )

    return read
}