-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stats showing actually rendered frames #1082
Comments
Thanks a lot for the suggestion, Jean-Christophe! I agree – in some situations, it would be more useful to see the actual frame count without the skipped frames. I think my reasoning behind the green color (vs. showing the actual number) was that I thought it would be sufficient in most cases, while not distracting as much from the pure "how many frames are there" information you typically need. If the FPS number had suddenly shown, say, 20, while you target 60 fps, it would have been confusing for users. What we could also do, along the lines of your idea, is to add a new line that counts only the skipped frames. So, a game targeting 60 fps would still show "60" in the FPS line, but e.g. "40" as "skipped frames/sec". What do you think of that? |
Yes, more stats sounds even better. Along with the idea, I was looking into a way to get the data from Starling about rendering stats, without hacking into Starling source code. It would be useful, for example, to get full performance data into my analytics. There is an I could add events Or/and add Or/and add a |
Note that "skipped/sec" is typically two frames lower than the "frames/sec" – that's because the stats display renders two times per second. 😉 |
Great!
OK, so that's only when the stats are displayed, good to know. I assumed there was a built in minimum of the refresh rate. Maybe there is a way to know the frame was only drawn because of the stats display? This way it could still counts as a skipped frame. No need to over-complicate things just for that though. |
Thanks for your quick review, Jean-Christophe! 😄
Mhm, I thought about that, too; just as the number of draw calls shown ignores those of the stats display, it would be great if the "skipped frames" count would take the stats display itself into account. However, it's not so easy, because I don't know who or what is responsible for a draw call. E.g. there could be a TextField on the stage displaying the current time, updating in sync with the stats display. With the stats display enabled, it wouldn't even change the skip count. So I guess all I can do is document this behavior, but keep it as is. 😉 |
Just a random thought I got on that. Assuming It might be relatively easy to implement (pseudo code). /// @internal
DisplayObject.dirtyList(): Array<DisplayObject> {
if (this.requiresRedraw) return [ this ] else return [];
}
/// @internal
DisplayObjectContainer.dirtyList(): Array<DisplayObject> {
const ret = [];
for (const obj of this.children)
ret = ret.concat(obj.dirtyList());
return ret;
} That gives the list of objects that need redraw:
|
Thanks for the suggestion, Jean-Christophe! You're right, it might be useful to add such functionality to be able to find out more about what's responsible for a redraw – and use that inside the stats display, too. I'll think about this! |
I don't know if that would make sense, I found it more interesting in my app to know the actual number of frames rendered per seconds by Starling (not including the skipped frames).
This allows me to better optimize for letting starling skip frames. My real case example, rounding all angles and alpha value to "0.01" my in-game screen went from 6 real fps to 2 real fps (i.e. not counting skipped frame). This information I can't know from the green color alone.
I can make a proper PR, here's the diff (I wasn't working from the git repo)
The text was updated successfully, but these errors were encountered: