hi friends:
adding empty group to the  scene view tree will make the light and normal lose 
it's effect? i do this in order to add geometries to the group later on.
 



Shawl

From: Robert Osfield
Date: 2012-10-22 23:48
To: OpenSceneGraph Users
Subject: Re: [osg-users] slave camera render to texture.
Hi Peterakos,

You seem to be having more problems than you should for what is
usually a straight forward task.  Rather than try to understand what
you've done wrong in your program I think it would be best for you to
have a look at the osg examples that are relevant - for example have a
look at osgprerender, osgprerenercubemap and osgdistortion.

Robert.

On 14 October 2012 21:50, Peterakos <hay...@gmail.com> wrote:
> Hello.
>
> My task is to have 2 cameras being exactly the same.
> The first one will render to my window and the second one to texture.
>
> First i tried to create a camera as child to scene data and add the same
> model as child.
> So i used the following code:
>
> Viewer viewer;
> Camera* camera = new Camera(*viewer.getCamera(), CopyOp::DEEP_COPY_ALL);
> ref_ptr<Image> image = new Image();
> image->allocateImage(width, height, 1, GL_RGBA, GL_UNSIGNED_BYTE);
> camera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT );
> camera->attach(Camera::BufferComponent(Camera::COLOR_BUFFER0), image.get());
> camera->setPostDrawCallback(new MyCameraPostDrawCallback(image.get()));
>
> The post callback will writes image to file.
> I couldnt make it work and i have no idea why. All i see in the texture is
> an empty scene.
> What more should i do ?
>
> After that i decided to use slave camera. I noticed that i had to use 2
> different graphics context.
> But the problem is that i dont want the second window to appear.
> What configuration should i pass to the second context to not appear any
> window ?
> I assume is something based on WindowingSystemInterface but i couldnt find
> what exactly.
>
> Thank you for your time.
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to