# Issue with PVRVFrame GL\_OES\_texture\_half\_float / GL\_EXT\_color\_buffer\_half\_float

**URL:** <https://forums.imgtec.com/t/issue-with-pvrvframe-gl-oes-texture-half-float-gl-ext-color-buffer-half-float/2432>\
**Category:** PowerVR Insider\
**Tags:** pvrvframe\
**Created:** [February 26, 2016, 1:10pm UTC](https://forums.imgtec.com/t/issue-with-pvrvframe-gl-oes-texture-half-float-gl-ext-color-buffer-half-float/2432 "2016-02-26T13:10:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timo-suorantarightwa](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@timo-suorantarightwa](https://forums.imgtec.com/u/timo-suorantarightwa)\
**Post date:** [February 26, 2016, 1:10pm UTC](https://forums.imgtec.com/t/issue-with-pvrvframe-gl-oes-texture-half-float-gl-ext-color-buffer-half-float/2432/1 "2016-02-26T13:10:35Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![szhipeng](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@szhipeng](https://forums.imgtec.com/u/szhipeng)\
**Post date:** [March 3, 2016, 1:11pm UTC](https://forums.imgtec.com/t/issue-with-pvrvframe-gl-oes-texture-half-float-gl-ext-color-buffer-half-float/2432/2 "2016-03-03T13:11:06Z")

</div>

Hi Timo,  
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.

Thanks,  
Kevin

---

<div class="post-metadata">

**Author:** ![szhipeng](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@szhipeng](https://forums.imgtec.com/u/szhipeng)\
**Post date:** [March 9, 2016, 1:43am UTC](https://forums.imgtec.com/t/issue-with-pvrvframe-gl-oes-texture-half-float-gl-ext-color-buffer-half-float/2432/3 "2016-03-09T01:43:43Z")

</div>

Hi Timo,  
I think I can reproduce this issue now by the following code:  
glGenFramebuffers(1,&m\_FP16FBO);  
glBindFramebuffer(GL\_FRAMEBUFFER,m\_FP16FBO);  
glGenTextures(1, &m\_FP16ColourAttachment);  
glBindTexture(GL\_TEXTURE\_2D, m\_FP16ColourAttachment);  
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:  
RGBA16F\_EXT 0x881A  
RGB16F\_EXT 0x881B  
RG16F\_EXT 0x822F  
R16F\_EXT 0x822D  
So the internalformat should be RGBA16F\_EXT, and the result will work as expected.

Thanks,  
Kevin

---

<div class="post-metadata">

**Author:** ![timo-suorantarightwa](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@timo-suorantarightwa](https://forums.imgtec.com/u/timo-suorantarightwa)\
**Post date:** [April 8, 2016, 10:29am UTC](https://forums.imgtec.com/t/issue-with-pvrvframe-gl-oes-texture-half-float-gl-ext-color-buffer-half-float/2432/4 "2016-04-08T10:29:01Z")

</div>

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.
