The opengl es3 specification says that
"The error INVALID_OPERATION is generated if signed integer RGBA data is required
and the format of the current color buffer is not signed integer; if unsigned integer
RGBA data is required and the format of the current color buffer is not unsigned
integer; or if floating- or fixed-point RGBA data is required and the format of the
current color buffer is signed or unsigned integer."
So can we create a framebuffer with renderbuffer object as color attachment with format GL_RGBA8I , and copy this as a texture using glCopyTexSubImage2D with format GL_RGBA16I. Is it valid?
Will it not conflict for different size per color component?
When I am trying this for Opengl on Nvidia, it is allowing me to do so.
But want to know for opengl es 3.
one doubt on above question,
according to me we use render buffer attachment only when we don’t have to read data or we use it only when we blit data in framebuffer. so for performing we should use texture attachment instead of render buffer attachment. I am just wondering how does the above code work? So in nutshell, when we use texture attachment and not render buffer attachment or vice-versa?
Sorry for the confusion, I am using render buffer object as color attachment to framebuffer And the renderbuffer object has format GL_RGBA8I. Binding that frambuffer drawing something to it.
Now has defined another texture with format GL_RGBA16I .Then copying some part of that framebuffer data using CopyTexSubImage2D to modify the GL_RGBA16I texture data.
For CopyTexImage* its working. But want to know is it valid for CopyTexSubImage* ?
I am experimenting with CopyTexSubImage*.
The error you quote is only for BlitFramebuffer.
For CopyTexSubImage, converting RGBA8I to RGBA16I is legal in desktop GL, but illegal in ES3. You can follow the convoluted language in the ES3 spec:
3.8.5 Alternate Texture Image Specification Commands
…The same constraints and errors apply to the TexSubImage commands’ argument format and the internalformat of the texel array being respecified as apply to the format and internalformat arguments of its TexImage counterparts.
3.8.3 Texture Image Specification
…Specifying a combination of values for format, type, and internalformat that is not listed as a valid combination in tables 3.2 or 3.3 generates the error INVALID_OPERATION.
…and if you look at table 3.2, the only legal combination of format,type for RGBA16I is RGBA_INTEGER, SHORT.
.: ES3 does not allow conversion from BYTE to SHORT, for [Copy]Tex[Sub]Image commands.
However, ES3 does allow that conversion for BlitFramebuffer. Or for just, you know, drawing a quad with your own shader.