Rendering GUI in multiple viewports - OGRE

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Jabberwocky
Quite a regular
Quite a regular
Posts: 86
Joined: Wed Oct 31, 2007 18:16
Location: Canada
Contact:

Re: Rendering GUI in multiple viewports - OGRE

Postby Jabberwocky » Thu Nov 26, 2009 17:36

scriptkid wrote:As far as the flickering goes


Here's a bit of additional information that may be relevant to the flickering issue.

Even using a single viewport, I've noticed some flakiness with the following:

1. FRAPS
The fraps number overlay is sometimes displayed, sometimes not. The FRAPS overlay visibility seems to change as different windows are activated or deactivated. This was not a problem previous to 0.7.x

2. Ogre Overlays
I use ogre overlays for a small number of things in my game, including playing video, and for an in-game console. (I like having the console non-CEGUI based so that I can access in-game testing commands even when I've disabled CEGUI for performance testing purposes).

These ogre overlays exhibit the exact same problem as the FRAPS overlay, which is sometimes they are drawn correctly, other times they are completely invisible. Similarly, these overlays seem to pop in and out as I toggle the visibility on CEGUI windows.

Neither of these are critical issues, although a CEGUI/FRAPS incompatibility would be noticed by both devs and end users.

Once CE is back, I'd be happy to provide any more information that might help diagnose this issue.
The Salvation Prophecy
Space Combat. Planet Exploration. Strategic Domination.

eugen
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Tue Jun 03, 2008 03:29
Contact:

Re: Rendering GUI in multiple viewports - OGRE

Postby eugen » Thu Nov 26, 2009 22:03

Thanks for the anwsers, ill look more into it in the next weeks!

eugen
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Tue Jun 03, 2008 03:29
Contact:

Re: Rendering GUI in multiple viewports - OGRE

Postby eugen » Sat Nov 28, 2009 16:53

i encountered the FRAPS behavior as well, i sometimes even have the FPS counter shown only partly at a margin of a CEGUI window.
Im using as well some Ogre Overlays at the same time with CEGUI controls. They dont flicker however, only CEGUI controls flicker. The thing is this is only happening in the editor (MFC app, 4 Ogre windows each having one viewport) and not ingame (which is a big releaf cause the editor flickering is not a critical thing for us currently)

User avatar
Jabberwocky
Quite a regular
Quite a regular
Posts: 86
Joined: Wed Oct 31, 2007 18:16
Location: Canada
Contact:

Re: Rendering GUI in multiple viewports - OGRE

Postby Jabberwocky » Fri Dec 11, 2009 02:26

Jabberwocky wrote:
scriptkid wrote:As far as the flickering goes


Here's a bit of additional information that may be relevant to the flickering issue.

Even using a single viewport, I've noticed some flakiness with the following:

1. FRAPS
The fraps number overlay is sometimes displayed, sometimes not. The FRAPS overlay visibility seems to change as different windows are activated or deactivated. This was not a problem previous to 0.7.x

2. Ogre Overlays
I use ogre overlays for a small number of things in my game, including playing video, and for an in-game console. (I like having the console non-CEGUI based so that I can access in-game testing commands even when I've disabled CEGUI for performance testing purposes).

These ogre overlays exhibit the exact same problem as the FRAPS overlay, which is sometimes they are drawn correctly, other times they are completely invisible. Similarly, these overlays seem to pop in and out as I toggle the visibility on CEGUI windows.

Neither of these are critical issues, although a CEGUI/FRAPS incompatibility would be noticed by both devs and end users.

Once CE is back, I'd be happy to provide any more information that might help diagnose this issue.


I just thought I'd post an update to my above issues with ogre overlays and FRAPS.

I've now solved the issue, with a bit of extra code in my CEGUI integration. I believe the problem was a general issue rendering anything after CEGUI. This issue may not be new, I found an old Ogre3D post that discusses a similar problem with an earlier version of CEGUI: Ogre3D: Render *anything* over CEGUI [Solved].

Ogre3D: Render *anything* over CEGUI wrote:at the moment my best guess is that OgreCEGUIRenderer is doing some state changes that prevent anything from being rendered properly after it


I've noted that this problem doesn't always manifest itself - for example FRAPS seems to work in the CEGUI samples I've tested. I believe it may depend on the properties of the last CEGUI window you've drawn.

Anyway, my fix looks something like this:
(This is my Ogre3D based game, using some game-specific classes, but it should be decipherable):

Code: Select all

      Camera* pCamera = CameraSys()->GetOgreCamera();
      if ( pCamera && pCamera->getViewport() )
      {
         GraphicsSys()->GetOgreRoot()->getRenderSystem()->_setProjectionMatrix( pCamera->getProjectionMatrixRS() );
         GraphicsSys()->GetOgreRoot()->getRenderSystem()->_setViewMatrix( pCamera->getViewMatrix() );
         GraphicsSys()->GetOgreRoot()->getRenderSystem()->_setViewport( pCamera->getViewport() );
      }


If this code is called per-frame, after CEGUI renders, then any subsequent rendering (FRAPS, ogre3D overlays, etc) work just fine.

Hopefully that may help anyone else who stumbles across this somewhat obscure issue.
The Salvation Prophecy

Space Combat. Planet Exploration. Strategic Domination.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Rendering GUI in multiple viewports - OGRE

Postby CrazyEddie » Sun Dec 13, 2009 17:34

Thanks for all this info, testing and what have you regarding this issue.

One of the situations we have when we test is that most of our testing is done using our own samples framework - which is by it's very nature a little bit contrived. What I plan for the future is for the base application for each engine or API to have something a little more substantial in the background, I believe this will enable us to better test the interaction of CEGUI with some 'regular' output from the various engines or APIs - because while everything looks and works great over a blank / static display, it may not under more realistic conditions, so this is something we need to move towards in the new new year :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests