C2 & CocoonJS WebGL issues

  • 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!

  • 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...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • We currently have WebGL disabled on iOS and enabled on Android. Performance is better for us this way for some reason.

  • 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.

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)