Vinay Shah <vinay.s...@...> writes:
>
> Hi,
>
> I would like to render an image to a scene that is later used for image
processing. I am hoping to have the image
> in memory as an 24 bit RBG image.
>
> Is this possible without drawing it to the screen and taking a screen shot?
>
> Can I render without using the graphics card (it is a very simple scene).
>
> I'm new to the osg community so I apologize if this is an obvious question.
>
> Thanks you!
>
> Cheers,
> vinay
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13538#13538
>
>
Hi Vinay, there is an osg example called osgPrerender that does exactly what you
want. Look for the section with this:
if (useImage)
{
osg::Image* image = new osg::Image;
//image->allocateImage(tex_width, tex_height, 1, GL_RGBA,
GL_UNSIGNED_BYTE);
image->allocateImage(tex_width, tex_height, 1, GL_RGBA, GL_FLOAT);
// attach the image so its copied on each frame.
camera->attach(osg::Camera::COLOR_BUFFER, image,
samples, colorSamples);
camera->setPostDrawCallback(new MyCameraPostDrawCallback(image));
...
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org