Read pixels from render to target texture

Hello,

I am using the GPUComputationRenderer.js. I followed the https://threejs.org/examples/webgl_gpgpu_birds.html example and then got to the render part:
this.gpuCompute.getCurrentRenderTarget(this.myVariable).texture;

Of course, the texture.image.data does not exist since this data is on the CPU. My question is, how can I read the rendered pixels from the GPU from the returned texture above ?

Note: I already saw the https://threejs.org/examples/webgl_gpgpu_water.html example but the WebGLRenderTarget has type THREE.UnsignedByteType instead of THREE.FloatType. So, I assume the readRenderTargetPixels will not work in my case.

Thanks.

/cc

Sorry new here. What is /cc ?

Crossposts are always linked in the forum. In this way, devs can check if an answer was already provided at stackoverflow. And thus safe valuable work and time for not providing a redundant answer.

1 Like