Hi,

I've been banging my head against how to save a 3D texture out to a dds file 
for some time now. I've read posts that suggest simply attaching the texture's 
image to the buffer rather than the texture itself. I've done that for 2D 
textures with no problem. However, I don't see how that will work in this case; 
given the setup below.


Code:

...
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
camera->setImplicitBufferAttachmentMask(osg::Camera::IMPLICIT_COLOR_BUFFER_ATTACHMENT,
 osg::Camera::IMPLICIT_COLOR_BUFFER_ATTACHMENT );
camera->attach(osg::Camera::COLOR_BUFFER0, tex1, 0, 
osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER);
camera->attach(osg::Camera::COLOR_BUFFER1, tex2, 0, 
osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER);
viewer.frame();
...




So, after I render the frame I want to be able to say

Code:

osgDB::writeImageFile( *tex1->getImage(), "foo.dds" )




But, of course, this doesn't work since the image isn't updated when the 
texture changes. Is there a strait forward way to get the texture data back to 
an image that I'm missing?
  
Thank you!

Cheers,
Trystan[/code][/list]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43837#43837





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

Reply via email to