Hi, Aaron.

1) You can render scene depth to texture(using additional camera), then render 
screen aligned quad with this texture on screen. Or you can use osgPPU nodekit 
to do this, in this case you will need to make pipeline of two units: 
UnitDepthBufferBypass and UnitOut (iirc)

2) You have two options: first you can work with raw data in your image before 
writing (there are interfaces to pointer to raw data), second - you can 
preprocess it with shaders (again, using osgPPU (add one UnitInOut with correct 
shader between two mentioned earlier) or add shader that will process data when 
drawing screen aligned quad mentioned earlier)

3) iirc image will resize if it is not large enough to capture entire 
window(with framebuffer rendering) or viewport (with fbo rendering) so you may 
need to setup your window correctly or create camera that render to fbo with 
correct dimensions and use it for image capture.

Cheers,
Sergey.

28.06.2011, 01:55, "aaron wetzler" <[email protected]>:
> Thanks hybr and robertosfield for your comments. Both useful and I will use 
> those tips.
>
> Although my solution does work its not enough and Im now stuck on a couple of 
> things. If you could point me in the right direction or to the right links 
> that would be great
>
> 1)How do I render the depth image to the screen instead of rendering the 
> color buffer?
> Whats the name of the function that lets me define which buffer I want 
> rendered to the screen (or FBO for that matter)
>
> 2) I actually want to invert my depth image and edit its values. How do I do 
> that before writing the image?
>
> 3) The dimensions I put in the allocateImage call i.e. (1024, 768)  have no 
> effect on the size of the written image. How can I change that?
>
> Looking forward to hearing from you
>
> Aaron
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=40958#40958
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to