Forums - 16f or 32f texture support?

10 posts / 0 new
Last post
16f or 32f texture support?
frezorer
Join Date: 2 Mar 14
Posts: 5
Posted: Sun, 2014-03-02 15:36

Hi!

I want to load a HDR-texture and use it in a GLSL shader on my Nexus 5. 

I'm using GLES2 which means there is no support in the standard for textures with 16f or 32f precision per channel.

Do the adreno chipset has any additional support for this through extensions? When queried the extension list on the device, I found none that I feel matched.

I believe there is support for what I want in GLES3, which the device supports, but I rather keep to GLES2 if I can and use extensions.

Any help on the matter is appreciated :)

Thanks on beforehand!

  • Up0
  • Down0
jhicks Moderator
Join Date: 6 Feb 14
Posts: 11
Posted: Mon, 2014-03-03 11:09

Would GL_OES_texture_float and GL_OES_texture_half_float serve your purposes? We support those extensions.

https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt

  • Up0
  • Down0
frezorer
Join Date: 2 Mar 14
Posts: 5
Posted: Wed, 2014-03-05 14:19

Well almost..
I found this post helpful: https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/mobi...

But he was using the NDK and I'm purely using the SDK. My intution says that google has to build in support for extensions unless I want to expose them my self, but that requires the NDK and some JNI code if I understand it correct.

I have found no way to use extensions using the SDK purely, which makes sense I think.

So to verify: Can I use GL_EXT_color_buffer_half_float using the Android SDK only?

 

Thanks!

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2014-03-11 15:47

Yes, you'll be able to use the extensions using the Android SDK.(e.g. by accessing the GLES20 java class - http://developer.android.com/reference/android/opengl/GLES20.html).  For example, call glGetString(GL20.GL_EXTENSIONS) and search for the availablily of the desired extension.

  • Up0
  • Down0
frezorer
Join Date: 2 Mar 14
Posts: 5
Posted: Wed, 2014-03-12 02:45

Querying extensions are not the same as  using extensions. So, yes I know how to query and see which ones are available, but I want to use them as well. Since java does not support function pointers and no extensions are exposed through the JNI interface I cannot see any way to use these extensions in Java. Of course I could probably write a wrapper my self, but I want to keep away from the NDK. 

So when I query configs with EGL I get no config which has more than 8bit per color channel. Thus I cannot use the color buffer half float implementation that is supported and mentioned earlier in this thread.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2014-03-12 13:49

Using floating point textures shouldn’t require assessing a new function pointer – just making new parameters(HALF_FLOAT_OES, FLOAT) available to TexImage2D, TexSubImage2D, etc.

Also the EXT_color_buffer_half_float extension is used for defining Framebuffer Objects (FBOs), not EGL displays.

  • Up0
  • Down0
frezorer
Join Date: 2 Mar 14
Posts: 5
Posted: Thu, 2014-03-13 01:03

hmm.. but how do I know which value the parameter HALF_FLOAT_OES should have? 
It is not a part of GLES20. Or do I look it up in some documentation here at qualcoms site?

Ah ok, so that extension basically enables what the ES3 specification specifies regarding floating point testures.
So if I understand it correctly there is no way to bind a HDR texture and render it to the color buffer in OpenGL ES?

This means that the only way to render a HDR texture to the color buffer is:

1. Bind HDR texture
2. Render HDR texture to FBO(with a float texture as target) tone mapped.
3. Bind resulting texture as a normal texture and draw it the color buffer.

Or did I miss something?

 

 

 

  • Up0
  • Down0
Dave Astle
Profile picture
Join Date: 19 Oct 12
Location: San Diego, CA
Posts: 99
Posted: Thu, 2014-03-13 08:21

Tokens in OpenGL/OpenGL ES are just constant integer values, and if they aren't defined in the header you are using, you can always just look them up in the extension spec. So from the spec jhicks liked to above, GL_HALF_FLOAT_OES is defined to be 0x8D61.

  • Up0
  • Down0
frezorer
Join Date: 2 Mar 14
Posts: 5
Posted: Thu, 2014-03-13 15:25

Since I'm using the android sdk and java there are no header files, thus I cannot reference the constant like I would in C for instance. But I guess the constants won't change when being passed through the JNI layer so I could try that one. Or I could simple change to GLES 3.0 and use GL_HALF_FLOAT. 

  • Up0
  • Down0
torstenrohlfing
Profile picture
Join Date: 11 Dec 14
Location: Mountain View
Posts: 4
Posted: Thu, 2015-01-15 15:40

Has anyone on this thread actually been able to create a framebuffer for half-float on the Nexus 5?

At least running on Kitkat, I seem to be able to create a half-float texture, but not attach it to a framebuffer. See separate thread:

  https://developer.qualcomm.com/forum/qdn-forums/maximize-hardware/mobile-gaming-graphics-adreno/28360

There, I am referring to a Nexus 4, but I am having the same problem on the Nexus 5 with Kitkat. Same device (literally, the very device flashed to a different Android version) running Lollipop does the half-float texture and framebuffer just fine.

I am starting to wonder if there is a bug in the Kitkat GLES driver?

Thanks!

Torsten

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.