Page 1 of 1
CEGUI/Ogre Performance
Posted: Tue Jan 01, 2008 17:08
by danto
'm having some severe performance issues with CEGUI/Ogre and I'm not sure why. I'm working on an editor application for my game and I'm discovering some issues with CEGUI.
Here is the UI I have:
In that image I'm currently running at 25 fps. When I first load into the editor that Object Creation window is not there and I'm running smoothly at over 1000 fps. As soon as I load up that window it crashes down to between 20-25 fps. If I move the mouse over the window or drag the window it slows down to 12-16 fps. I'm using the latest Ogre and have compiled from source. I've also compiled CEGUI from the lateset source as well. I'm not sure why I'm getting such bad performance. I can't even move the window without it stuttering like crazy. Any ideas?
Posted: Wed Jan 02, 2008 02:25
by Rackle
The standard reply is to run the application in a release rather than debug compile.
A potential problem could be that you are calling setText() or any other Cegui method to update the Cegui widgets every single frame. This essentially bypasses the Cegui cache, requiring a lot of processor to process every bit/detail that makes up each widget; the image of the widget itself and any text/images it may contain. The current version of Cegui does not check whether the setXXX() function is called with an unchanged value, you have to perform this test yourself.
Hope this helps.
Posted: Wed Jan 02, 2008 16:05
by daves
We are using cegui/ogre as well. Please let us know if, indeed, you were looking at performance in debug mode. To Rackles point there is a LOT of debug structure and applications will not run at high performance if debug is turned on.
In general, our application is a resource intensive application that is doing a LOT of graphics both within ogre and within cegui. We have seen reasonable performance though we do not look at performance as measured in FPS, rather we look at performance in terms of the number of objects that we can render with a reasonable update rate to each object.
Of the various objects that we render within a scene some are static, some are mobile. To Rackles point it is important to develop an architecture such that updates to objects are made only as needed (e.g. some visual attribute associated with the object changes). In our application this typically requires object updates (to potentially thousands of objects) on a roughly once per second basis (as opposed to a per-frame basis).
Posted: Wed Jan 02, 2008 22:03
by danto
I'm running CEGUI in release mode. After double checking what Rackle mentioned I changed how I update my fps counter and noticed a dramatic increase in performance as I was doing setText every frame. Now I had put in my fps counter specifically because I was noticing some slow downs...not as dramatic as outlined above, but it felt sluggish when dragging the window around.
After making some changes to my code the framerate counter is not updated every frame, but only when there is a change in framerate. After doing it this way I am getting over 50 fps even when moving my window. From a framerate standpoint I'm ok with this, but even with this framerate it feels sluggish when moving the window around and not as smooth as I would expect. Are there any other considerations or options in CEGUI that I could possibly change or eliminate to up performance? Thanks for the feedback.
Posted: Wed Jan 02, 2008 22:33
by Rackle
danto wrote:feels sluggish when moving the window around
This is a different problem; I seriously doubt that the cache is flushed when moving a window around. What may happen is that the mouse behaves as if it was moving around freely. In that situation Cegui checks whether the mouse cursor enters/leaves (starts/stops hovering over) a widget. This requires checking for the window under the cursor, which may be the culprit here. However I do not really know, it's just a hunch. A search on "window move" (move/moving/movement/dragging) may reveal information on this.
Posted: Sat Jan 05, 2008 18:33
by danto
Well after spending some more time and doing some more troubleshooting it appears to be an issue with my skin. I'm not sure yet what the trouble is but I swapped out my skin for the TaharezLook skin for my editor and it ran smooth as silk. I'll spend some more time tracking down what it is in my skin, but it definitely is a skin related issue.
Posted: Sat Jan 05, 2008 20:18
by danto
Looks to be fixed. On my FrameWindow setup in my looknfeel file I changed the vertFormat and horzFormat to Stretched instead of tiled. The edges are a lot smaller then what the taharez skin uses so apparently the tiling of that small edge was seriously eating up the framerate. After putting it to stretched instead of tiled my framerate has shot way up and is now reacting as I would expect. Thanks to those who helped on this matter.

Posted: Thu Jan 10, 2008 17:51
by Pompei2
I had the same, I took a 1-pixel image as background for a FrameWindow and put it in as "Tiled", it was slooooooooooooooow. I then changed this to "Stretched" and it was much better.
Just for reader's information
