Hi Art, Art Tevs wrote: > Hi J.P. > > I am also using MRT, however completely without > osg::Camera. Yes, I've compiled osgPPU and ran the examples; cannot say that I fully understand the code yet :)
> > However since I am working with FBOs directly I would > prefer to have something like an extra StateAttribute > or something which should setup the MRT. Or maybe the > setDrawBuffers as an extra method in the FBO code. > > I think having the MRT (enable/disable) as a > StateAttribute would be the more general way. However > this would probably require some extra changing in the > RenderStage or wherever to detect that extra > StateAttribute. > > What do you think, guys? I think having the MRT selection going through FBO-class could be a good option. However, I do not know how to add the StateAttribute. We might need an enable/disable and setDrawbuffers, or can a StateAttribute take a vector? I do not know how to pass the vector of render targets using an attribute? ----- At the moment I have: Camera->setDrawBuffers(vec) - this sets the intention to use MRT and also passes the list of targets. RenderStage->runCameraSetup - this queries the camera for the buffers, and if there are any, creates a vector of GLenums. RenderStage->drawInner - The existence of the target vector is used to determine if MRT is enabled. glDrawBuffers is called using the vector. ----- I think what you propose is: Camera->setDrawBuffers(vec) RenderStage->runCameraSetup - since this creates the FBO anyway, it might as well pass the camera settings regarding MRT to the FBO. Maybe using _fbo->setDrawBuffers. RenderStage->drawInner - instead of checking the member _drawBuffers, query the FBO to determine if MRT should be enabled and also get the list of targets from the FBO. ----- This could work, and I can probably integrate it into the patch, but I'm not sure how you get your FBOs into renderstage at present. Also, how do you control the reading back of textures/images? At the moment the readback attachment map is also setup in camera. Would this also need to be moved? > > > Cheers, > Art rgds jp -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org