OSG doesn't have any facilities for this. When you project a texture onto an object, or cube map a texture onto an object, the texture coordinates are generated via FFP functionality or procedurally in your vertex shader. And you now want the texels, as it appears on the surface of an object, stored as a 2D image?
It seems like you'd need to have a mapping of your procedurally generated texture coordinates to normalized 2D texture coordinates. Then you could render a fullscreen textured quad with that mapping implemented in a shader, and read back the rendered image of the quad. There might be other approaches, but that's the strategy I'd try. But, as I said, OSG does not have any existing utilities for that. You'd have to write the code yourself. On Thu, Aug 7, 2014 at 9:00 AM, Conan <[email protected]> wrote: > Let me add some more detail/info to my question.... > > I am using RTT to create/modify a set of textures... actually a > osg::TextureCubeMap.... > I am taking this TextureCubeMap and projecting it onto an object. > After I project the CubeMap onto the object I want peel this texture, or > surface of the object, off as a single texture. > > > On 2014-08-07 08:49, Paul Martz wrote: > >> 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 <[email protected]> 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 >>> [email protected] >>> >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users- >> openscenegraph.org >> >>> [1] >>> >> >> -- >> >> -Paul >> >> >> >> Links: >> ------ >> [1] 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 >> > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- -Paul
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

