Disable WebGL Rendering During Runtime?

Discussion and feedback on Construct 2

Post » Tue Apr 29, 2014 10:11 pm

Dear community,

I was having a thought about WebGL (as you do) and wandered what the expert opinion is on this matter. I did a forum search and couldn't find anything about this, so please accept my apologies if this is duplication of a previous thread.

I would like to be able to ensure that players of my games don't suffer from game slowdowns / jerky rendering. I find that my games typically run more smoothly when WebGL is turned off, contrary to the popular advice to leave it turned on. Chrome runs my games very well but I don't think that all game players can or want to use chrome. The slow rendering is so bad that my LD29 entry runs appallingly badly in IE 11 with WebGL enabled (at 5 to 6 fps!!) whereas when WebGL is turned off it runs smoothly at 60 fps. My game has no WebGL shading effects anywhere....

As WebGL rendering is the preferred option, would it be possible to add a feature to enable us to turn WebGL rendering off during runtime? Then I could add a check for low fps to then disable WebGL in the hope that that might improve things. With good design a game should run well on most browsers but it seems that there is no way to realistically support IE on low-end machines without this option. Of course, I would have to detect a low framerate for a period of time for this check to be valid - it would serve no purpose if the slowdown was just for one frame! Is this do-able or am I just demonstrating my lack of understanding how javascript works?

Thanks,

Ed
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Tue Apr 29, 2014 10:17 pm

No, it's not possible to change renderer at runtime. I would be interested to see any examples of games running slower in WebGL mode if you could share them. I've run several pretty different tests and it can often double the framerate or more on some systems and is never significantly slower.

If you're *only* seeing slow rendering in IE11, it's probably using a software renderer, which is likely unique to your system due to buggy graphics card drivers. Try updating them.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Tue Apr 29, 2014 10:29 pm

@Ashley - super quick response - thanks! I can confirm that the only measurable slowdown is when I use IE11. It could be that my 5 year old laptop, which was once state-of-the-art, is now a bit too legacy to run webgl well (the driver is < 1 year old, but it only has 512 Mb of vram...).

I was wandering if there was a way to mitigate for other users who might have old hardware / be using IE11 - but I guess not.

Thanks.
Last edited by Colludium on Tue Apr 29, 2014 10:54 pm, edited 1 time in total.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Tue Apr 29, 2014 10:34 pm

Colludium wrote:@Ashley - super quick response - thanks! I can confirm that the only measurable slowdown is when I use IE11. It could be that my 5 year old laptop, which was once state-of-the-art is now a bit too legacy to run webgl well (the driver is < 1 year old, but it only has 512 Mb or vram...).

I was wandering if there was a way to mitigate for other users who might have old hardware / be using IE11 - but I guess not.

Thanks.


If by any chance you're hosting the game on your own website, then you could use script that detects browser and loads adequate page with version of the game for that browser.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,981
Reputation: 19,316

Post » Tue Apr 29, 2014 10:53 pm

@megatronx - that sounds like a simple and elegant solution to the problem. I'm afraid that I'm still a noob when it comes to scripting (noob actually implies that I have some ability and I'm just starting - that might be a bit of an exaggeration)... One day I'll be better... ;)
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Tue Apr 29, 2014 11:20 pm

Colludium wrote:@megatronx - that sounds like a simple and elegant solution to the problem. I'm afraid that I'm still a noob when it comes to scripting (noob actually implies that I have some ability and I'm just starting - that might be a bit of an exaggeration)... One day I'll be better... ;)


there you go. Just follow the instructions. http://www.pontikis.net/tip/?id=27 if for some reason this wouldn't work, then just look in google for "detect browser jquery script". :) Any other problems then pm me.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,981
Reputation: 19,316


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests