If you are creating/modifying the textures in shaders, then you must be
rendering to texture using an FBO. Are you doing this with an osg::Camera?
If so, then you already have an osg::Texture attached to your osg::Camera,
right?

You said you need them in an osg::Texture. Why? Are you actually saying
that you need a copy of the texture image data in host memory?

If you attach an osg::Image as the color attachment for your osg::Camera,
it will automatically do a glReadPixels to read the rendered image data
into the osg::Image's host memory buffer.

If you're not using any OSG constructs to create / modify the OpenGL
texture object, then just use OpenGL calls to read the texel data from GPU
back to host, and create an osg::Image / osg::Texture object with that
texel data..



On Thu, Aug 7, 2014 at 8:36 AM, Conan <d...@celticblues.com> wrote:

> Hi,
>
> I need to pull the texture(s) off an object after each rendered frame and
> put them in an osg::Texture*... (Not sure I said that all correctly,
> but...)  these textures are not loaded with the original geometry, are not
> in files, etc.  They are generated at startup and attached and modified
> through shaders each frame.
>
> I assume I need to use a post draw camera callback, but I am not sure how
> to get the textures since they don't have a filename associated with them
> in the stateset.
>
> Any suggestions?
>
> CD
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
   -Paul
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to