Hi,

Peter Wraae Marino wrote:
Hi osgUsers,

I'm still battling with the luminance texture to file.
The problem is I need to save a texture with 32bit floating point
value for each pixel in the texture
as a file and load it in at a later time. (16bit can also be used if
32bit isn't supported).

I have tried all these combinations:

m_rImage = new osg::Image;
//m_rImage->allocateImage( 1024, 1024, 1, GL_LUMINANCE, GL_BYTE );           // 
fails
//m_rImage->allocateImage( 1024, 1024, 8, GL_LUMINANCE, GL_BYTE );           // 
fails
//m_rImage->allocateImage( 1024, 1024, 24, GL_LUMINANCE, GL_BYTE );          // 
fails
//m_rImage->allocateImage( 1024, 1024, 16, GL_LUMINANCE, GL_FLOAT ); // fails
//m_rImage->allocateImage( 1024, 1024, 32, GL_LUMINANCE, GL_FLOAT ); // fails
//m_rImage->allocateImage( 1024, 1024, 24, GL_LUMINANCE, GL_4_BYTES
);      // fails with crash
//m_rImage->allocateImage( 1024, 1024, 24, GL_RGB, GL_BYTE );                   
     //
works ( image 8bit in each RGB )
//m_rImage->allocateImage( 1024, 1024, 24, GL_RGB, GL_FLOAT );                  
     //
works ( image 8bit in each RGB ), but all values zero
//m_rImage->allocateImage( 1024, 1024, 24, GL_RGB, GL_4_BYTES );             //
fails with crash
//m_rImage->allocateImage( 1024, 1024, 32, GL_RED, GL_FLOAT );                  
     //
works, but fails when writing image to file

mmm, I think the third parameter of allocateImage is the depth, as in for a 3D texture, not bit depth. So for a 2D image should always be 1.

jp

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to