assert( upToDate && "You must call ForwardPlusBase::collectLights first!" )
when switching between some multiple viewports setups and multiple compositor nodes on some of them.
After some debugging I think this might be the cause:
It seems that ForwardPlusBase::getCachedGridFor sometimes returns the wrong cached grid (in my case one that is one frame behind, and therefore upToDate == false because for the wrong cache the statement (itor->lastFrame == mVaoManager->getFrameCount()) is false ).
There can be two reasons why it returns the wrong one:
- The cached aspectRatio is less than the cameras aspect ratio, because there is a missing Abs in this check:
Code: Select all
(itor->aspectRatio - camera->getAspectRatio()) < 1e-6f
- If there are two viewports with very similar aspectRatio but not completely equal.
Suggested fix:
Either add an abs() around the left part of the less than, or just skipping the threshold completely and do a pure equals comparison instead? Maybe the less-than-epsilon isn't needed in this case?