Reading pixels from a HalfFloat RenderTarget

Hi all,

rewriting my question because it was very malformed…

How is it possible to read back pixels from a HalfFloat renderTarget ?

I’ve tried with this

const readPixel = new Float32Array(4);
renderer.readRenderTargetPixels(customPass.renderTarget, customPass.renderTarget.width*0.5, customPass.renderTarget.height*0.5, 1, 1, readPixel);

but as the array is float32 and not float16, I get only zeroes values.

If my rendertarget is set to FloatType then I get correct values. But I would like to have same results using HalfFloatType is possible.

Thanks a lot for your help

Eric

In HalfFloatType, the readPixel data type must be Uint16Array. But there is packing issue.
It needs to write original shader for half or float32 packing.
Maybe GL_RGBA32FEXT/ARB and GL_RGBA16FEXT/ARB are required, but Threejs seems to not supported.

I always change CubeMapRenderTarget(UnsignedByteType) when export. After exported, it just back to HalfFloat map.