Hi,

I need render the scene to a texture. But when I attach the camera to a 
texture, I cannot change current RTT target texture to another correctly, even 
if the size of the new texture is same as the old one.

The code :

//new texture
osg::Texture2D * _pNewTex = new osg::Texture2D;
_pNewTex->setInternalFormat(GL_RGBA);
_pNewTex->setTextureSize( 640, 480 );

//attach new texture
m_opMod->m_opMainCamera->attach( osg::Camera::COLOR_BUFFER, _pNewTex );

m_opMod->m_rpLastRdrGeo->getOrCreateStateSet()->setTextureAttributeAndModes( 0, 
_pNewTex, osg::StateAttribute::ON );

If I do that, every pixel of the new texture will always gray. What`s wrong 
with my code ? How can I change RTT texture correctly?

Thank you!

Cheers,
Zheng[/code]

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to