Hi Dominic,

a happy new year to you too.

On 2/01/10 10:00 PM, Dominic Stalder wrote:
>     Image* image = new Image;
>     image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
> GL_RGBA, GL_UNSIGNED_BYTE);
> 
>     // creates a new camera that will render into the image and sets the
> rendering settings
>     ref_ptr<Camera> imgCamera = new Camera;
>...
>     imgCamera->addChild(rootLighting.get());
>    
>     root->addChild(imgCamera.get());
>    
>     osgDB::writeImageFile(*image, "/Users/xyz/tmp/test.bmp");
> 
> It allocates the image with the right size (1400 x 736) and writes it to
> disk. But the image is all black.

Did you omit some code between 'root->addChild()' and 'writeImageFile'?  There 
should be a
call to render the frame (like 'osgViewer->frame()') otherwise the Image will 
remain black.

> Does anybody see an error or what could be the problem? I also tried
> with GL_INT instead of GL_UNSIGNED_BYTE but this didn't work too. Is
> there a problem with the hirachy:

GL_U_B is fine, this will probably also give you better performance.

Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to