|
Robert,
I worked with osgprerender to see if I could get the osg::Image readback to work. Unfortunately it seems that using that approach, versus attaching a texture, causes the results to be clamped to within [0,1]. The whole reason for using the ARB format and FBO was to get the full floating point range. I believe that using a texture attachment is the only way around the clamping.
Aside from patching osg::Image to properly handle the ARB texture format, my only course seems to be using glReadPixels while the FBO Texture is active. I looked into this, but like I said before, there doesn’t seem to be an easy (clean) way to get this. I have a post draw for the camera node that has access to the SceneView pointer. From there I can get the RenderStage. My camera is being drawn in a preRender, so it’s RenderStage is tucked into the preRenderList – of which there is no public access. There doesn’t seem to be a way for me to get the fbo handle so that I can enable it and read the texels.
Looking at the code for RenderStage, there already seems to be code ready to do glReadPixels. I just need to give it a valid osg::Image via setImage. So it looks like my big holdup is in figuring out and acquiring the RenderStage handle that applies to my CameraNode. Any suggestions?
Chuck -----Original Message-----
Hi Chuck, On 10/2/06, Chuck Seberino <[EMAIL PROTECTED]> wrote: I have some code that sets up a CameraNode with a FBO as the target. The texture attached to the FBO has a format of GL_RGB32F_ARB. This seems to work just great. The problem is that I want to be able to read in the value of the texture as an osg::Image after drawing. I have used image->readImageFromCurrentTexture(), but osg::Image doesn't know about the ARB formats when performing the bit size calculations. Is this a deficiency in computNumComponents() or is there something I am missing? Even hacking that method to calculate it correctly doesn't solve things. I didn't get a chance to dig deeper to see what the next roadblock was.
Robert. |
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
