Amir,

Everything you mentioned below is correct, but I want to make sure that
you also specify FBO as well.  If you don't the scene is rendered to a
standard OpenGL buffer which will clamp your values.

There is an example of a callback in the osgprerender example, just to
let you know.

-B

P.S.

Are you doing this on Microsoft?

---
RSC
BDC

> -----Original Message-----
> From: Amir Meteraso [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 28, 2006 2:22 PM
> To: Brad Colbert
> Cc: Amir Meteraso; [EMAIL PROTECTED]
> Subject: RE: OpenSceneGraph - Render to Image still clamping
> 
> Brad,
> 
> Just confirm i understood you suggestion:
> I need to use something like the osgprerender --image ... option?
> in this case the FBO is attach to an image which render the world
> attach to the camera and then apply the rezults to the image
> and then I can create a callback a read the results?
> If this is the case do I'll get unclam float value? (assume i create
> float image). I will give it a try and see what comes up..
> 
> Thanks again for you help
> Amir
> 
> Brad Colbert <[EMAIL PROTECTED]> wrote:
> 
>       Amir,
> 
>       You will want to create a callback for your camera that handles
> saving
>       the image to a file. I suggest you take a look at the
osgprerender
>       example. Although it doesn't save the rendered image to a file,
it
> does
>       perform some processing on the image before it is re-rendered.
It
>       should have everything you need.
> 
>       Cheers,
>       Brad
> 
>       ---
>       RSC
>       BDC
>       > -----Original Message-----
>       > From: Amir Meteraso [mailto:[EMAIL PROTECTED]
>       > Sent: Thursday, September 28, 2006 12:04 PM
>       > To: Brad Colbert
>       > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>       > Subject: RE: OpenSceneGraph - Render to Image still clamping
>       >
>       > Hello Brad.
>       >
>       > Thanks for your quick respond!.
>       > I also want to be able to read the texture data to a
file/other
>       > buffer for processing. Where and when do I set it up.
>       > Could you sent me a full source code that works for you.
>       > I basically like to render a world to a float buffer and read
back
>       > the float value to a file (using FBO and render to texture
seem
>       > to be the way but i didn't manage to get it to work with
>       OpenSceneGraph).
>       > if you have any OSG code that does this it would be great if
you
> can
>       > sent it to me
>       >
>       > Thanks again for you help
>       > Amir
>       >
>       > Brad Colbert wrote:
>       >
>       > Amir,
>       >
>       > Not a problem, I'll summarize below but you will have to
change
>       the
>       > following to better fit your application.
>       >
>       > // First allocate the destination image
>       > osg::Image* capImage = new osg::Image;
>       >
>       > // This defines the format of the destination image and the
>       > // format of the FBO texture.
>       > capImage->allocateImage(width, height, 1, GL_RGBA, GL_FLOAT);
>       > capImage->setInternalTextureFormat(GL_RGBA16F_ARB);
>       >
>       > // Now lets allocate and set up our camera that will render
the
>       > // scene to be captured.
>       > osg:ref_ptr camera = new osg::CameraNode;
>       >
>       > // Set up the camera to render to a Frame Buffer Object (FBO).
>       > // This is the part that removes the OpenGL fixed
functionality
>       > // clamping. NOTE: I've noticed something that appears to be
>       > // a bug in which I only receive 1/4 of the image. I haven't
>       > // looked into this further, however.
>       > camera-
>       >
>setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJE
>       > CT);
>       >
>       > // Set the image as your final destination
>       > camera->attach(osg::CameraNode::COLOR_BUFFER, capImage);
>       >
>       > // Set up the camera view information that is appropriate for
>       > // your application.
>       > ...
>       >
>       > I hope that helps.
>       >
>       > Cheers,
>       > Brad
>       >
>       > ---
>       > RSC
>       > BDC
>       >
>       > > -----Original Message-----
>       > > From: Amir Meteraso [mailto:[EMAIL PROTECTED]
>       > > Sent: Thursday, September 28, 2006 10:47 AM
>       > > To: Brad Colbert
>       > > Cc: Amir Meteraso; [EMAIL PROTECTED]
>       > > Subject: OpenSceneGraph - Render to Image still clamping
>       > >
>       > > Hello Brad,
>       > >
>       > > Sorry for pumping on you like this but I hope you can help
me
>       > > with an OpenSceneGraph problem I'm having -:).
>       > > I saw your post last month about trying to read data
>       > > from texture using FBO & OpenSceneGraph with data
>       > > been clam. I think i'm having the same problem where
>       > > I try to set up FBO with render to float texture and read
>       > > back the float results. I can't seem to find where should
>       > > i place the code to read the float data from the texture.
>       > > Do you have some code example that works for you
>       > > that does this.
>       > > Any help or pointer to relevant code will be great
>       > > Thanks
>       > > Amir
>       > >
>       > >
>       > >
>       > >
>       > >
>       > > ________________________________
>       > >
>       > > Want to be your own boss? Learn how on Yahoo! Small
Business.
>       > >
>       > x>
>       >
>       >
>       >
>       > ________________________________
>       >
>       > Want to be your own boss? Learn how on Yahoo! Small Business.
>       >
>       x>
> 
> 
> 
> ________________________________
> 
> Want to be your own boss? Learn how on Yahoo! Small Business.
>
<http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/r-inde
x>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to