Re: [osg-users] texture to file

2009-08-27 Thread Peter Wraae Marino
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

Re: [osg-users] texture to file

2009-08-27 Thread J.P. Delport
What format are you trying to write the file to? How are you attaching the image to your camera? i.e. where are the luminance values coming from? jp 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

Re: [osg-users] texture to file

2009-08-27 Thread J.P. Delport
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).

Re: [osg-users] texture to file

2009-08-27 Thread Peter Wraae Marino
Hi jp, If I was to post the entire render setup it would be so big.. but I'll try and break it up into pseudo form: -osg::Camera setSourceType GL_FLOAT -osg::Camera setInternalFormat GL_LUMINANCE32F_ARB -osg::Camera detaches osg::Camera::COLOR_BUFFER -osg::Camera attaches

Re: [osg-users] texture to file

2009-08-27 Thread J.P. Delport
Hi, sorry, more questions... Peter Wraae Marino wrote: Hi jp, If I was to post the entire render setup it would be so big.. but I'll try and break it up into pseudo form: -osg::Camera setSourceType GL_FLOAT you mean you set this on the camera's attached texture? -osg::Camera

Re: [osg-users] texture to file

2009-08-27 Thread Engvall ├ůsa
: Re: [osg-users] texture to file 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

Re: [osg-users] texture to file

2009-08-26 Thread Peter Wraae Marino
Hi Rafa, thanks.. i used your suggestion and it works. my only problem now is that the RTT i have created generates a GL_LUMINANCE image, which format do I use? I would like to load and use this texture again as luminance texture. any suggestions, Peter On Tue, Aug 25, 2009 at 12:25 PM, Rafa

Re: [osg-users] texture to file

2009-08-25 Thread Maxim Gammer
Hi... osg::ref_ptrosg::Image image = new osg::Image; image-readPixels. example if (osgDB::writeImageFile(*image,_filename)) { std::cout Saved screen image to `_filename` std::endl; } 2009/8/25 Peter Wraae Marino osgh...@gmail.com Hi osgUsers, I have a question about texture to

Re: [osg-users] texture to file

2009-08-25 Thread Peter Wraae Marino
Hi Maxim , I believe the readPixels is reading from the framebuffer and not the texture (or am I mistaken??) remember a RTT usually means I have 2 or more cameras in my scene... where one is used to do the RTT... so this can lead to a question how would osg::Image know which buffer to read from?

Re: [osg-users] texture to file

2009-08-25 Thread Rafa Gaitan
Hi Peter You can attach an image to the camera doing the rtt. osg::Image *image = new osg::Image; image-allocateImage(tex_width, tex_height, 1, GL_RGBA, GL_UNSIGNED_BYTE); // attach the image so its copied on each frame. camera-attach(osg::Camera::COLOR_BUFFER, image); Rafa. On Tue, Aug 25,