C3 on Mac - your experiences

Post » Thu Oct 05, 2017 11:05 am

Ashley wrote:This is just another case of poor fill rate performance. We see people running in to this a lot.

Intel GPUs (which most MacBooks have) have pretty low fill rate capacity. The project provided uses two force-own-texture layers, and enough content is displayed to count as another fullscreen draw, and then there's usually the overhead of a fullscreen draw to copy the game to the display. So it's at least 4x fullscreen draws per frame. On a high-DPI 2K display, one fullscreen draw alone will copy 3.7 million pixels, or around 14.7mb of data. The project does that four times, so it's about 59mb overhead per frame. If you want to reach 60 FPS, that means 3.5 GB/sec of GPU bandwidth.

Presumably the Intel GPUs have a memory bandwidth lower than 3.5 GB/sec, so you can't hit 60 FPS.

This is nothing to do with the fact your game is "only" 256x144: once you enable "high quality" fullscreen mode, it's rendering everything - including every layer - at full-whack 2560x1440 resolution. That's what "high quality" fullscreen mode is for! For this kind of game you really ought to use "low quality" fullscreen mode to avoid wasting GPU bandwidth - since that really will render the entire game at 256x144 (which is so small the performance overhead is probably negligible), then stretch the game up to the full-res 2560x1440 once at the end, meaning there is only 1x fullscreen draw overhead. That's probably at least 4x more efficient than your current high-quality fullscreen mode approach.

By the way this is nothing to do with HTML5, browsers, Construct or anything else - you've hit a hardware limit. A native app would perform the same. 3D games are designed to perform minimal overdraw so don't tend to run in to run in to fill rate limits so much.


Yesterday I watched a Unite 2017 talk on this very optimization. The developers were making a game in Unity that needed to run at 60 fps on an iPhone 4S. One of their key optimizations was to render the game at low resolution, then upscale to high resolution:

https://www.youtube.com/watch?v=vJZcbscZ4-o&t=804s

I also had this problem in my game that I built with the Q3D plugin in C2 -- I couldn't understand why it was running so much better (60 fps) on a 2013 MacBook Air at 1366x768 than on a 2017 MS Surface Pro 4 (13 fps) at 2736x1824. I lowered the resolution to 1280x720 and let it upscale, and the game magically ran at 60 fps on the high resolution device.

Edit: I had to chuckle when I read this, because I thought it was a Windows problem. :)
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
24
Posts: 400
Reputation: 16,648

Post » Thu Oct 05, 2017 1:59 pm

Thanks all for your suggestions, advice and also information :) Still learning, i never had a problem on Windows with the game so i'm glad that at least the issue came up, while i'm still at such an early stage and totally makes sense.

@Ashley : Thanks as well for your explanation, it makes total sense. Just for the record: i never blamed Construct or HTML5 or anything, i just thought it was more a question of Retina Resolutions than of GPU power so i thought maybe i was missing something.

The reason why i wanted to use the high quality setting on the fullscreen mode in the first place was, that i wanted to use Webfonts in my game. Now, at this resolution and going with the "low" quality setting, as you can imagine, you can't make out anything anymore of the text. But it works without any problems on my MacBook. It works rather well with the Settin on "high", the high-dpi display setting OFF and the scaling set to "letterbox integer"...

Which brings me to my question actually... What would you suggest to do? I see three possible options:

1. Go with Spritefonts, which i don't really want to, since the game is already being translated into languages using special characters like äöü or â and so on, plus again, with a Gameboy Resolution there's pretty much just so small as you can go with sprites.

2. Export all my assets double the res (512*288) and use Fonts there. They will still be blurry but at least less blurry than with half of that resolution.

3. I don't know, this is a long shot, but maybe i'm missing something? Is there a way to use the "low" quality setting on a project but still keep crisp Webfonts when scaling up?

I'm worried that when i upscale my assets, that i could run in performance problems again, since i'd like to use quite some effects (actually just one force own texture layer per layout, i think that second one was added by mistake ;))

About performance i got a question too:

When i, let's say, use my vignette png in half the resolution and then upscale it in the engine, does it use less performance than when i import a fullscreen vignette png in the first place?

Thanks for all your help!

Joel
B
16
S
7
G
2
Posts: 111
Reputation: 2,149

Post » Thu Oct 05, 2017 2:22 pm

For now I'd go with option #2 - pick the lowest resolution where text is still legible and use that with "low quality" fullscreen mode.

In the C3 runtime we'll probably add a feature that lets you have low-quality and high-quality scaling on different sets of layers, but that's a long term plan at the moment. Also it can still impact performance, since each layer you render at full resolution adds another full-screen draw - so just one extra layer of high-quality text would bring you up to 2x fullscreen draws. I guess that's still better than 4x though!

When it comes to fill rate, the important thing is the size the image is drawn at. That's why low quality fullscreen mode is so effective: it draws everything at a small size, and only stretches it up at the end.
Scirra Founder
B
397
S
236
G
88
Posts: 24,412
Reputation: 194,514

Post » Thu Oct 05, 2017 2:37 pm

@Ashley Already began to set that up, seems to be the best choice as well and i could use larger SpriteFonts too, if i choose to go with those after all ;)

Thanks for all your help! I just wanted to say that i really love C3 and i advocated it very strongly in the Adventure Development Community so, i hope that makes up for some noob questions :)

If you're interested, my twitter is www.twitter.com/joelmayerprods and we'll show off some new stuff of the game at AdventureX in London in November so more exciting C3 stuff coming up soon :)
B
16
S
7
G
2
Posts: 111
Reputation: 2,149

Post » Sun Oct 08, 2017 3:55 pm

C3 is so great. I love it.

The fact that I can use it in a browser is probably one of it's best features.

My only complaint is that the hotkey buttons are just mirrored from PC versus being more mac specific. This happens a lot with cross-platform software. Blender comes to mind as one of these programs.
B
73
S
12
G
6
Posts: 386
Reputation: 8,676

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests