- February 26, 2016 at 2:10 pm #52973
I have an issue using texture with unsized internal format GL_RGBA and GL_HALF_FLOAT_OES type in framebuffer color attachment in PVRFrame.
This creates a texture which works as expected:
* glTexStorage2D(target = GL_TEXTURE_2D, levels = 1, internalformat = GL_RGBA16F, width = 64, height = 64)
This also creates a texture which works as expected:
* glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat = GL_RGBA16F, width = 64, height = 64, border = 0, format = GL_RGBA, type = GL_HALF_FLOAT, pixels = 0)
This creates a texture which seems to be clamped (maybe to 1.0f?):
* glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat = GL_RGBA, width = 64, height = 64, border = 0, format = GL_RGBA, type = GL_HALF_FLOAT_OES, pixels = 0)
I would expect GL_HALF_FLOAT_OES work similar to GL_HALF_FLOAT, but this does not appear to be the case with PVRFrame.
Tested wirth PVRVFrame 10.2 – None (Host : GeForce GTX 760/PCIe/SSE2) (SDK Build: 4.0@3835662).March 3, 2016 at 2:11 pm #53009
Do you mean you created two frame buffers with two texture GL_RGBA and GL_RGBA16F_EXT.For the GL_RGBA one you always get color value clamp to 1.0f?
I can not reproduce this locally.
KevinMarch 9, 2016 at 2:43 am #53044
I think I can reproduce this issue now by the following code:
glTexImage2D(GL_TEXTURE_2D, 0, /*internalformat = */GL_RGBA, c_uiRenderTargetSize, c_uiRenderTargetSize, 0, GL_RGBA, GL_HALF_FLOAT_OES, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_FP16ColourAttachment, 0);
Then pixel channels will be clamped to [0, 1] for this render target.
But according to this EXT_color_buffer_half_float extension.
This type(GL_HALF_FLOAT_OES) texture should work with the following format:
So the internalformat should be RGBA16F_EXT, and the result will work as expected.
KevinApril 8, 2016 at 12:29 pm #53378
Thank you, this makes sense.
It is unfortunate that GL_EXT_color_buffer_half_float does not explicitly allow RGBA16F_EXT format with textures. Is there language anywhere which would say that renderbuffer formats can also be used with glTexImage2D() for example? If I strictly read GL_EXT_color_buffer_half_float, it only allows RGBA16F_EXT to be used with renderbuffers, not with textures.