Thanks for taking an eye into the issue.
You have the following two that raise a red flag:
21:15:16: Pass: NOWA_Pbs_Render_Scene_Pass_Scene_0 has viewport count: 1 size: 0 0 0.5 1
21:15:16: Pass: NOWA_Final_rtN_Pass_Quad_1 has viewport count: 1 size: 0.5 0 0.5 1
Assuming that these two passes render to the texture: If NOWA_Final_rtN_Pass_Quad_1 uses either clear or dont_care (either at load or store), it's going to overwrite what NOWA_Pbs_Render_Scene_Pass_Scene_0 already wrote, because load/store actions unfortunately ignore viewport bounds.
The same goes for the following two:
21:15:16: Pass: NOWA_Pbs_Render_Scene_Pass_Scene_0 has viewport count: 1 size: 0 0 0.5 1
21:15:16: Pass: NOWA_Pbs_Render_Scene_Pass_Scene_1 has viewport count: 1 size: 0.5 0 0.5 1
For me that seems correct, as:
- NOWA_Pbs_Render_Scene_Pass_Scene_0 -> 0 -> first viewport
- NOWA_Final_rtN_Pass_Quad_1 -> 1 -> second viewport
Same here:
- NOWA_Pbs_Render_Scene_Pass_Scene_0 -> 0 -> first viewport
- NOWA_Pbs_Render_Scene_Pass_Scene_1 -> 1 -> second viewport
If I see this log:
Code: Select all
21:15:16: Pass: Shadow Node SCENE 7 has viewport count: 1 size: 0 0 1 0.285714
21:15:16: Pass: Shadow Node SCENE 8 has viewport count: 1 size: 0 0.285714 0.5 0.142857
21:15:16: Pass: Shadow Node SCENE 9 has viewport count: 1 size: 0.5 0.285714 0.5 0.142857
21:15:16: Pass: NOWA_Pbs_Render_Scene_Pass_Scene_0 has viewport count: 1 size: 0 0 0.5 1
21:15:16: Pass: NOWA_Final_rtN_Pass_Quad_0 has viewport count: 1 size: 0 0 0.5 1
21:15:16: Pass: Shadow Node SCENE 7 has viewport count: 1 size: 0 0 1 0.285714
21:15:16: Pass: Shadow Node SCENE 8 has viewport count: 1 size: 0 0.285714 0.5 0.142857
21:15:16: Pass: Shadow Node SCENE 9 has viewport count: 1 size: 0.5 0.285714 0.5 0.142857
21:15:16: Pass: NOWA_Pbs_Render_Scene_Pass_Scene_1 has viewport count: 1 size: 0.5 0 0.5 1
21:15:16: Pass: NOWA_Final_rtN_Pass_Quad_1 has viewport count: 1 size: 0.5 0 0.5 1
21:15:16: Pass: NOWA_Final_Render_Overlay_Pass_Scene_1 has viewport count: 1 size: 0 0 1 1
First every pass group is rendered for the first viewport "0 0 0.5 1"
Then every pass group is rendered for the second viewport "0.5 0 0.5 1"
Or I'm I totally wrong here?
And why is always the viewport count 1?
This is the log message I added to CompositorPass::setRenderPassDescToCurrent for debug purposes:
Code: Select all
LogManager::getSingleton().logMessage(
LML_CRITICAL, "Pass: " + mDefinition->mProfilingId + " has viewport count: " +
Ogre::StringConverter::toString( numViewports ) +
" size: " +
Ogre::StringConverter::toString( vpSize[i] ) );
I also again checked, that all passes for splitscreen use this configuration:
Code: Select all
if (false == this->useSplitScreen)
{
passScene->setAllLoadActions(Ogre::LoadAction::Clear);
passScene->mStoreActionDepth = Ogre::StoreAction::DontCare;
passScene->mStoreActionStencil = Ogre::StoreAction::DontCare;
}
else
{
passScene->setAllLoadActions(Ogre::LoadAction::Load);
passScene->mStoreActionDepth = Ogre::StoreAction::Store;
passScene->mStoreActionStencil = Ogre::StoreAction::Store;
}
The same also for passClear and passQuat and still no success.
Could be the splitscreen feature eased for developers by setting automatically those passes to be splittscreen friendly?
That means, if splitscreen is used, do not use "clear" or "dont_care"? This could be added as parameter for splitscreen?
EDIT:
I'm sure its because of this quat pass:
Code: Select all
// Render Quad
{
auto pass = targetDef->addPass(Ogre::PASS_QUAD);
Ogre::CompositorPassQuadDef* passQuad = static_cast<Ogre::CompositorPassQuadDef*>(pass);
if (false == this->useSplitScreen)
{
passQuad->setAllLoadActions(Ogre::LoadAction::DontCare);
}
passQuad->mMaterialName = "Ogre/Copy/4xFP32";
passQuad->addQuadTextureSource(0, "rtN");
passQuad->mProfilingId = "NOWA_Final_rtN_Pass_Quad";
this->applySplitScreenModifier(pass);
}
If I here manipulate the mExecutionMask, mViewportModifierMask, i get direct effects.
Code: Select all
if (pass->getType() == Ogre::CompositorPassType::PASS_QUAD)
{
pass->mExecutionMask = 0x01;
pass->mViewportModifierMask = 0x00;
pass->setAllLoadActions(Ogre::LoadAction::Load);
pass->setAllStoreActions(Ogre::StoreAction::StoreOrResolve);
}
If I set:
pass->mExecutionMask = 0x01;
This is the rendering:
If I set:
pass->mExecutionMask = 0x02;
or
pass->mExecutionMask = 0xFF;
This is the rendering:
Its not possible to merge both, so that on the left side picture 1 is rendered and at the right side picture 2. No matter what I do.
Best Regards
Lax