haskell-opengl / OpenGL

Haskell bindings to OpenGL
http://www.haskell.org/haskellwiki/OpenGL
BSD 3-Clause "New" or "Revised" License
147 stars 26 forks source link

GL3.0 half-float formats #8

Open Laar opened 13 years ago

Laar commented 13 years ago

quoting appendix N.1 'New Features' from the OpenGL 3.0 spec: "Half-float (16-bit) vertex array and pixel data (GL_NV_half_float and GL_ARB_half_float_pixel)."

edit: added the underscores

Laar commented 13 years ago

This probably includes adding a lot of functions. It might be useful to have the two extension specifications at hand http://www.opengl.org/registry/specs/NV/half_float.txt http://www.opengl.org/registry/specs/ARB/half_float_pixel.txt

ekmett commented 9 years ago

FWIW- I have an implementation of Half as an actual haskell numeric data type that sits in my openexr bindings:

https://github.com/ekmett/openexr/blob/master/Graphics/OpenEXR/Half.hsc

It currently cheats and uses the OpenEXR conversions to/from Float, but those could be written by hand.

If we're going to bind out to Half's it'd be nice to have a data type that let you duplicate their behavior CPU side.