Webgl On or Off?

Get help using Construct 2

Post » Fri Feb 10, 2017 6:11 pm

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
B
39
S
22
G
77
Posts: 288
Reputation: 42,692

Post » Fri Feb 10, 2017 7:37 pm

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%?
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Fri Feb 10, 2017 7:43 pm

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.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,625

Post » Fri Feb 10, 2017 8:46 pm

Burvey wrote: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?
B
39
S
22
G
77
Posts: 288
Reputation: 42,692

Post » Fri Feb 10, 2017 8:59 pm

Ashley wrote: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
B
39
S
22
G
77
Posts: 288
Reputation: 42,692

Post » Sat Feb 11, 2017 1:53 am

Run it in debug mode and see what the FPS and CPU read?
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sat Feb 11, 2017 2:10 am

lamar wrote: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
B
39
S
22
G
77
Posts: 288
Reputation: 42,692

Post » Sat Feb 11, 2017 4:52 am

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.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Sat Feb 11, 2017 5:22 am

tarek2 wrote:
lamar wrote: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?
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sat Feb 11, 2017 9:05 am

@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 :D
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Next

Return to How do I....?

Who is online

Users browsing this forum: KSLR and 41 guests