[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] OES_texture_float_linear and OES_texture_half_float_linear extension proposals

On Fri, Mar 8, 2013 at 10:55 AM, Mark Callow <callow.mark@artspark.co.jp> wrote:

but there is no equivalent check for texture completeness.
There is, I've implemented one. https://github.com/pyalot/webgl-texture-float-extension-shims/blob/master/webgl-texture-float-extension-shims.js#L3
  1. Create a framebuffer
  2. Attach a 2x2 byte texture
  3. create a vertex shader for pass trough
  4. create a fragment shader sampling a sampler at vec2(1.0)
  5. create a program and attach both shaders
  6. create a 2x2 source texture of the desired floating point format fill it with adjecent black/white pixels
  7. create a vertex buffer with a quad
  8. bind the buffer
  9. query the vertex pointer location for from the program
  10. query the uniform location for the sampler from the program
  11. set the pointer
  12. set use the program
  13. set the uniform
  14. draw the vertices with drawArrays
  15. read back the pixels from the byte texture
  16. see if difference of the first pixel to 127 is smaller than some tollerance (say 10)
  17. delete all the gunk again
  18. return the result of the comparison

Given that and that most applications can relatively easily provide a reduced precision fallback, I withdraw my objection to moving OES_texture_float_linear to draft status.

Thank you.