# Measure light intensity

**URL:** <https://discourse.threejs.org/t/measure-light-intensity/37689>\
**Category:** Questions\
**Tags:** canvas-2d, offscreen-canvas, intensity\
**Created:** [May 1, 2022, 6:09pm UTC](https://discourse.threejs.org/t/measure-light-intensity/37689 "2022-05-01T18:09:48Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![javiersanjuan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/javiersanjuan/32/28039_2.png) [@javiersanjuan](https://discourse.threejs.org/u/javiersanjuan)\
**Post date:** [July 7, 2022, 6:54pm UTC](https://discourse.threejs.org/t/measure-light-intensity/37689/7 "2022-07-07T18:54:40Z")

</div>

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”).

```javascript
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
}

```

---

_[View the full topic](https://discourse.threejs.org/t/measure-light-intensity/37689)._
