|
|
正常情况下, 会把场景中所有的东西剪切,但是我有一个不想被剪切的物体,请问这个怎样实现?
void ReflactionRenderQueueListener::renderQueueStarted( Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation)
{
if ( queueGroupId == Ogre::RENDER_QUEUE_WORLD_GEOMETRY_1 )
{
g_xDemoSceneMgr.GetCamera()->disableCustomNearClipPlane();
Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix( g_xDemoSceneMgr.GetCamera()->getProjectionMatrixRS() );
}
}
void ReflactionRenderQueueListener::renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation)
{
if ( queueGroupId == Ogre::RENDER_QUEUE_WORLD_GEOMETRY_1 )
{
Ogre::Vector3 pos = m_pTexture->m_pTexture->m_pWaterObject->getWorldPosition();
Ogre: lane plane( Ogre::Vector3::NEGATIVE_UNIT_Y, -pos.y );
g_xDemoSceneMgr.GetCamera()->enableCustomNearClipPlane( plane );
Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix( g_xDemoSceneMgr.GetCamera()->getProjectionMatrixRS() );
}
}
使用上面的代码可以实现,但是存在一个问题:
好像那个没被剪切的物体没有被正常的写入深度缓存.
现在有一些被那个没剪切的物体所遮挡的物体也被绘制出来的了, 请问这个怎样解决?? |
-
|