[osg-users] memory leak with streaming texture
Hi, please forgive my english... I'm developping an interractive application where people's movement affect the content of a 3D scene. Somewhere in the appication, when people move, planty of small insects appears and follow their hands. I modelized these insects by a small square plane on wich I apply a sequence of PNG image to give them life. I use texture rectangle to display the images. I made my own class that manage the sequence of PNG images. So when I make a call to MyOwnStreamingClass.getNextFrameToDisplay(), it returns me the next image to display. To change the image of the textureRectangle of each insect, I do the following : -- AInsectTextureRectangle.setImage( MyOwnStreamingClass.getNextFrameToDisplay() ); But this way, I got a memory leak. I tought that a call to texture.setImage would delete the last image and replace it by the new one., but it don't seems to. So I try another way to change the image : -- osg::Image* nextImage = MyOwnStreamingClass.getNextFrameToDisplay(); -- osg::Image* textureImage = AInsectTextureRectangle.getImage(); -- textureImage.setImage( ..., ..., nextImage .data(), ... ); But it doesn't work either, in fact I got a runtime error this way. So I would like too know how I should proceed ? The PNG images are of size 40x40 and a sequence is made of 100 images. I can have like 50 insects at the same time in the scene. Thanks in advance Alexandre ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak with streaming texture
Hi, can you give me the procedure to install quicktime plugins for window XP. I try to generate the project with CMake and the quicktime sdk for windows, but the project did not generate. I used the QTMLClient.lib in the section QUICKTIME_LIBRARY. thanks Alex 2008/5/9 Robert Osfield <[EMAIL PROTECTED]>: > Hi Alexandre, > > Doing a texture->setImage(image) will do unref the old image before > assigning and ref'ing the new one, so memory management should work > just fine. The memory leak you are percieving is almost certainly not > down to the core OSG code like Texutre::setImage. I'd recommend that > you double check you own code, and also how you are monitoring the > memory leak, as sometime the memory tracking tools produce false > positives. > > As a general comment, I'd also recommend use osg::ImageStream (as > subclass from osg::Image) as a base for streamed images, the xine and > quicktime plugins both have movie reading code that provide their own > subclass from osg:::ImageStream so have a look at these for > inspiration. > > Robert. > > On Fri, May 9, 2008 at 6:34 PM, alexandre amyot murray > <[EMAIL PROTECTED]> wrote: > > Hi, > > > > please forgive my english... > > > > I'm developping an interractive application where people's movement > affect > > the content of a 3D scene. Somewhere in the appication, when people move, > > planty of small insects appears and follow their hands. I modelized these > > insects by a small square plane on wich I apply a sequence of PNG image > to > > give them life. I use texture rectangle to display the images. I made my > own > > class that manage the sequence of PNG images. So when I make a call to > > MyOwnStreamingClass.getNextFrameToDisplay(), it returns me the next image > to > > display. > > > > To change the image of the textureRectangle of each insect, I do the > > following : > > > > -- AInsectTextureRectangle.setImage( > > MyOwnStreamingClass.getNextFrameToDisplay() ); > > > > But this way, I got a memory leak. I tought that a call to > texture.setImage > > would delete the last image and replace it by the new one., but it don't > > seems to. > > So I try another way to change the image : > > > > -- osg::Image* nextImage = MyOwnStreamingClass.getNextFrameToDisplay(); > > > > -- osg::Image* textureImage = AInsectTextureRectangle.getImage(); > > -- textureImage.setImage( ..., ..., nextImage .data(), ... ); > > > > But it doesn't work either, in fact I got a runtime error this way. > > > > So I would like too know how I should proceed ? > > > > The PNG images are of size 40x40 and a sequence is made of 100 images. I > can > > have like 50 insects at the same time in the scene. > > > > Thanks in advance > > > > Alexandre > > > > ___ > > 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
[osg-users] problem modifying alpha channel of a geometry
Hi, I have a plane built with 60X60 vertex and I constantly update the alpha channel of these vertex to create a specific effect for my application. When I launch the application, everything runs fine for a while, but comes a time where everything starts to lag. Do you know why such a thing happens ? I use this code to update alpha channel : // Slowly affect the alpha osg::Vec4Array* colorArray = ((osg::Vec4Array*)myGeometry_->getColorArray()); for( unsigned int i=0; isize(); i++ ) { if( (colorArray->at( i )).a() < 1.0 ) { double alpha = (colorArray->at( i )).a() + alphaIncrement_; if( alpha > 1.0 ) alpha = 1.0; if( alpha >= 0.0 ) (colorArray->at( i ))[3] = alpha; } } myGeometry_->dirtyDisplayList(); thanks Alexandre ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] video streaming + osgPPU
Hi, I want to use osgPPU::UnitTexture to shoot a video as a texture input for another unit. So I tried this code : Image * myVideo = osgDB::readImageFile( "myVideoFile.mov" ); osg::ImageStream * videoStream_ = NULL; videoStream_ = dynamic_cast( myVideo ); videoStream_->setLoopingMode( osg::ImageStream::LOOPING ); if( videoStream_ ) videoStream_->play(); osg::Texture2D* texture = new osg::Texture2D(); texture->setImage(myVideo); osgPPU::UnitTexture * videoUnitTexture = new osgPPU::UnitTexture( texture ); and then plug it in the unit pipeline But this doesnt work, the texture input in my other module is always black. Is my code wrong ? If no, what is the way to do that with osgPPU Is this the good place to post for osgPPU ? Thank you Alexandre ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] video streaming + osgPPU
Hi Art, yes, the rest of my setup is exactly like you said : osgPPU::Processor->addChild(videoUnitTexture); videoUnitTexture->addChild(anotherUnit); It works great if I load a simple image (.png) rather than a video file (.mov). Also I checked if the video streaming works well when apply to a model in a scene and it does render correctly. I tried another way with my own video streaming class that look like this : ... osg::Texture2D* texture = new osg::Texture2D(); texture->setDataVariance( osg::object::DYNAMIC ); osgPPU::UnitTexture * videoUnitTexture = new osgPPU::UnitTexture( texture ); ... while( !viewer.done() ) { // Update the texture image in the main render loop osg::Image* image = myOwnStreamingClass->getNextFrameToDisplay(); texture->setImage( image ); viewer.frame(); } This way it works fine for a while, but after a certain time (random), the application crash with an unhandle exception. So I'm a little confuse with all this stuff, hope you can help me. Thank you Alexandre Hi Alexandre, > Hi, > > I want to use osgPPU::UnitTexture to shoot a video as a texture input for > another unit. > Ok, good idea, I have used it for my project successfully. > So I tried this code : > > Image * myVideo = osgDB::readImageFile( "myVideoFile.mov" ); > > osg::ImageStream * videoStream_ = NULL; > videoStream_ = dynamic_cast( myVideo ); > videoStream_->setLoopingMode( osg::ImageStream::LOOPING ); > > if( videoStream_ ) >videoStream_->play(); > > osg::Texture2D* texture = new osg::Texture2D(); > texture->setImage(myVideo); > > osgPPU::UnitTexture * videoUnitTexture = new osgPPU::UnitTexture( texture > ); > > and then plug it in the unit pipeline > How is the rest of your setup. It should be something like this: osgPPU::Processor->addChild(videoUnitTexture); videoUnitTexture->addChild(anotherUnit); > > > But this doesnt work, the texture input in my other module is always black. > I'll try tomorrow a simple example and let you know if you need some extra setup. There were a lot of changes since the last use of video processing through osgPPU. > Is my code wrong ? If no, what is the way to do that with osgPPU > Could you check if the video streaming do work at all? I mean it could be that the file is just not streamed properly. Try to set the texture to some model in the scene and see if the texture changes during the rendering. > Is this the good place to post for osgPPU ? > I think yes, if nobody complains ;). There is no extra mailinglist for osgPPU. Best regards, Art > Thank you > > Alexandre ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] video streaming + osgPPU
Hi again, I added this line to my code and now I don't get the weird crash. viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); Don't know why, but it work :) Thank you for your help Alex Hi Alexandre, > Hi Art, > > yes, the rest of my setup is exactly like you said : > > osgPPU::Processor->addChild(videoUnitTexture); > videoUnitTexture->addChild(anotherUnit); > It works great if I load a simple image (.png) rather than > a video file (.mov). > Hmm, and the processor is also added to the scene graph? I have uploaded a simple video example, which shows how to use osgPPU to perform some video processing. In the example the video is just modified during the rendering to show in greyscale mode. Other filters are of course possible. Take a look. > Also I checked if the video streaming works well when apply > to a model > in a scene and it does render correctly. > > > I tried another way with my own video streaming class that > look like this : > > ... > > osg::Texture2D* texture = new osg::Texture2D(); > texture->setDataVariance( osg::object::DYNAMIC ); > > osgPPU::UnitTexture * videoUnitTexture = new > osgPPU::UnitTexture( texture ); > > ... > > while( !viewer.done() ) > { > // Update the texture image in the main render loop > osg::Image* image = > myOwnStreamingClass->getNextFrameToDisplay(); > texture->setImage( image ); > > viewer.frame(); > } > > This way it works fine for a while, but after a certain > time (random), > the application crash with an unhandle exception. > I do not know, why the application crashes. Maybe some memory leaks in the image streaming class. Have you also tried your streamer without osgPPU. I would say get the newest version of osgPPU from the svn. Maybe the small changes I have made would help you to solve the problem. Sometimes there are also crashes or strange behaviour if using osg and osgPPU together. It happens if osgPPU tries to access textures which haven't applied through osg before. Such a texture has no valid properties, i.e. texture size, which makes the osgPPU do not handle in a proper way. I have tried to make the osgPPU's code more or less stable against such wrong usage, however this might still happen if osgPPU is used wrong. This problem is very hard solvable, because of this strict behaviour of osg to load and to initialize all the data after they had been applied. I hate this, it doesn't make my life easier at all ;( Hence try to use osgPPU as it has been shown in all the examples and you won't get any troubles. Best regards, Art P.S. If nothing helps, then provide me with the info output (OSG_NOTIFY_LEVEL=info), so that one can see the osgPPU's output information. > So I'm a little confuse with all this stuff, hope you > can help me. > > Thank you > > Alexandre > > > > Hi Alexandre, > > > Hi, > > > > I want to use osgPPU::UnitTexture to shoot a video as > a texture input for > > another unit. > > > Ok, good idea, I have used it for my project successfully. > > > So I tried this code : > > > > Image * myVideo = osgDB::readImageFile( > "myVideoFile.mov" ); > > > > osg::ImageStream * videoStream_ = NULL; > > videoStream_ = dynamic_cast( > myVideo ); > > videoStream_->setLoopingMode( > osg::ImageStream::LOOPING ); > > > > if( videoStream_ ) > >videoStream_->play(); > > > > osg::Texture2D* texture = new osg::Texture2D(); > > texture->setImage(myVideo); > > > > osgPPU::UnitTexture * videoUnitTexture = new > osgPPU::UnitTexture( texture > > ); > > > > and then plug it in the unit pipeline > > > How is the rest of your setup. It should be something like > this: > > osgPPU::Processor->addChild(videoUnitTexture); > videoUnitTexture->addChild(anotherUnit); > > > > > > > But this doesnt work, the texture input in my other > module is always black. > > > I'll try tomorrow a simple example and let you know if > you need some extra > setup. There were a lot of changes since the last use of > video processing > through osgPPU. > > > Is my code wrong ? If no, what is the way to do that > with osgPPU > > > Could you check if the video streaming do work at all? I > mean it could be that > the file is just not streamed properly. Try to set the > texture to some model in > the scene and see if the texture changes during the > rendering. > > > Is this the good place to post for osgPPU ? > > > I think yes, if nobody complains ;). There is no extra > mailinglist for > osgPPU. > > > Best regards, > Art > > > Thank you > > > > Alexandre ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgParticle and osgPPU not compatible
Hi, I'm trying to use osgParticle in combinaison with osgPPU but it doesn't work, my application crash at the beggining. If I dont use osgPPU, everything work fine. The error message I got in my console is : *"osgParticle::ParticleSystemUpdater::traverse(NodeVisitor&) requires a valid FrameStamp to function, particles not updated." *Do you know why? Thanks Alexandre* * ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgParticle and osgPPU not compatible
Hi Art and Robert, First of all I dont use my own viewer class, I use osgViewer. I initialize the viewer camera like this to support osgPPU : // Set single thread model viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // Set the main window position and size osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x= windowProperties_.winXPos_; traits->y= windowProperties_.winYPos_; traits->width= windowProperties_.winWidth_; traits->height = windowProperties_.winHeight_; traits->windowDecoration = false; traits->doubleBuffer = true; traits->sharedContext= 0; // Set the graphics context for the camera osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); gc->setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) ); gc->setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); gc->clear( ); viewer_.getCamera()->setGraphicsContext(gc.get()); // Set the viewport viewer_.getCamera()->setViewport( viewportProperties_.viewportXPos_, viewportProperties_.viewportYPos_, viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_ ); // Set the projection matrix as perspective double aspectRatio; if( viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_ >= 1.0 ) aspectRatio = viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_; else aspectRatio = viewportProperties_.viewportHeight_/viewportProperties_.viewportWidth_; viewer_.getCamera()->setProjectionMatrixAsPerspective( cameraProperties_.cameraFovy_, aspectRatio, cameraProperties_.cameraZNear_, cameraProperties_.cameraZFar_ ); // Positioning the camera osg::Matrix camTrans; camTrans.makeTranslate( cameraProperties_.cameraPos_.x(), cameraProperties_.cameraPos_.y(), -cameraProperties_.cameraPos_.z() ); viewer_.getCamera()->setViewMatrix( camTrans ); // tell the camera to use OpenGL frame buffer object where supported. viewer_.getCamera()->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. viewer_.getCamera()->attach(osg::Camera::COLOR_BUFFER, texture); viewer_.getCamera()->attach(osg::Camera::DEPTH_BUFFER, depthTexture); Ok then I build my particle scene using osgParticle. I use a ModularEmitter for the placer, shooter and counter. Finally I set the osgPPU::Processor and attach all the unit I need for the shader rendering. Then I set the viewer scene data and start the main loop which look like this : osg::Group * rootGroupNode = new osg::Group(); rootGroupNode->addChild( myParticleScene ); rootGroupNode->addChild( myOsgPpuProcessor ); viewer_.setSceneData( rootGroupNode_.get() ); while (!viewer_.done()) { if( checkForNewMedias() ) updateSceneWithMedia(); updateScene(); // Draw the next frame. rendering_ = true; viewer_.frame(); rendering_ = false; Sleep(1); } And the application crash with the error message I provide you. If I comment these lines in my viewer application : // Set single thread model //viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded); // tell the camera to use OpenGL frame buffer object where supported. //viewer_.getCamera()->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // create texture to render to //osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false ); //osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true); // attach the texture and use it as the color and depth buffer. //viewer_.getCamera()->attach(osg::Camera::COLOR_BUFFER, texture); //viewer_.getCamera()->attach(osg::Camera::DEPTH_BUFFER, depthTexture); And don't attach the osgPPU::Processor to my rootGroupNode, everything works well. Hope I gave you enough informations, if you need more I'll provide you. Thanks Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgPPU and multiple processor
Hi, I was wondering if it's a good practice to build 2 or more ppu graph and then altern them to render differents effects. Example : I instanciate a osgPPU::Processor * processor1 and add some unit to it : processor1->addChild( osgPPU::Unit* aUnit ) processor1->addChild( osgPPU::Unit* aUnit ) processor1->addChild( osgPPU::Unit* aUnit ) ... processor1->addChild( osgPPU::UnitOut* ppuOut ) and then a second osgPPU::Processor * processor2 and add different unit to it : processor2->addChild( osgPPU::Unit* aUnit ) processor2->addChild( osgPPU::Unit* aUnit ) processor2->addChild( osgPPU::Unit* aUnit ) ... processor2->addChild( osgPPU::UnitOut* ppuOut ) Now my application need to cange the effect every 45 seconds, so when its time I remove the current processor from my main osg::Node and add the second processor to it. Is this ok to do this ? It seems to work fine for a while but then a random crash appears in the viewer_.frame() call just after I switch processor. This crash never come if I dont alternate processor1 and 2. thanks again Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgPPU and multiple processor
Hi Art, It works fine to switch between multiple processor, with or without osg::Switch. It was my error too many threads in my application :D Thanks Alex > Hi Alexandre, > > I have never tried to alternate osgppu's processors dynamicly while rendering. I am not sure if it is a good idea at all (even also for other kind of osg nodes), since osg provides a mechanism called osg::SwitchNode which do the trick. > > Could you try to use the SwitchNode as a parent node for the processors. This will force to render only the active processor hence changing effects on the fly. I think this wouldn't make troubles, however I am not sure ;) > > If this doesn't help, could you then provide me with a small example code reproducing the error. This would be helpful to eliminate the issue. > > Cheers, > art ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgPPU v0.3 cycles problem
Hi (Art :) ) I just upgrade osgPPU to version 0.3. After I changed every osgPPU::Shader to osgPPU::ShaderAttribute, my application still crashes in an unexpected way. But after a couple of hours of investigation (I almost went back to version 0.2), I finally found what was the bug. I have a lot of UnitInOut in my application that add themself to create a specific effect. Exemple : osgPPU::UnitInOut * aUnit = new osgPPU::UnitInOut(); osgPPU::ShaderAttribute* aShaderAttribute = new osgPPU::ShaderAttribute(); aShaderAttribute->addShader(someShader); aShaderAttribute->add("tex0", osg::Uniform::SAMPLER_2D); aShaderAttribute->set("tex0", 0); aShaderAttribute->add("tex1", osg::Uniform::SAMPLER_2D); aShaderAttribute->set("tex1", 1); aUnit->getOrCreateStateSet()->setAttributeAndModes(aShaderAttribute); previousUnit->addChild( aUnit ); aUnit->addChild( aUnit );// this line seems to not be valid anymore It seems like this is not a good practice anymore and I didn't find a way to replicate it. Hope you can help me Thanks Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgPPU v0.3 cycles problem (Art Tevs)
It does work fine. Thanks > Hi Alexandre, > > > The problem is that from somewhere in the osg there is a node visitor running over the osgPPU pipeline which hasn't specified type. I would expect here to run the update visitor first, but there is some other visitor running, and I do not know which >one ;(, because the visitor has no specified type information (getVisitorType() returns just NODE_VISITOR). > > I have updated the trunk version of osgPPU. It seems the problems with the cycles are gone now. Test it out. If you would like to stay on version 0.3 of osgPPU, then you have to rewrite the ::traverse method of Processor.cpp from the trunk in your >copy of osgPPU. > > Cheers, > art ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Frame rate drop with osgPPU v0.3
Hi Art, Do you think its possible that the version 0.3 of osgPPU affect the frame rate considerably ? Since I merge to v0.3 (I was using v0.2 before), my application runs slowly and I get a lot of glitches that never happened before. The code is exactly the same. For now Im stuck to v0.2, but in this version if you attempt to do something like this osg::Texture * aTexure = aUnitInOut->getOrCreateOutputTexture(0) it doesnt work, but in v0.3 its fine. Is there a simple way to correct this bug from v0.2. Thank you Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgParticle and osgPPU not compatible
Hi Art, I know you are probably very occupied, but is it possible for you to provide a small example of using osgParticle with osgPPU. I still have the same bug as I had 2 months ago and Im not able to fix it. Just to remember it, my app crash just after I get this warning : osg::notify(osg::WARN) << "osgParticle::ParticleSystemUpdater::traverse(NodeVisitor&) requires a valid FrameStamp to function, particles not updated.\n"; Maybe it is how I connect osgParticle to the rest of my graph... Thank you Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgParticle and osgPPU not compatible
Hi Art, Forget about the example, I made one myself and it work, jut don't know what I'm doing different in my app. But now it's my problem :) Thanks Alex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] FBO setup failed
Hi, I'm using an osg::Camera to do a render to texture. My setup looks like this : osg::Camera * rttCamera = new osg::Camera(); rttCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); rttCamera->setRenderOrder(osg::Camera::PRE_RENDER); rttCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); osg::Texture2D * rttTex = new osg::Texture2D; rttTex->setResizeNonPowerOfTwoHint( false ); rttTex->setTextureSize( w,h ); rttTex->setInternalFormat(GL_RGBA16F_ARB); rttTex->setSourceFormat(GL_LUMINANCE); rttTex->setSourceType(GL_UNSIGNED_BYTE); rttTex->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); rttTex->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); osg::Image * rttResultIm = new osg::Image; osg::PixelBufferObject* pbo= new osg::PixelBufferObject(rttResultIm); rttResultIm->setPixelBufferObject(pbo); rttResultIm->allocateImage(w, h, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE); rttCamera->attach( osg::Camera::COLOR_BUFFER, rttResultIm ); rttTex->setImage( rttResultIm ); But when I do this this way, I get the following warning/error : RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6 Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,) RenderStage::drawInner(,) FBO status= 0x8cd5 Still everything seems to work fine and my frame rate is about 320 fps. But if I change the last 2 lines from : rttCamera->attach( osg::Camera::COLOR_BUFFER, rttResultIm ); rttTex->setImage( rttResultIm ); to rttCamera->attach( osg::Camera::COLOR_BUFFER, rttTex ); rttCamera->attach( osg::Camera::COLOR_BUFFER, rttResultIm ); Then I get no error/warning but my frame rate drops to 250 fps. So can somebody explain to me what's happening ? I just don't get what is the difference between the 2 methods and why the first one gives me an error like this, but still work. By the way I'm working on Windows XP and an NVidia GTX 260. Thank you in advance Alexandre ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org