I'm trying to implement a simple GPU picker in three.js using the MeshDepthMaterial. I've managed to extract the color value using the following example: https://github.com/mrdoob/three.js/blob/master/examples/webgl_interactive_cubes_gpu.html
And by porting the unpackRGBAToDepth function from here to javascript to reconstruct the depth:
But the value comes out as a float between 0.0 and 255.0 ( I was expecting it to be between 0.0 and 1.0 or the actual depth). My question follows: how can I use this value, can it be translated to the actual depth? If so, how?