View Full Version : How to get data from a float point texture?

Ivan Popov
01-13-2011, 10:16 AM
Hi all.

I use OES_texture_float extension for WebGL.

I can write the float data in the texture and get data in the shader, moreover, after record in a texture in framebuffer, at the subsequent data read-out in shader I receive written float values, it means that textures working properly, but i can't get this float values in javascript.
I do:

var buf = new Float32Array(3);
gl.readPixels(0, 0, 1, 1, gl.RGB, gl.FLOAT, buf);

, but I got nothing.
What am I doing wrong?


01-14-2011, 05:07 PM
I think I read somewhere that you have to read it out as an RGBA (into a 4 element array).

Sorry - I don't remember where I saw that - and I could very easily be wrong.

Ivan Popov
01-14-2011, 07:31 PM
Of course, I tried to to get data and as gl. RGBA and as gl. ALPHA...
But, I didn't get any results.
I believe that it's not that I'm writing, and in webgl limitations or OES_texture_float extension is not ported to the end, or with errors.

01-15-2011, 08:37 AM

I've got exactly the same problem and already asked about it on webgl-dev group: https://groups.google.com/forum/#!topic ... 83_IvYbPM4 (https://groups.google.com/forum/#!topic/webgl-dev-list/s83_IvYbPM4).

It seems that this feature is not listed in OES_texture_float spec (http://www.khronos.org/registry/gles/ex ... _float.txt (http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt)) or any other, so I'm not sure if we can expect it soon.

02-24-2011, 12:39 PM
Any update on this issue? Are there any plans for an extension to support it?