Hello Peter,

that was the problem! Now I have around 1500 FPS.
I didn't know there are difference between to attach an image or a texture.

Thank you very much!

Cheers

Martin


-------- Original-Nachricht --------
> Datum: Wed, 02 Feb 2011 14:58:46 +0100
> Von: Peter Hrenka <[email protected]>
> An: OpenSceneGraph Users <[email protected]>
> Betreff: Re: [osg-users] Render To Texture is very slow

> Hi Martin,
> 
> Am 02.02.2011 14:35, schrieb "Martin Großer":
> > Hello David,
> >
> > So I use the FRAME_BUFFER_OBJECT and I have a NVIDIA GTX 470 grafics
> card.
> >
> > I tried the osgprerendercubemap, but I cannot print out the frame rate.
> Additionally I tried the osgprerender example and I get a frame rate of
> around 3500 FPS.
> >
> > Here my Implementation:
> >
> > osg::ref_ptr<osg::Image>  img = osgDB::readImageFile("image.tga");
> >
> > osg::ref_ptr<osg::Group>  rtt = new osg::Group;
> > root->addChild(rtt);
> >
> >
> > osg::ref_ptr<osg::Camera>  camera = new osg::Camera;
> >
> > camera->addChild( scene );
> >
> > camera->setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
> >
> > camera->setViewport(0,0,2048,2048);
> >
> > camera->setRenderOrder(osg::Camera::PRE_RENDER, 0);
> >
> > camera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT
> );
> > camera->attach(osg::Camera::COLOR_BUFFER, img, 0, 0);
> 
> Your performance Problem is in the previous line:
> By attaching an image you instruct OSG to fetch
> the whole image back to CPU memory (for each frame!).
> 
> If this is what you really want, it probably is as fast
> as it will get.
> 
> If you want to use the rendered image on the GPU,
> then you should attach an osg::Texture instead.
> 
> See osgprerender example, with "useImage=false".
> 
> 
> > rtt->addChild(camera.get());
> >
> > Is the image format (internal format) a problem?
> >
> > Thanks
> >
> > Martin
> 
> Cheers,
> 
> Peter
> -- 
> Vorstand/Board of Management:
> Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
> Dr. Arno Steitz, Dr. Ingrid Zech
> Vorsitzender des Aufsichtsrats/
> Chairman of the Supervisory Board:
> Michel Lepert
> Sitz/Registered Office: Tuebingen
> Registergericht/Registration Court: Stuttgart
> Registernummer/Commercial Register No.: HRB 382196 
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to