Re:Show HN: GPU-Accelerated Digit Recognition with WebGL
by willvarfar on Wednesday August 17, 2016 @05:08AM
(#12303295)
Intriguing! I was under the illusion that webGL was emit-only, and that Javascript programs can't read back any output generated by WebGL. I must be wrong or out of date :) So how does the script do it?
[ Parent
| on HN ]
Re:Show HN: GPU-Accelerated Digit Recognition with WebGL
by deafcalculus on Wednesday August 17, 2016 @05:24AM
(#12303360)
With the right extensions, you can render to a texture which can be sampled from in subsequent draw calls.
The framebuffer object extensions that allow you to write to 32-bit RGBA textures are widely supported on desktops and mobiles (OpenGL ES 2). But floating point textures are not. So, shaders resort to encoding 32-bit floats in RGBA textures. This unfortunately isn't a simple cast. More here: http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-t...