Hi Erik, On Mon, Jan 19, 2009 at 6:59 PM, Erik Podetti <[email protected]> wrote:
> But how can I write to a binary file 16-bit floating values? I read that > there's an OpenGL extension that should add the "half" GL data type > (http://www.nvidia.com/dev_content/nvopenglspecs/GL_ARB_half_float_pixel.txt)...but > I didn't succed in including it in any way. Anyone has already used this or > another type of variable to write float 16 values to a file? I'm not sure if OpenSG supports such file formats. If not, you could have a look at the "Half" class from http://www.openexr.com/. OpenEXR has support for reading/writing images with floating point data. The Half class in OpenEXR provides a C++ class that you can use as easily as using "int" and "float". However, if all you want to do is save 16 bit floating point images, then a quick way out is - do a ReadPixels to a buffer of the proper size (width*height*4*2 bytes for RGBA16F). Use format=GL_HALF_FLOAT_ARB and type=GL_RGBA - write all those bytes to the file To load the images - open the file, read in all the width*height*4*2 bytes - treat this buffer as the source for pixels - textures or images HTH -- Shree http://paracomp.sourceforge.net/ http://www.shreekumar.in/ ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
