Track pixels drawn per frame/second?

Discussion and feedback on Construct 2

Post » Mon Aug 29, 2016 2:00 pm

So I might've asked about this before, but I'm wondering if there's a way to get a concrete number on a game's fillrate per frame? It's very hard to optimize performance when you don't know exactly what assets that are heavy on the render.

Thanks
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Tue Aug 30, 2016 12:06 am

All the frame is redraw every time, so 1920*1080*60 draws per second, other than that, drawing is super-optimised, don't even try to, so I would assume the bottleneck is in the CPU and thus less sprites processed, the more performance, also, smaller re-usable assets are good too.
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Aug 30, 2016 1:27 am

Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Tue Aug 30, 2016 3:26 am

@Whiteclaws - it's not as simple as that. With C2's back to front renderer, if two objects overlap, those pixels are drawn twice.

@newt That's bitrate, pixel fill rate is the number of pixels a gpu can draw per second.

@Tinimations - I'm not sure how much knowing the exact number of pixels drawn each frame would help. There's such a wide variety of hardware out there any number that's fine for one device will be too much for another, unless you're targeting the Xbox one?

There's also the issue that not all pixels require the same amount of work to draw. Even ignoring webGL effects which obviously add a varying amount of work, a transparent pixel requires more work from the gpu than a fully opaque one. Fully transparent ones still require work from the gpu as well, though only if an object is visible. So if you have an image with a lot of completely transparent pixels, that's work the gpu is doing for no effect. Rotated objects require more work, too.

For any recent gpu though, those aren't really something to be concerned about as graphics cards are getting ridiculously powerful. Ashley tested his new 1070, and if I recall correctly from his tweet he was able to render a quarter million sprites at 30 fps, though I don't know how large they were.

However, on a device like the iphone 4s, having UI panels be opaque instead of transparent makes a considerable difference. On some of those older devices the total pixel fill rate is only about three times the resolution of the screen - so if you have a single background image the size of the screen, that's a third of the pixel budget right there.

I suppose you could calculate the size of the bounding boxes and crop them to the screen to determine a vague estimate of the number of pixels they contain, but again pixels alone aren't the only benchmark for performance because of various things like how it's more work for the gpu to use a larger texture than a smaller one and how it takes extra work to switch from one texture to another (so if you have a hundred of the same image to draw, sticking them all on the same layer can help).

There are more performance tips in the manual, in case you haven't seen them already: https://www.scirra.com/manual/134/performance-tips
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,749

Post » Tue Aug 30, 2016 11:40 am

@Arima This was helpful. Getting the feeling occational slowdowns I experience on laptops can be blamed on how I use a big background image with a transparent dark tile above it, essentialy rendering the full background twice. I turned off big fog sprites, and that greatly improved it.
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Tue Aug 30, 2016 11:55 am

Arima wrote:@newt That's bitrate, pixel fill rate is the number of pixels a gpu can draw per second.


Yes, but it's a good indicator of what you should be looking for for bottlenecks.
Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Tue Aug 30, 2016 12:18 pm

check this out now:
1920*1080*60 *32 bit per pixel /8 bits for byte / 1024 to Kbytes = 486000KB = ~ 500MB per second.
can you phone do that ? probably not. therefore lower the res for your games. PC can handle this
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
42
S
14
G
12
Posts: 624
Reputation: 9,421

Post » Tue Aug 30, 2016 5:49 pm

@saiyadjin

Yes, and it does, a modern mobile GPU can push out 60 to 120 draw calls per second, also, that is misleading cause RAM is cleared between draws and the number of pixels drawn has nothing to do with the total RAM used per frame to draw screen
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Aug 30, 2016 5:51 pm

@arima, well I assumed C2 draws everything in one draw call.

But OP, most likely the bottleneck is CPU-wise for most modern systems
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Aug 30, 2016 6:23 pm

what are you talking about? if your whole scene changes then it does. also on bad engines it does.
it's around 9MB/frame of processing.

but usally engines render only moved pixels and what not to optimize nicely so that's pretty solid. and the other thing is - if you got blending, effects there are more passes through GPU then one, and it slow the whole process down, so really forget your 60FPS on mobile.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
42
S
14
G
12
Posts: 624
Reputation: 9,421

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests