Page 1 of 2

Rendering GUI in multiple viewports - OGRE

Posted: Tue Nov 17, 2009 17:06
by ianstangoe
How do I setup the OgreRenderer to render gui elements onto multiple viewports of my choosing?

Thanks.

Re: Rendering in multiple viewports - OGRE

Posted: Tue Nov 17, 2009 22:44
by Jabberwocky
I'm pretty sure this isn't supported right now, either by CEGUI 0.6 or 0.7.

CrazyEddie talks a bit about a similar issue in this thread.

If you're a pretty solid Ogre coder, you may be able to write a new ogre-cegui renderer that supports this, but I don't think it would be trivial. I think it would require code both Ogre-side and CEGUI-side.

Re: Rendering in multiple viewports - OGRE

Posted: Tue Nov 17, 2009 22:52
by ianstangoe
Oh, thats a major step backwards for us then, it definitely did work in the 0.6.x series.

I've just spent a week getting 0.7.1 to work with our current applications but we need multiple viewport support as we work in stereo. Thats disappointing news. :(

Thanks for the info.

Re: Rendering in multiple viewports - OGRE

Posted: Wed Nov 18, 2009 03:41
by Jabberwocky
Well, maybe I'm misunderstanding your problem then. How exactly did you get CEGUI 0.6.x to work on multiple viewports? I didn't think that was possible. Or did it just work automatically when you created multiple viewports within the same SceneManager?

The new CEGUIOgreRenderer seems to be completely different than the old OgreCEGUIRenderer. The new renderer seems to create it's own viewport to render on, rather than relying on a SceneManager* pointer. Actually, as much as I've been extremely happy with CEGUI 0.7.1, the new CEGUIOgreRenderer has given me a few problems too.

Maybe it would be possible to hack up a hybrid between the old renderer and the new renderer that would solve both our problems.

Re: Rendering in multiple viewports - OGRE

Posted: Wed Nov 18, 2009 09:45
by ianstangoe
Yeah the 0.6.x version 'just worked' out of the box with multiple viewports, I was using a single scene manager too. I think it automatically rendered on any viewport with overlays enabled.

I'm sure the new version has undocumented functions for achieving this but its like stabbing-in-the-dark at the moment looking at the class list. Hopefully one of the team can point us in the right direction soon... :?

Re: Rendering in multiple viewports - OGRE

Posted: Wed Nov 18, 2009 12:03
by eugen
0.6 worked out of the box; it used the Overlay render queue and used a different rendering method, now CEGUI 0.7 hooks up into the main rendering queue of Ogre and just renders once regardless the number of viewports. The behavior i have with 0.7its just flickers continuously.

Re: Rendering in multiple viewports - OGRE

Posted: Wed Nov 18, 2009 13:41
by ianstangoe
Do you mean it flickers with mulitple viewports or just in general, I haven't noticed any flickering yet but not really taxed it with a substantial menu system yet..

Re: Rendering GUI in multiple viewports - OGRE

Posted: Thu Nov 19, 2009 13:05
by eugen
Only flickers with multiple viewport system, works ok with one viewport

Re: Rendering GUI in multiple viewports - OGRE

Posted: Thu Nov 19, 2009 17:35
by ianstangoe
Have you got gui elements cloned in multiple viewports?

Re: Rendering GUI in multiple viewports - OGRE

Posted: Fri Nov 20, 2009 15:17
by eugen
What do you mean? The gui elements i have are created in CEGUI, the current version of CEGUI doesnt know about multiple viewports when rendering, i dont understand exactly the meaning of your question.

Re: Rendering GUI in multiple viewports - OGRE

Posted: Fri Nov 20, 2009 22:40
by ianstangoe
In the previous version gui elements were cloned in each viewport, I was wondering if you had gotten this to work with the current version except that it was flickering, I guess this isn't the case.

Re: Rendering GUI in multiple viewports - OGRE

Posted: Sun Nov 22, 2009 21:42
by eugen
No doesnt seem to be the case, the only thing is the flickering. The GUI works as expected othewise, i can act on the buttons, gui events are sent, evertything seems to work ok. Now that i think of, could i have cause the flickering myself?!

Re: Rendering GUI in multiple viewports - OGRE

Posted: Mon Nov 23, 2009 20:00
by ianstangoe
I guess it could be something your doing, I haven't noticed any flickering with my app yet, are you using any of the new features? Are you implementing the new renderer using the helper functions and startRendering/renderOneFrame()?

Re: Rendering GUI in multiple viewports - OGRE

Posted: Thu Nov 26, 2009 10:50
by scriptkid
Hi,

I had contact with CE about this, and got a reply which i'll try fit into a post :)

To make the problem clear: do you want the CEGUI output in one viewport only, 'cloned' on all viewports, different layouts for each viewport, or something else...? I guess you want GUI on one viewport only, but with the new renderer the default is to render to the entire Ogre::RenderTarget - i.e. ignoring viewports defined in Ogre, which was by design (the fact that you previously had a CEGUI render call for each viewport was horrible and was definitely _not_ by design). The correct solution will (eventually) be to create an appropriate target in CEGUI and use it as the target surface for the layout, though Cegui is not quite there yet. In the interim, it may be possible to create a 'container' CEGUI DefaultWindow that is the same size and position as the target viewport and use it as a host for the actual layout - though this might give issues relating to imagery autoscaling (since it will still be scaled based on the overall render target - though in many cases this may actually be preferable).

As far as the flickering goes, CE's aware of one issue that may cause that (RTT via rending to the front buffer and copying), though the fact it's okay with one viewport would indicate that it's not this. Bugs are also a real possibility due to the way we hook the rendering process for Ogre so that we can automatically call the System::renderGUI function - perhaps a better choice would have been to let the user make this call, which should still be possible for a user to do in special cases. This will have to be tested / demonstrated in order to decide if it's a bug or user error.

HTH!

Re: Rendering GUI in multiple viewports - OGRE

Posted: Thu Nov 26, 2009 13:51
by ianstangoe
Thanks for looking into this scriptkid!

For my purposes I actually need the gui 'cloned' for each viewport, sounds like this isn't implemented currently?

I'm trying to port an existing application to the new version so the dual window workaround is not an option for me, I guess I'm just too eager to have the latest and greatest :lol: I'll hang on until this is implemented.

Thanks.