C2 & CocoonJS WebGL issues

Discussion and feedback on Construct 2

Post » Tue Nov 12, 2013 3:39 am

Apparently when WebGL is turned on when exporting to CocoonJS I lose about 20+ FPS as compared to exporting with WebGL turned off. Tested on iPhone 4.

I've did a simple test, no codes or logic just static background images alone and it still happens. With WebGL on, there seem to be some efficiency issues when rendering images.

I've check with Ludei and they said there's some issues with C2 exportation. Issues like multiple changes over the same texture, or multiple uploads to the graphic chip that may slow down the framerate.


Is there anyway we can optimise this?

Thanks!
B
9
S
1
Posts: 18
Reputation: 711

Post » Tue Nov 12, 2013 10:15 am

WebGL is faster than canvas2d by a significant margin in all real browsers, even on mobile. I know users get annoyed by getting ping ponged between us and Ludei, but I think it's fairly obvious that it's CocoonJS that is slow, not Construct 2...
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Nov 12, 2013 2:20 pm

@Waltz @Ashley

I recently sent them my entire finished project to see if they could improve it, and got a message back today saying:

"We've solved this problem in our Box2D binding, you'll be able to use it in the next release of CocoonJS, which will be announced in about 1~2 weeks."

So that seems very positive indeed :)

Thing is, Ashley told me to contact them a while back, but I kept holding off, assuming that the acceleration issue had been reported many times before. Sorry about that!

Hopefully we'll see some improvements in the next build.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 963
Reputation: 10,721

Post » Tue Nov 12, 2013 5:01 pm

We currently have WebGL disabled on iOS and enabled on Android. Performance is better for us this way for some reason.
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,920

Post » Wed Nov 13, 2013 3:07 am

@Ashley
Agree that C2 works great in all browsers, I'll try a few more test samples to see if I can help pinpoint where the problem lies. At least there will be some error reports or samples for either side to work on.

Btw, I got 3 warnings in CocoonJS console log:
Not implemented canvas addEventListner: webglcontextrestored
Not implemented canvas addEventListner: webglcontextlost
Not found getElementById: c2canvasdiv

Seems like some things weren't implemented. I've already feedback to Ludei. Hopefully this helps.


@AnD4D
Isn't Box2D a physics engine? I don't think it's the same problem. What we're facing is most probably a rendering issue. Just Static background images alone can bring down FPS significantly.


@thehen
Yup, we're doing that too. Since this WebGL problem only affects iOS devices, its likely that there's some bugs with CocoonJS.
B
9
S
1
Posts: 18
Reputation: 711

Post » Wed Nov 13, 2013 11:58 am

It might be to do with the fact that Javascript cannot be JIT compiled in iOS apps, making it slower. The WebGL renderer shifts more of the drawing logic in to Javascript and relies on the fact the Javascript is well-optimised, so I guess it might be possible WebGL mode is actually slower on iOS. However I'm pretty sure I did a benchmark that showed WebGL was still faster on iOS... but then benchmarks can produce pretty artificial results.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Fri Nov 15, 2013 11:56 am

Yup, as a HTML5 compiler, Ludei have to find a way to solve this in order to take things further with the Construct 2 community.

We're trying out game closure currently. It's really a pain in the ass. 3 days straight and we still can't get our game running. I think it might be too technical for the C2 community to handle.
B
9
S
1
Posts: 18
Reputation: 711


Return to Construct 2 General

Who is online

Users browsing this forum: BurningWood, lukewasthefish, unicornspitfire and 5 guests