Hi,

Sumit Pandey wrote:
Hi,

Thanks for the reply.
Since i havent found any way to set buffer attachment in the camera so, now, i am trying to create frame buffer object and attach it to the child camera as a stateattribute. It works fine with
color buffer attached, but as soon as i attach stencil buffer or depth buffer RTT is not working.

Code snippet:

            osg::ref_ptr<osg::FrameBufferObject> fbo = new 
osg::FrameBufferObject;
fbo->setAttachment(osg::Camera::STENCIL_BUFFER, osg::FrameBufferAttachment(new osg::RenderBuffer(1280, 1024, GL_STENCIL_INDEX8_EXT)));

fbo->setAttachment(osg::Camera::COLOR_BUFFER, osg::FrameBufferAttachment(new osg::RenderBuffer(1280, 1024, GL_RGBA))); pOSGCamera->getOrCreateStateSet()->setAttributeAndModes(fbo);
Am i doing something wrong?

I'm not sure, I have'nt used it like you are doing it here:

Have to tried attaching to the camera?

something like:
// make texture
StenTexture = ...

Camera->attach(osg::Camera::BufferComponent(osg::Camera::STENCIL_BUFFER), StenTexture.get());

jp



Thank you!

Cheers,
Sumit

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24921#24921





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
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

Reply via email to