Beispiel #1
0
	void COgreManager::updateSceneManagersAfterMaterialsChange()
	{
		if(Root::getSingletonPtr() && (Ogre::Pass::getDirtyHashList().size()!=0 || Ogre::Pass::getPassGraveyard().size()!=0))
		{
			Ogre::SceneManagerEnumerator::SceneManagerIterator scenesIter = Root::getSingletonPtr()->getSceneManagerIterator();

			while(scenesIter.hasMoreElements())
			{
				Ogre::SceneManager* pScene = scenesIter.getNext();
				if(pScene)
				{
					Ogre::RenderQueue* pQueue = pScene->getRenderQueue();
					if(pQueue)
					{
						Ogre::RenderQueue::QueueGroupIterator groupIter = pQueue->_getQueueGroupIterator();
						while(groupIter.hasMoreElements())
						{
							Ogre::RenderQueueGroup* pGroup = groupIter.getNext();
							if(pGroup)
								pGroup->clear(false);
						}//end_while(groupIter.hasMoreElements())
					}//end_if(pScene)
				}//end_if(pScene)
			}//end_while(scenesIter.hasMoreElements())      

			// Now trigger the pending pass updates
			Ogre::Pass::processPendingPassUpdates();

		}//end_if(m_Root..
	}
Beispiel #2
0
void TerrainMaterialCompilationTask::updateSceneManagersAfterMaterialsChange()
{
    //We need to do this to prevent stale hashes in Ogre, which will lead to crashes during rendering.
    if (Ogre::Pass::getDirtyHashList().size() != 0 || Ogre::Pass::getPassGraveyard().size() != 0) {
        Ogre::SceneManagerEnumerator::SceneManagerIterator scenesIter = Ogre::Root::getSingleton().getSceneManagerIterator();

        while (scenesIter.hasMoreElements()) {
            Ogre::SceneManager* pScene = scenesIter.getNext();
            if (pScene) {
                Ogre::RenderQueue* pQueue = pScene->getRenderQueue();
                if (pQueue) {
                    Ogre::RenderQueue::QueueGroupIterator groupIter = pQueue->_getQueueGroupIterator();
                    while (groupIter.hasMoreElements()) {
                        Ogre::RenderQueueGroup* pGroup = groupIter.getNext();
                        if (pGroup)
                            pGroup->clear(false);
                    }//end_while(groupIter.hasMoreElements())
                }//end_if(pScene)
            }//end_if(pScene)
        }//end_while(scenesIter.hasMoreElements())

        // Now trigger the pending pass updates
        Ogre::Pass::processPendingPassUpdates();

    }//end_if(m_Root..
}
Beispiel #3
0
void
System::_createSceneManager(void)
{
    mSceneManager = mRoot->createSceneManager(Ogre::ST_GENERIC, "FairyMainScene");

    const char* s = getenv("Fairy_Hack");
    if (s)
    {
        if (strstr(s, "X-Ray") != 0)
        {
            static FairyRenderQueueListener sFairyRenderQueueListener;
            mSceneManager->addRenderQueueListener(&sFairyRenderQueueListener);
        }
    }

    Ogre::RenderQueue* rq = mSceneManager->getRenderQueue();

    //david-<<
    // Disable shadows for all future groups
    //rq->setEnableShadowsForUnregisteredGroup(false);
    //david->>

    // Disable shadow for all registered render queue group
    Ogre::RenderQueue::QueueGroupIterator it = rq->_getQueueGroupIterator();
    while (it.hasMoreElements())
    {
        Ogre::uint8 qid = it.peekNextKey();
        Ogre::RenderQueueGroup* group = it.getNext();
        group->setShadowsEnabled(false);
    }

    // Only enable shadows for world geometry at the moment
    rq->getQueueGroup(mSceneManager->getWorldGeometryRenderQueue())->setShadowsEnabled(true);
}
void updateSceneManagersAfterMaterialsChange()
{
    Ogre::SceneManagerEnumerator::SceneManagerIterator scenesIter = Ogre::Root::getSingletonPtr()->getSceneManagerIterator();

    while(scenesIter.hasMoreElements())
    {
        Ogre::SceneManager* pScene = scenesIter.getNext();
        if(pScene)
        {
            Ogre::RenderQueue* pQueue = pScene->getRenderQueue();
            if(pQueue)
            {
                Ogre::RenderQueue::QueueGroupIterator groupIter = pQueue->_getQueueGroupIterator();
                while(groupIter.hasMoreElements())
                {
                    Ogre::RenderQueueGroup* pGroup = groupIter.getNext();
                    if(pGroup)
                    {
                        pGroup->clear(true);
                    }
                }
            }
        }
    }

    // Now trigger the pending pass updates
    Ogre::Pass::processPendingPassUpdates();


}
Beispiel #5
0
bool CCoreSystem::createScene(void)
{
	m_pSceneMgr = m_pOgreRoot->createSceneManager(Ogre::ST_GENERIC, "MainSceneMgr");
	assert(m_pSceneMgr);

	Ogre::RenderQueue* rq = m_pSceneMgr->getRenderQueue();
	// Disable shadows for all future groups
	//rq->setEnableShadowsForUnregisteredGroup(false);

	// Disable shadow for all registered render queue group
	Ogre::RenderQueue::QueueGroupIterator it = rq->_getQueueGroupIterator();
	while (it.hasMoreElements())
	{
		Ogre::uint8 qid = it.peekNextKey();
		Ogre::RenderQueueGroup* group = it.getNext();
		group->setShadowsEnabled(false);
	}
	return true;
}