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

Re: [Public WebGL] Color reads from FBs with no ColorAttachment0



Title: OpenGL ES 2.0.25 (November 2, 2010)
Jeff,

Closest language I could find is on page 119.

"Effects of Framebuffer Completeness on Framebuffer Operations

If the currently bound framebuffer is not framebuffer complete, then it is an error to attempt to use the framebuffer for writing or reading. This means that rendering commands such as DrawArrays and DrawElements, as well as commands that read the framebuffer such as ReadPixels and CopyTexSubImage, will generate the error INVALID_FRAMEBUFFER_OPERATION if called while the framebuffer is not framebuffer complete."

Even though a depth-only FBO is framebuffer complete, wouldn't it make sense to generate INVALID_FRAMEBUFFER_OPERATION is for ReadPixels when there is no COLOR_ATTACHMENT?

cheers
- Dan


On 13/02/2014 12:19 pm, Jeff Gilbert wrote:
I can't find any language in GLES or GL about ReadPixels generating an error when there's no ColorAttachment0 (or ColorAttachmentI with ReadBuffer) to read from.

Things that are mentioned:
* INVALID_OP if ReadPixels `type` is float-y and the source is not, or vice versa.
* INVALID_OP if ReadPixels `format` is DEPTH_COMPONENT, STENCIL_INDEX, or DEPTH_STENCIL and the source is missing any of the respective buffers.
* INVALID_OP if the source is not FRAMEBUFFER_COMPLETE

However, depth-only FBs can be FRAMEBUFFER_COMPLETE, which throws a wrench in things.

The options:
* zero-fills
* [0,0,0,255]-fill (Chrome does this)
* INVALID_OPERATION (Firefox does this)

Thoughts? Maybe Mark or someone else knows more from the GL(ES) specs.

-Jeff

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------