I need your help to figure out Airscape's performance issues

Discussion and feedback on Construct 2

Post » Sat Feb 28, 2015 10:39 am

@TiAm it's not a spritefont... but text should have a very minimal performance impact. We're not talking mobiles here.

In your benchmarks:
PixelFillrate: Canvas2D gives a slight performance bonus over webGL, in both IE and Chrome.
DevilMark: webGL allows about twice as many sprites as Canvas2D in Chrome, and a little bit more in IE. Interestingly enough, the amount of devils I could spawn before it dropped to 30fps was about *five times* the number of sprites I can support in the renderperftest.

So... still no friggin clue what's going on. You said you see similar results with the renderperf test?

@Somebody thanks for the kind words. As for the fonts loading in, in NW I've never noticed any loading. It's not really designed for browsers.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Sat Feb 28, 2015 7:26 pm

@sqiddster

I think I have a hunch about what is going on here. But first, my test results:

I see similar results in renderperf: 2.5x as many sprites in canvas2d as in webgl. In the other two tests, I get:

PixelFillrate: slightly more sprites onscreen with webgl, about a 25% increase. However, with canvas2d, my cpu gets maxed, whereas webgl only uses about 6%.

DevilMark: Here WebGL pulls way ahead of Canvas2d because the CPU is also having to handle quite a bit of logic moving all the devils around and testing their collisions. About a 3-4X difference.

Okay, here's what I think is happening: Canvas2D is pulling ahead of WebGL because, in systems with integrated graphics, the performance discrepency between the CPU (top-of-the-line) and the GPU (bottom-of-the-barrel) is so great that software based rendering wins out in situations where there is little or no logic overhead. This is why canvas2d falls behind on a test like DevilMark.

What are the actual specs of the systems you are testing on?
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun Mar 01, 2015 1:29 am

@TiAm Your results pretty much match mine. 2.5x for canvas2D is crazy though, I didn't see anything that high.

As for your theory:
It's a great theory and you're probably right, but it strikes me as a little weird. I find it hard to believe that an integrated graphics chipset would perform as well, or slightly worse, than software rendering on the CPU itself. It just doesn't make any sense. Maybe I'm being weird, I dunno. Anyway, from my limited understanding, can't canvas2D be hardware acellerated as well, just more slowly?

As for specs:

Machine 1:

Intel Core i7-4710HQ
Intel HD graphics 4600
nvidia GTX 860M (Disabled for testing purposes)
12gb RAM

Machine 2:

Intel Core i7-4510U
Intel HD graphics 4400
8gb RAM

The other machines are pretty similar, but lower spec'd. Can't access them to get specifics right at the moment.

EDIT: I just asked someone who programs games in pure C++, he said that software rendering should never ever be faster than hardware. I tend to agree, especially when we're talking javascript here.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Sun Mar 01, 2015 1:11 pm

canvas2d IS hardware accelerated too, or at least it does not mean software rendered, in fact, on chrome (I think C2 has things to prevent that) software rendered enables a simulated WebGL (since it is software rendered, there is no limitations feature wise, however it will be slow as hell), and believe me, I have actually a netbook with software rendering by defaut on the chrome browser, and you will not go over 10 fps on it, even with very few elements being displayed.

the fact canvas2d outweight webgl can come from various factors:

-on weak systems (older iphone before iOS8, aka before a just in time compilation of javascript), the webGL javascript overhead can be really painful, that is partially why nobody enabled it on iphones exports in the past
-effects, but since there are ways to disable them no game should be blocked by that.
-perhaps a webgl implementation of the browser that is woncky?
-updating text objects too many times and updating them, they are not performing well on webGL, not sure of the reason.
-using r0j0h0und canvas plugin, it does not render directly in the webgl renderer.


I might forget some (or just don't know them), but the point is canvas2d is another renderer, that is still hardware accelerated.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sun Mar 01, 2015 10:19 pm

@Aphrodite thanks for the clarification. Now that you mention it, I do remember hearing somewhere that canvas2D can be hardware acellerated. For further clarification, if canvas2D is also hardware accelerated, why is it (supposed to be) so much slower than webGL? Is webGL just 'more low-level' somehow?

Anyway, none of your factors even remotely explain what's going on, except perhaps 'wonky browser implementation'

-weak systems? No, this is a top-of-the line CPU and integrated graphics setup.
-effects? None in this benchmark, or my game once I've disabled them.
-wonky browser implementation? Maybe, but that doesn't explain why only some systems are effected. Also, doesn't explain why *all* browsers on these systems are effected!
-text objects? Maybe on mobile this is an issue but I think it's safe to say that for the purposes of this benchmark, text will have a tiny tiny tiny effect, if any.
-canvas plugin? Not used.

Everyone: To put things in perspective: I tested the renderperftest on my 2-year-old android tablet, and with webGL enabled it outperforms all pc's tested by a factor of 3.

Also, just tested in Firefox. canvas2D outperforms webGL by a factor of 2.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Sun Mar 01, 2015 11:00 pm

This is definitely a case of poor implementation with Intel graphics. I noticed my own beefy PC 3770K w HD4400 struggles with WebGL on but off, its fine, the CPU handles it like a beast that it is.

Most gamers do have a discrete GPU, NV or AMD and even the crapper ones are miles ahead of Intel.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Sun Mar 01, 2015 11:47 pm

", why is it (supposed to be) so much slower than webGL? Is webGL just 'more low-level' somehow?
"

as far as I know, yes webgl lets do things in a lower level way, you can do more and as long as it is correctly working, it is also faster since ashley made an implémentation of it specifically for C2 If I am correct.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sun Mar 01, 2015 11:52 pm

@Silverforce If this is true, that's crazy! Surely the implementation couldn't be that poor that it performs three times worse than an Android tablet.

Saying that most gamers have a good GPU may be true, but Intel Integrated Graphics is used by about 20% of Steam users - check out the Steam hardware stats.

You also have to factor in the fact that a lot of the time C2 games will by default fall back to the integrated chipset instead of utilizing the GPU in the first place, which means that this percentage would increase significantly for anyone unable, unwilling, or uninformed about that issue.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Mon Mar 02, 2015 12:44 am

It is true, Intel iGPU cannot render simple WebGL shaders (like water, warp, glows etc) without major performance loss. I've tested this a long time ago to find what shaders work well on iGPU & mobiles and what does not (most of them). This is definitely a case of Intel graphics drivers having zero optimizations for this kind of workload. In general its a hit or miss with gaming on Intel iGPU (some of the games I play on my Intel notebook have horrible texturing bugs or flickering).

You may have to make 2 versions for Steam, 1 with WebGL + shaders for people with dGPU and one without for those on notebooks on iGPU.

Note that this is actually an Intel driver issue, because even crap low-end discrete GPU from NV or AMD have no issues and actually running with WebGL on results in much faster performance as it should.
Last edited by Silverforce on Mon Mar 02, 2015 1:03 am, edited 1 time in total.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Mon Mar 02, 2015 12:52 am

Silverforce wrote:You may have to make 2 versions for Steam, 1 with WebGL + shaders for people with dGPU and one without for those on notebooks on iGPU.


Is there no way to make this an option in-game like at an options menu?
B
80
S
30
G
35
Posts: 340
Reputation: 23,021

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests