[2.1] How to render two viewports with compositor?

Problems building or running the engine, queries about how to use features etc.
Post Reply
mrmclovin
Goblin
Posts: 294
Joined: Sun May 11, 2008 9:27 pm
x 8

[2.1] How to render two viewports with compositor?

Post by mrmclovin » Sat Nov 09, 2019 12:35 pm

Ogre Version: 2.1 :?:
Operating System: macOS :?:
Render System: Metal :?:

I want to have two viewports. One for rendering and one for GUI. But to demonstrate the problem I have, let's say I just want two viewports from the same camera.

With one viewport, things look normal:

Code: Select all

compositor_node main_node
{
    in 0 rt_renderwindow

    target rt_renderwindow
    {
        
        pass clear
        {
            colour_value 0.211 0.2335 0.349 1
        }

        pass render_scene
        {
            overlays    off
            rq_first    0
            rq_last     2
        }
    }
}
Image

-------------------------------------

When splitting into two viewport next to eachother, the left one is not scaled down, but seems to get stretched out and placed centerd, while the right seems to appear as expected:

Code: Select all

compositor_node main_node
{
    in 0 rt_renderwindow

    target rt_renderwindow
    {
        
        pass clear
        {
            colour_value 0.211 0.2335 0.349 1
        }

        pass render_scene
        {
            overlays    off
            rq_first    0
            rq_last     2
            viewport 0.0 0 0.5 1
        }

        pass render_scene
        {
            overlays    off
            rq_first    0
            rq_last     2
            viewport 0.5 0 0.5 1
        }
    }
}
Image

1. Is this expected or is it a bug?
2. How can I achieve what I want?
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4138
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 268
Contact:

Re: [2.1] How to render two viewports with compositor?

Post by dark_sylinc » Sun Nov 10, 2019 11:45 pm

  1. This is not expected
  2. Often the problem could be aspect ratio. Make sure Camera::setAutoAspectRatio is set to tru
  3. Are you able to test other RenderSystems? It could be a Metal-only bug. If that's the case, it may have been already resolved in 2.2
  4. Try comparing your rendering against StereoRendering sample which does a very similar thing
0 x

mrmclovin
Goblin
Posts: 294
Joined: Sun May 11, 2008 9:27 pm
x 8

Re: [2.1] How to render two viewports with compositor?

Post by mrmclovin » Mon Nov 11, 2019 7:43 pm

dark_sylinc wrote:
Sun Nov 10, 2019 11:45 pm
  1. Are you able to test other RenderSystems? It could be a Metal-only bug. If that's the case, it may have been already resolved in 2.2
Seems to work with GL3Plus:

Image

Any idea of how/where to fix it in Metal?

Testing with 2.2 is not an option right now as I need to port a lot of code.
0 x

Post Reply