Hello,
I've been experimenting with cegui widgets to create an overhead map to track possibly hundreds of continuously updating entities. In the process I ran into a couple of issues.
I've created a new widget that's basically a radio button that displays a small icon. Then I parented a bunch of those to the background image of my overhead map. As a test, each frame I move the images around the map.
The first thing I noticed was that the setproperty method was killing my frame rate for just a few hundred or so entities.
Then I was surprised to find a limit to the number of icons I could create. After 967, gui elements start to disappear and reappear when I click the mouse around.
I'm very curious what's going on. Is it inappropriate to use cegui to display game entities? Is there a faster way to set the position? Also, is there a hard limit to the number of windows?
I'm using pyogre. These things happen with either opengl or the d3d renderer. I'm using Taharez.
Thx in advance.
-Greg
Disappearing Windows & Performance Problems
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 8
- Joined: Tue Mar 18, 2008 17:39
Are you setting properties to the same value? This would kill performance as the Cegui cache cannot be used and would need to be recreated every time. Here's a concrete example of what I'm asking
If this is the type of situation you are in then you need to only update Cegui widgets when they have actually changed:
Code: Select all
onProcessFrame()
{
String currentValue;
for(int i = 0; i < list.size(); i++)
{
currentValue = list[i]->getCurrentValue();
list[i]->getCeguiHandle()->setText(currentValue);
}
}
If this is the type of situation you are in then you need to only update Cegui widgets when they have actually changed:
Code: Select all
onProcessFrame()
{
String currentValue;
for(int i = 0; i < list.size(); i++)
{
if(list[i]->isModified())
{
currentValue = list[i]->getCurrentValue();
list[i]->getCeguiHandle()->setText(currentValue);
list[i]->setModified(false);
}
}
}
-
- Just popping in
- Posts: 8
- Joined: Tue Mar 18, 2008 17:39
-
- Just popping in
- Posts: 8
- Joined: Tue Mar 18, 2008 17:39
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
The render cache system caches drawing operations; that is, not actual imagery but rather what to draw, where and how big.
Generally changes to one window should not cause all other windows to have to regenerate the cache. The only time this happens is when a parent window is resized; all child windows are then invalidated also.
The caches are not re-populated at the time they get invalidated but rather the next time the rendering function is called - so this in effect causes the cache updates to be batched together.
Hope this information is helpful.
CE.
The render cache system caches drawing operations; that is, not actual imagery but rather what to draw, where and how big.
Generally changes to one window should not cause all other windows to have to regenerate the cache. The only time this happens is when a parent window is resized; all child windows are then invalidated also.
The caches are not re-populated at the time they get invalidated but rather the next time the rendering function is called - so this in effect causes the cache updates to be batched together.
Hope this information is helpful.
CE.
-
- Just popping in
- Posts: 8
- Joined: Tue Mar 18, 2008 17:39
Hi Eddie,
Thanks for the info, that's definitely good to know.
In case anyone's curious, I ended up rendering my overhead map using ogre with an orthographic camera and a separate scene manager, drawing the icons as textured quads. This wasn't as difficult as I expected. (Ogre's ManualObject class worked great for setting this up.) Doing it this way gives me a scene manager for object culling and quick hit-testing. After I've got my texture rendered I place it in a static image cegui window. So I still get to use cegui for everything else, which is very nice.
The only thing with this is that I'm going to have to handle drawing the icon states (like selection) myself.
Regards,
Greg
Thanks for the info, that's definitely good to know.
In case anyone's curious, I ended up rendering my overhead map using ogre with an orthographic camera and a separate scene manager, drawing the icons as textured quads. This wasn't as difficult as I expected. (Ogre's ManualObject class worked great for setting this up.) Doing it this way gives me a scene manager for object culling and quick hit-testing. After I've got my texture rendered I place it in a static image cegui window. So I still get to use cegui for everything else, which is very nice.
The only thing with this is that I'm going to have to handle drawing the icon states (like selection) myself.
Regards,
Greg
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 5 guests