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

[Public WebGL] readPixels and out of range pixels



I noticed the current spec doesn't appear to mention how out of range pixels are handled by calls to readPixels.

The OpenGL ES 2.0 spec makes them undefined, meaning you can have a back buffer that is 10x10 but call glReadPixels with 100x100 and you'll get back something.

That doesn't seem like it should go undefined in WebGL.

Two solutions off the top of my head.

1) leave it the way it is but specified that out of range pixels are 0,0,0,0

2) return INVALID_OPERATION if any out of range pixels are requested.

I think I'd prefer #2 because it makes it obvious when you are asking for something that is not part of the current framebuffer unless there is some other reason to go with #1.