Floating point textures and readPixels

292 views
Skip to first unread message

Szymon Nowak

unread,
Jan 13, 2011, 4:52:00 PM1/13/11
to webgl-d...@googlegroups.com
Hey,

is it possible to read pixels from floating point textures? WebGL spec (https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html#5.13.12) mentions RGBA/UNSIGNED_BYTE as the only allowed combination and OES_texture_float spec doesn't mention readPixels at all. If it's not possible via readPixels is there any other way?

Cheers,
Szymon

LARRY LI

unread,
Jan 14, 2011, 1:22:42 AM1/14/11
to webgl-d...@googlegroups.com
it depends on platform per i think. some platform did not support floating point texture at all. open for discussion

2011/1/14 Szymon Nowak <szi...@gmail.com>

Ben Adams

unread,
Nov 12, 2012, 6:35:49 PM11/12/12
to webgl-d...@googlegroups.com
Is there any solution to performing readPixels on a float framebuffer? (While using the OES_texture_float extension)

Kenneth Russell

unread,
Nov 12, 2012, 7:23:47 PM11/12/12
to webgl-d...@googlegroups.com
It won't be possible to do this directly until the WebGL spec is
updated to the OpenGL ES 3.0 level. This is not a short term
proposition so I suggest you try to find workarounds. People have
suggested doing multiple renders and readPixels operations to extract
multiple levels of precision 8 bits per channel at a time.

-Ken

Ben Adams

unread,
Nov 12, 2012, 7:43:11 PM11/12/12
to webgl-d...@googlegroups.com
Hi Ken

Thank you for this information, we will try something similar.

Obviously a straight conversion would increase the draw calls fourfold, with a requisite loss in performance, so I hope this will be implemented in future.

Kind regards
Ben

Kenneth Russell

unread,
Nov 12, 2012, 7:48:41 PM11/12/12
to webgl-d...@googlegroups.com
On Mon, Nov 12, 2012 at 4:43 PM, Ben Adams <thund...@illyriad.co.uk> wrote:
> Hi Ken
>
> Thank you for this information, we will try something similar.
>
> Obviously a straight conversion would increase the draw calls fourfold, with
> a requisite loss in performance, so I hope this will be implemented in
> future.

It will be. There are some steps that have to be completed before
beginning this major upgrade, though, such as snapshotting a stable
copy of the conformance test suite again.

-Ken
Reply all
Reply to author
Forward
0 new messages