Always private
DuckDuckGo never tracks your searches.
Learn More
You can hide this reminder in Search Settings
All regions
Argentina
Australia
Austria
Belgium (fr)
Belgium (nl)
Brazil
Bulgaria
Canada (en)
Canada (fr)
Catalonia
Chile
China
Colombia
Croatia
Czech Republic
Denmark
Estonia
Finland
France
Germany
Greece
Hong Kong
Hungary
Iceland
India (en)
Indonesia (en)
Ireland
Israel (en)
Italy
Japan
Korea
Latvia
Lithuania
Malaysia (en)
Mexico
Netherlands
New Zealand
Norway
Pakistan (en)
Peru
Philippines (en)
Poland
Portugal
Romania
Russia
Saudi Arabia
Singapore
Slovakia
Slovenia
South Africa
Spain (ca)
Spain (es)
Sweden
Switzerland (de)
Switzerland (fr)
Taiwan
Thailand (en)
Turkey
Ukraine
United Kingdom
US (English)
US (Spanish)
Vietnam (en)
Safe search: moderate
Strict
Moderate
Off
Any time
Any time
Past day
Past week
Past month
Past year
  1. stackoverflow.com

    glVertexAttribPointer(loc, 3, GL_HALF_FLOAT, GL_FALSE, 0); The format of the data itself is defined in the ARB_texture_float extension. While it's not officially named, it looks at least very similar to the IEEE 754-2008 format. I wrote conversion code based on that Wikipedia format description before, and it worked fine for OpenGL usage.
  2. Aug 5, 2023Small Float Formats, are floating-point values that use less than the standard 32-bits of precision. An example of these are 16-bit half-floats. This article details how these are encoded and used. ... but it also allows them to be used as Vertex Attributes by setting the format component type to GL_HALF_FLOAT. R11F_G11F_B10F
  3. apprize.best

    GL_HALF_FLOAT is a vertex and texture data type supported by OpenGL ES 3.0. The GL_HALF_FLOAT data type is used to specify 16-bit floating-point values. This can be useful, for example, in specifying vertex attributes such as texture coordinates, normals, binormals, and tangent vectors. Using GL_HALF_FLOAT rather than GL_FLOAT provides a two ...
  4. Appendix A. GL_HALF_FLOAT. GL_HALF_FLOAT is a vertex and texture data type supported by OpenGL ES 3.0. The GL_HALF_FLOAT data type is used to specify 16-bit floating-point values. This can be useful, for example, in specifying vertex attributes such as texture coordinates,normals,binormals, and tangent vectors.
  5. community.khronos.org

    Aug 2, 2024No version of GLSL supports half-precision floats as a variable data type. There are extensions such as AMD_gpu_shader_half_float, but nothing in core.. OpenGL 3.0 and later include the ARB_half_float_pixel and ARB_half_float_vertex extensions which allow for half-float texture/image data and half-float vertex data respectively. These are converted to float data in GLSL, similarly to how ...
  6. community.khronos.org

    [QUOTE=harsha;1254478]I am passing GLushort half_float values to shader as : glVertexAttribPointer(0, 1, GL_HALF_FLOAT, GL_FALSE, 0, iValueSize) [/QUOTE] The second argument (size) has a value of 1, which says that each array element has a single component. So TestVector.x will have a value from the iValueSize array, while the y, z and w ...
  7. community.khronos.org

    BTW, GL_HALF_FLOAT or GL_FLOAT is not important. GL_FLOAT works with GL_RGBA16F_ARB or GL_RGBA32F_ARB. Yes you are right, opengl do the conversion, 32 bits -> 16bits but in practice, I don't any interest to lost precision with GL_RGBA16F_ARB using float data.
  8. community.khronos.org

    I am using an FBO created from the following texture definition: glTexImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, GL_RG16F, 1920, 1080, 0, GL_RG, GL_HALF_FLOAT, NULL ); glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, texture/*generated earlier and bound*/, 0 ); Then I read the FBO data into a VBO: glBindBuffer( GL_PIXEL_PACK_BUFFER_ARB, vbo ...

    Can’t find what you’re looking for?

    Help us improve DuckDuckGo searches with your feedback

  1. In full OpenGL (unlike in OpenGL ES), shader code always operates with 32-bit floats. Starting with OpenGL 3.0, specifying vertex data as half-floats is supported, though. If the precision is sufficient for your needs, this can reduce memory usage for your vertex data, and reduce the bandwidth needed for vertex fetching.

    Keep in mind that the precision of a half-float is only about 3-4 decimal digits. So the accuracy really is seriously limited.

    As for how to use them, it's quite straightforward. If you have a pointer to half-float values, you store them in a VBO using glBufferData() or glBufferSubData(), just like you would for any other type. The glVertexAttribPointer() call will then look like this, using an attribute with 3 components as an example:

    glVertexAttribPointer(loc, 3, GL_HALF_FLOAT, GL_FALSE, 0);

    The format of the data itself is defined in the ARB_texture_float extension. While it's not officially named, it looks at least very similar to the IEEE 754-2008 format. I wrote conversion code based on that Wikipedia format description before, and it worked fine for OpenGL usage.

    Most languages don't have built-in types for half-floats. So you either will have to write a few lines of code to do the conversion from float to half-float, or use code that somebody else wrote.

    The following resources about half-float conversion are from a quick search. I have no personal experience with any of them, and you should do your own search to find the one most suitable for your needs:

    • Interesting article from Intel, explaining possible performance benefits: https://software.intel.com/en-us/articles/performance-benefits-of-half-precision-floats. This also mentions that Intel processors have instructions for the conversion (e.g. there's a _mm256_cvtps_ph intrinsic to convert from float to half-float).
    • Open source library for half-float operations and conversions: http://half.sourceforge.net/.
    • gcc documentation saying that it supports a half-float type (__fp16) for ARM targets.

    --Reto Koradi

    Was this helpful?
Custom date rangeX