Boosting STK

Boosting STK

Postby Funto » 10 Jul 2011, 14:26

Hi all,

As some of you already know, I've been working on a graphical profiler for STK.
The aim of this is to have a visual feedback while playing as to what part is taking the most of time in a given frame. Plus, this can be also used by non-programmers, so they can easily report stats while playing by just taking a screenshot.
It can be activated by hitting right-Ctrl+P while in artist debug mode and frozen by clicking on it. Hovering it with the mouse gives some additional informations.

Here is a screenshot of it:

Image

As you can see, the most time-consuming call is smgr->drawAll(), but getting more details on this necessitates putting markers in Irrlicht itself...
This screenshot also shows that we are CPU-bound, as the black marker coincides with the end of IrrDriver::update().
We can also see that music playing consumes a ridiculous amount of the total frame, and that physics calculations (in the green part) are really fast compared to the update of the Irrlicht scene manager...

As Auria and hiker suggested, the problem probably comes from software skinning (animations).
I will have a look at this code to try to implement vertex skinning in STK, so hopefully by making the GPU work a bit more we could boost the things up a bit :)

More to come :)
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: Boosting STK

Postby Auria » 10 Jul 2011, 18:31

Hi Funto,

this is interesting, but I think you need to average the values over a few frames because atm it moves just too fast ;)
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Boosting STK

Postby Funto » 11 Jul 2011, 12:29

You can still freeze the current frame...

I'm not sure if averages would be a better measure, hmm probably...but I don't think you would get very different results.
Plus, it's not so trivial to average the values as some parts could appear and disappear between frames (you don't necessarily push the same markers from frame to frame) but this could probably be handled by recording frame data and then matching the markers.

The primary aim is to get a global idea, and particularly in real-time, of what takes a long time to execute.
Thing is, I can't put markers in Irrlicht unless I modify it :/ So I think that's the most important thing to modify in the profiler...
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: Boosting STK

Postby hiker » 11 Jul 2011, 13:24

...
Funto {l Wrote}:The primary aim is to get a global idea, and particularly in real-time, of what takes a long time to execute.
Thing is, I can't put markers in Irrlicht unless I modify it :/ So I think that's the most important thing to modify in the profiler...

I see two options: irrlicht already has some counter (which iirc are implemented as some kind of attributes, i.e. might be easy to extend). We could give a patch to irrlicht would add a lot more detailed profiling. This would require some close cooperation with their devs.

Or we could just add 'wrapper' classes around (the most important) irrlicht classes which add the markers. Then we slightly redesign the way we create those objects (instead of getting instances from the scene manager we use a factory and ask for objects with or without marker code - i.e. we could at runtime decide if we want to use them or not . That shouldn't actually be too much work, since nearly all objects are allocated via the irr_driver class.

Only downside is that we can only measure functions which are declared virtual (well, esp. internal functions which we don't call directly, like OnAnimate), and we can't 'subdivide' different parts of one function.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Boosting STK

Postby Funto » 11 Jul 2011, 19:14

That seems an interesting idea :)

And as Irrlicht uses interfaces extensively, maybe the granularity would be sufficient :)
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Who is online

Users browsing this forum: Google [Bot] and 1 guest