void Viewport::clearFrame(unsigned int buffers = FBT_COLOUR | FBT_DEPTH);
How it would help me:
I don't want the viewport to be cleared every frame, but if I set this option to false, I see garbage data on my screen. I'm at work and can't easily trace through the code to see how the viewport actually gets cleared (its not in OgreViewport.cpp, some other class does the actual clearing of the contents). It would be nice to be able to clear the viewport on demand, or at least queue the request for the appropriate time (next frame).
If this helps, this is my setup, where I experience the issue:
Code: Select all
void SCFogOfWar::_setupVisitedTexture()
{
mVisitedTextureName = "FogOfWarVisitedRTT";
Ogre::TexturePtr texture = Ogre::TextureManager::getSingleton().createManual( mVisitedTextureName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D,
512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
mVisitedTextureRenderTarget = texture->getBuffer()->getRenderTarget();
// Add FoW camera as a source to the Texture's render target
mVisitedTextureViewport = mVisitedTextureRenderTarget->addViewport(mFoWCam);
//mVisitedTextureViewport->setClearEveryFrame(false);
}

