I'm getting closer to the matter.
I get bad results because of this quad pass:
Code: Select all
Ogre::CompositorPassQuadDef* passQuad;
passQuad = static_cast<Ogre::CompositorPassQuadDef*>(targetDef->addPass(Ogre::PASS_QUAD));
passQuad->setAllLoadActions(Ogre::LoadAction::DontCare);
passQuad->mMaterialName = "Ogre/Copy/4xFP32";
passQuad->addQuadTextureSource(0, "rtN");
Which comes from the post processing effects. But I need this one.
This is the result if I use the quad, but set neither viewportmodifiermask nor exectionmask:
At least on the left side, the second camera does render a scene and on the right side, everything is ok, but the scene is some how 4x splitted and the left side is not refreshed properly.
I also modified the Ogre Stereo Rendering Sample, so that the PostProcessing Sky compositor is used:
Code: Select all
compositor_node StereoSkyRenderingNode
{
in 0 rt_renderwindow
target rt_renderwindow
{
pass clear
{
//Get executed on the first eye
execution_mask 0x01
//Don't be affected by the modifier, apply to the whole screen
viewport_modifier_mask 0x00
colour_value 0.2 0.4 0.6 1
// Only write to the MSAA surface (don't resolve!)
// because overlays due to a legacy problem break the pass
// thus if we resolve now, we'll resolve twice
store
{
colour store
depth store
stencil store
}
profiling_id "Clear both eyes"
}
//Render opaque stuff
pass render_scene
{
load
{
all clear
clear_colour 0.2 0.4 0.6 1
}
overlays off
rq_first 0
rq_last 2
//Get executed in all eyes
execution_mask 0xff
//Be affected by the modifier, so we render just to a portion of the screen.
viewport_modifier_mask 0xff
profiling_id "Opaque Objects"
}
//Render sky after opaque stuff (performance optimization)
pass render_quad
{
quad_normals camera_direction
material SkyPostprocess
profiling_id "Sky"
execution_mask 0x02
//Be affected by the modifier, so we render just to a portion of the screen.
viewport_modifier_mask 0x00
}
//Render transparent stuff after sky
pass render_scene
{
overlays on
rq_first 2
//Get executed in all eyes
execution_mask 0xff
//Be affected by the modifier, so we render just to a portion of the screen.
viewport_modifier_mask 0xff
profiling_id "Transparents"
}
}
}
workspace StereoSkyRenderingWorkspace
{
connect_output StereoSkyRenderingNode 0
}
This is the result:
On the left eye no objects are rendered!
I played around with different masks in the Ogre example, but now its clear, that split screen/stereo does not work for quad passes.
Maybe because a quad pass usually uses a material, which does not know anything about stereo?
@dark_sylinc: Could you fix that? And maybe adapt the stereo example, to have a sky, a plane and shadows rendered?
Because I have no idea if also shadows would work...
Best Regards
Lax