Little bug in SceneManager::_renderScene

Description

Original author: Xavyiy

At the start of _renderScene, if isLateMaterialResolving is true, then it tries to retrieve the latest technique. But if the original pass index, pass->getIndex(), is bigger than the number of passes in the late technique then the late technique is not selected, just skipped.

Fix: add an else statement selecting the pass 0 from the late technique:

//If using late material resolving, swap now.
if (isLateMaterialResolving())
{
Technique* lateTech = pass->getParent()>getParent()>getBestTechnique();
if (lateTech->getNumPasses() > pass->getIndex())
{
pass = lateTech->getPass(pass->getIndex());
}
else
{
pass = lateTech->getPass(0);
}
//Should we warn or throw an exception if an illegal state was achieved?
}

Original Mantis Ticket: http://www.ogre3d.org/mantis/view.php?id=593

Environment

None

Assignee

Murat Sari

Reporter

Philip Allgaier

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure