Comments (8)
What do you think of that?
I also really liked your proposal of adding a new SKIP_FRAME
event, so I added that, too. Thanks so much for the suggestion!
from starling-framework.
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?
from starling-framework.
add a new line that counts only the skipped frames
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 Event.RENDER
event. It is only triggered when a frame is not skipped, so doesn't give the actual FPS (one might assume Event.RENDER
is triggered when render()
is called).
I could add events Event.SKIP_FRAME
(and Event.DRAW_FRAME
which would be more explicit, but would do the same as Event.RENDER
).
Or/and add skipCount
to the Painter
? So it exposes both frameCount
and skipCount
.
Or/and add a function get stats():Stats
with class Stats { ...data from StatsDisplay... }
.
from starling-framework.
Note that "skipped/sec" is typically two frames lower than the "frames/sec" β that's because the stats display renders two times per second. π
from starling-framework.
What do you think of that?
Great!
"skipped/sec" is typically two frames lower than the "frames/sec"
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.
from starling-framework.
Thanks for your quick review, Jean-Christophe! π
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.
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. π
from starling-framework.
Just a random thought I got on that.
Assuming displayObject.requiresRedraw
indicates that a given DisplayObject
is to be redrawn.
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:
- good for debugging which object is responsible for redrawing the scene (when trying to improve that)
- allows starling check that only the stats display is responsible (when showing it).
from starling-framework.
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!
from starling-framework.
Related Issues (20)
- Glow Filter: Color issue HOT 7
- native overlay now block touch and mouse input HOT 1
- How do I use it correctly βdrawToBitmapDataβ HOT 6
- AssetManager strange behavior
- AssetManager problem HOT 9
- Reverse delay for Tween HOT 2
- ArgumentError in createVertexBuffer HOT 14
- DisplayObject dispose() method doesn't automatically remove the object from its parent HOT 3
- Render Texture: "Error #3605: Sampler 0 binds an invalid texture" when not cleared or drawn before actual Image rendering HOT 3
- Render Texture: draw method doesn't render display object with filter if parent is shifted HOT 8
- Texture: Setting vertex UV coordinates doesn't take into account the potential frame of SubTextures HOT 5
- How do we use Asset Manger with Google Play's Install Time Asset Packs? HOT 4
- Starling Texture.fromCamera() flickering and a part of the picture is missing on Windows HOT 4
- Object not removed from Stage on Android - Starling maybe? HOT 5
- Starling update from 2.5 to 2.7 doesn't catch tap around the left/bottom side HOT 2
- Juggler: String allocation when using IAnimatable as a Dictionary key HOT 4
- OpenGL error at macOS 12.2.1 (M1) HOT 2
- [Feature Suggestion] Vector Graphic Tesselation HOT 5
- ATF Textures without mipmaps have black artifacts HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starling-framework.