How do I turn off WebGL in game

Get help using Construct 2

Post » Mon Dec 28, 2015 2:46 pm

Hi. I'm making an 'options' menu for my game. And I would like to turn off the WebGL completely as the 'Fastest' graphic mode.

So, is there a way to toggle WebGL in game?
Image
B
27
S
5
G
2
Posts: 194
Reputation: 2,968

Post » Mon Dec 28, 2015 9:49 pm

Not in game, the runtime does different setup for webgl on/off when the runtime starts. Best you could do is two exports, one with webgl of and one with webgl off. Then when you change the option your game would cause the the url of one or the other to load.
B
85
S
27
G
85
Posts: 5,068
Reputation: 57,870

Post » Wed Dec 30, 2015 9:54 am

Mmh, yeah, I see.
As I may export to NW.js, I think that I'll juste make a loop that goes trough every object and deactivate its effects.
Even so I've been in the 'profile' tab in debug mode, and it seems that what causes most lag is my blur effect on lightning and the motion blur I added.
Anyway, thank you :D
Image
B
27
S
5
G
2
Posts: 194
Reputation: 2,968

Post » Wed Dec 30, 2015 1:07 pm

WebGL is usually 2-10x faster than canvas2d, so I don't know why you would want to turn it off...
Scirra Founder
B
378
S
220
G
84
Posts: 23,868
Reputation: 188,111

Post » Wed Dec 30, 2015 2:40 pm

@Ashley
Yep, as I said, what was really making the game laggy was the blur on lightning and the motion blur.
Deactivating one of the two would give me some extra FPS and deactivating both would give me back my 60FPS, so I think that's what I'll do :D.
Thank you anyway!
(Btw, I found a way to put two events in the same box even if they shouldn't be. Like the "Trigger once while true" and "On function" and so on. For the moment, it helps me doing some things and don't seem to be creating any bug or glitch, so I would rather say it's a tip and trick, but, if it happened that it may cause any problem, here is how I did it:

Image

Anyway, that's still useful if a function is called in multiple following frames, like on a "Is key pressed" condition:

Image
Image
B
27
S
5
G
2
Posts: 194
Reputation: 2,968

Post » Wed Dec 30, 2015 2:53 pm

@skymen - please report any problems to the Bugs forum following all the guidelines, otherwise the issue will be forgotten.
Scirra Founder
B
378
S
220
G
84
Posts: 23,868
Reputation: 188,111

Post » Wed Dec 30, 2015 2:53 pm

Ashley wrote:WebGL is usually 2-10x faster than canvas2d, so I don't know why you would want to turn it off...


on android yes
on ios no
B
38
S
11
G
4
Posts: 714
Reputation: 5,475

Post » Wed Dec 30, 2015 5:14 pm

It should be faster on iOS too - the 2-10x faster figure I gave is after testing over a wide range of platforms including iOS, and I have data to back it up. Have you seen performance issues on iOS?
Scirra Founder
B
378
S
220
G
84
Posts: 23,868
Reputation: 188,111

Post » Wed Dec 30, 2015 9:31 pm

Ashley wrote:It should be faster on iOS too - the 2-10x faster figure I gave is after testing over a wide range of platforms including iOS, and I have data to back it up. Have you seen performance issues on iOS?


for android it's okay ... we can see clearly the difference between export to android and export to crosswalk (webgl enabled)
but on ios ... i see the opposite ... when i disable webgl i get better results than enabling webgl
B
38
S
11
G
4
Posts: 714
Reputation: 5,475


Return to How do I....?

Who is online

Users browsing this forum: AekiroStudio, Congrats2u, Exabot [Bot], OddConfection, RetroSpock, SoldjahBoy, TheGreatAdam12 and 10 guests