Re: [osg-users] Saving a Texture3D to an Image

2011-11-13 Thread Trystan Larey-Williams
Figured out how to solve the problem in the last post. I just set the texture I want to write on the camera itself so that its active once the post draw is executed. For instance, the code above simply changes to the following. Code: ...

Re: [osg-users] Saving a Texture3D to an Image

2011-11-12 Thread Robert Osfield
Hi Trystan, Have a look at : Image::readImageFromCurrentTexture(..) You'd need to call this from the graphics thread that has you've have render to the texture from - for instance using a Camera Post or FinalDrawCallback. After this readImage you could do the writeImageFile as well to

Re: [osg-users] Saving a Texture3D to an Image

2011-11-12 Thread Trystan Larey-Williams
Hi Robert, Thanks for the reply! That seems to work only if I don't need to set other texture states. For instance, the following fails (2D texture in this case but I need to do similar with 3D). If I comment out the sampler texture attribute, the image is written successfully. With it

[osg-users] Saving a Texture3D to an Image

2011-11-11 Thread Trystan Larey-Williams
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