Webgl On or Off?

  • Hi everyone

    I have this game experiment that originaly I was making it for mobile is still on the early stage has a few sprites and like 100 events, it has to constantly check line of sight for enemies, but when I tested it on mobile with wireless preview the Cpu goes up 90 with Webgl On, but when I tun off Webgl the cpu stays stable around 30,

    so my question do I have to leave webgl on? or can the game work properly with the webgl off.

    what will be the advantages or disadvantages of one way or the other?

    sorry for many questions but how much Cpu for mobile is to much? example how do you determine if a game is good for mobile or not looking on the cpu usage.

    Thank you very much in advance

  • If your game is using webgl effects then you'll need to keep it on. I guess you must be using them if the CPU is ramping up to 90%?

  • WebGL is up to 10 times faster than canvas2d rendering (what you get when you turn it off). So it should be far faster. I don't know why you'd have measured increase CPU (the CPU measurement is also pretty inaccurate btw), but it's possible it actually increased the framerate and the CPU usage at the same time. My advice is *always* have WebGL on.

  • If your game is using webgl effects then you'll need to keep it on. I guess you must be using them if the CPU is ramping up to 90%?

    thanks, I have checked it and nope I havent use any effects yet, im testing on iphone 6 maybe is that the case?

  • WebGL is up to 10 times faster than canvas2d rendering (what you get when you turn it off). So it should be far faster. I don't know why you'd have measured increase CPU (the CPU measurement is also pretty inaccurate btw), but it's possible it actually increased the framerate and the CPU usage at the same time. My advice is *always* have WebGL on.

    Thanks Ashley,

    yes that's what I thought I been reading a lot of tutorials before that's says it should be faster with webgl on but is not the case with me, that's why I asked on the forum because I'm so confuse. Maybe I'm doing something wrong, but definitely with webgl off stays around 30 cpu and webgl on keeps jumping from 70 to 90 cpu

    btw: I'm using a text object on the screen to check CPU and fps if that helps

  • Run it in debug mode and see what the FPS and CPU read?

  • Run it in debug mode and see what the FPS and CPU read?

    Hi lamar

    I test it on debug and this what i get:

    with webgl On : cpu: up and down 18 to 50 % and fps: up and down from 50 to 59

    with webgl Off : cpu: stable 11 to 13 % and fps: stable 60

  • In the debugger make sure you're not in Inspect mode as you will get inaccurately high CPU readings. Watch or Profile mode should yield more accurate results.

  • > Run it in debug mode and see what the FPS and CPU read?

    >

    Hi lamar

    I test it on debug and this what i get:

    with webgl On : cpu: up and down 18 to 50 % and fps: up and down from 50 to 59

    with webgl Off : cpu: stable 11 to 13 % and fps: stable 60

    What is happening on screen when CPU jumps up?

    Any effects running at that time?

  • Ashley

    as you know that i'm old testing mobile performance

    to be honest ... as far as i know (based on my tests) .... set webgl to off is much better than turn it on .... plus i sometimes get crash using webgl on due to some memory issue

    it's sounds crazy but this is a fact

  • Sharing a minimal .capx showing the performance difference would be the most useful thing to do here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi again,

    just to do a simple test

    is there an action to display memory usage ? i found the cpu usage , fsp but not the memory usage

    and is there a way to enable / disable webgl in the app (an action)?

  • Sharing a minimal .capx showing the performance difference would be the most useful thing to do here.

    Hi Ashley

    here it is

    2 files .capx (with and without webgl) http://www.filedropper.com/test_179

    2 image of the results on real device (with and wihout webgl)

    Devices : iPhone 4s iOS 9.1, iPhone 5 iOS 10

    Wkwebview : enabled

  • Sharing a minimal .capx showing the performance difference would be the most useful thing to do here.

    Hi Ashley I cleaned up a little bit the code and here is a simple capx: consumes less resource but still, you can see the difference

    https://www.dropbox.com/s/25g7jtsnrf9572z/test%20car2.capx?dl=0

    I'm only testing on iPhones I haven't got any android phone to test the difference:

    after I cleaned up a lot of code this is the result I still get on iphone 6:

    with WebGL On : cpu= up and down from 30% to 90% ----------and-------------Fps: from 50 to 60

    with WebGL Off : cpu= stable around 24% never goes up than 24 ----------and-------------stable 60

    Thanks Ashley

  • > Sharing a minimal .capx showing the performance difference would be the most useful thing to do here.

    >

    Hi Ashley

    here it is

    2 files .capx (with and without webgl) http://www.filedropper.com/test_179

    2 image of the results on real device (with and wihout webgl)

    Devices : iPhone 4s iOS 9.1, iPhone 5 iOS 10

    Wkwebview : enabled

    Hi matrixreal Thanks for the test capx, I'm glad that I'm not the only one that has this problem, this is what I get on my test:

    Web gl OFF:

    https://www.dropbox.com/s/ps9objexa4zu7pd/offf.PNG?dl=0

    [/img]

    Web GL On:

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