Concerning this problem, I'm wondering if I could use the following
solution:

 1. Create a "master" 3D image, and allocate it;
 2. Since attaching 2D images to a camera would not require any face
argument, I could create "sub" images, one per z slice of the master camera,
and use setImage with an offset data pointer in the master image data...
 3. Then assign those sub images to each camera I'm using to render the
complete 3D image.

Would this work as expected ?? Or would attaching an image to a camera
actually somehow reallocate the image data ??? (and thus we would not be
able to write the slice data into the master image data).

I hope, those explanations are clear enough :-)

Manu.


2010/8/4 Emmanuel Roche <roche.emman...@gmail.com>

> Hi everyone,
>
> I'm currently trying to generate some 3D images in an OSG based app.
>
> I've read the previous discussions on the OSG forums concerning the 3D
> texture rendering, but this doesn't help in my situation. What I really need
> is *3D image* rendering not *3D texture* rendering.
>
> More explanations:
>
>  * One can attach an osg::Image or an osg::Texture to the color buffer of a
> given camera. But one can only specify the "face" argument for textures:
>
> *void attach <http://a00098.html#a496ed6d69392c1fdb8548085900a1a87> (
> BufferComponent <http://a00098.html#af4d8ae808500a2f5bc9fe7b605386e74>buffer,
> osg::Texture <http://a00946.html> *texture, unsigned int level=0, unsigned
> int face=0, bool mipMapGeneration=false, unsigned int multisampleSamples=0,
> unsigned int multisampleColorSamples=0)
>
> void attach <http://a00098.html#a4124951a5032de595c5d28d0cc5e87a3> (
> BufferComponent <http://a00098.html#af4d8ae808500a2f5bc9fe7b605386e74>buffer,
> osg::Image <http://a00389.html> *image, unsigned int multisampleSamples=0,
> unsigned int multisampleColorSamples=0)
>
> ** So,
>   - if I attach a 3D image directly to the camera, the depth of the image
> is not taken into account, and all the image "slices" will contain the same
> result.
>   - if I attach a Texture3D object, whether I assign it an underlying image
> doesn't matter: the content of the "texture" cannot be retrieved with the
> assigned image...
>
> Is there something I'm missing here ? Did someone already successfully
> render to a 3D texture *AND* wrote that texture to a file for instance ??
>
> Or is there a way to retrieve the content of a 3D texture into a 3D image
> (I guess retrieving the texture data from the graphic card somehow ?) [I'm
> not very good at pure OpenGL considerations, thus the question :-) ].
>
> Cheers! Thanks for your help guys!
>
> Manu.
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to