WebGL

Discussion and feedback on Construct 2

Post » Fri May 04, 2012 3:42 pm

I have updated the examples again. I might just create a tutorial if enough people find it beneficial. But basically in your game you provide webgl as an option if possible. The webgl version of your runtime and the html file only need to be copied to your original directory, so that both the canvas only script and the webgl script load from the same files. So what do you think?
B
14
S
1
G
1
Posts: 16
Reputation: 1,805

Post » Fri May 04, 2012 4:05 pm

[QUOTE=Kyatric]
@VampyricalCurse: what's all the fuss with the corporation insanity there ? Are you blaming microsoft for not having the funds to buy a decent/recent computer ? Why are they responsible for the situation ?
Same remark as for Wink, if you don't have even a decent gear, you can't expect to execute latest game/technology.[/QUOTE]

Fascinating... I must be missing something in my own post because 1) I don't see where I mentioned M$ or ANY company. 2) Where did I blamed them for MY unfit computer...? Oh btw, I do have a perfectly fit computer that runs HTML5 fine, another one that runs ok but not optimum and another one that runs it slooooooooow. And 3) I wasn't complaining about my own gaming experiences or financial situation, but those of poor people in general. You seem to think this is alright, because you and I can afford newer computers, however, this is not right. Is HTML5 an elitist tech then? I don't think so dude and if it was, it would die fast.

I don't expect a modern HTML5 or even a native modern EXE game to run on a 90's computer, however computer from at least 2005 should be able to run HTML5 like they run EXE. We are talking about 2D game here for crying out loud. Maybe they will, but will it be too late for HTML5 before then? Nobody can tell and I hope not.

[QUOTE=Kyatric]If you don't like depending on browser, just go and make native applications.[/QUOTE]

No need to get defensive, and the fact that I dislike the CURRENT state of HTML5, does not change the fact that C2 it's an amazing tool and that I love working with it. So, no, I'm staying. :)
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Fri May 04, 2012 8:04 pm

Hi all,

The issue is solely to do with graphics card drivers. It is a technical issue and nothing to do with anyone trying to force you to buy a new computer. The problem is manufacturers not letting you use the latest graphics card driver. Then, because many old drivers crash all the time, browser makers block any drivers that are unstable to ensure your computer does not crash while browsing the web. This means you get software rendering and the game will run very slowly.

For background, read these two blog posts:
Graphics card drivers: a lesson in software engineering

Introducing the graphics driver updater utility

If you experience poor performance in a HTML5 game, the very first thing you should do is update the drivers! Try using that updater utility to help you. This will fix the problem a lot of the time.

WebGL is consistently faster than Canvas 2D in our benchmarks. However, Chrome 18 has recently thrown a spanner in the works. They introduced "Swiftshader", a software renderer for WebGL. This has totally screwed us over, because when starting a game, we do the following:

1. Try to create a WebGL renderer.
2. If that fails, create a canvas 2D renderer instead.

This used to work, because WebGL would always be hardware accelerated and if it was not available it'd just use canvas 2D instead, which might be hardware accelerated. However now in Chrome 18 it always succeeds in creating a WebGL renderer - half the time, it'll be a crappy slow software renderer - and never uses the canvas 2D, which might have been hardware accelerated!

I'm actively trying to push for there to be some way to detect software-rendered WebGL so we can fall back to canvas 2D. However it's still a work in progress. I'll keep pushing and see if I can get them to do anything. In the mean time you may want to disable WebGL.

I'm also considering automatically disabling WebGL in Chrome for the time being. Do you think that would cause more problems than it fixes, though?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri May 04, 2012 10:35 pm

I think developers should just add WebGL as an option in their games, as of now. That way people with newer tech can experience WebGL if they want. Hopefully Chrome will find a better way to deal with WebGL soon.

I'm on a older work computer right now, but I've tested WebGL on the dev channel for chrome 20.0.1123.4 dev-m and it still seems to be using a painful software render script.

However on Chrome 20.0.1126.0 canary, it just defaults to canvas2d accelerated, it seems. I'm not sure if a test determined I cant Run WebGL and just skipped it, or if they just have it disabled completely. Good thing you added the fallback to Canvas2D. It seems WebGL content with no fallback result in a blank screen on this computer.. No warnings or anything. I'll have to do more testing when I get home. Link to canary below.

http://www.chromium.org/getting-involved/dev-channelDoverseer2012-05-04 22:42:08
B
14
S
1
G
1
Posts: 16
Reputation: 1,805

Post » Fri May 04, 2012 10:54 pm

[QUOTE=VampyricalCurse] Fascinating... I must be missing something in my own post because 1) I don't see where I mentioned M$ or ANY company. [/quote]
Indeed you didn't name a specific company, you mentionned "It really seems HTML5 is trying to make everybody buy new computers, which is ridiculous. [...] As of now, all of this mess with HTML5 seems like the usual: Corporate stupidity."
Corporate stupidity, once again the great threat of ber-companies that want to dominate the world and take all your money, etc...

This discussion already happened several times over the forum and generaly degenerates and ends up in closed threads.
I must admit I saw red and misread your original post, and mixed up the following discussion with wink and Metal_X (yeah Adobe will try to slow down HTML5 development... how could they, seriously ? what grasp do they possibly have on this issue ? This bit of the discussion is pure speculation, for the sake of nay-saying imo.)

Anyway, I went ahead of myself and went more personal/emotional/angry in my answer more than I should have.
@VampyricalCurse: I apologize for that.

Ashley cleared the issue (as I tried a bit too by mentioning also the post about drivers), it's not a conspiracy it's lazyness on the part of some driver vendors.


[QUOTE=VampyricalCurse] I don't expect a modern HTML5 or even a native modern EXE game to run on a 90's computer, however computer from at least 2005 should be able to run HTML5 like they run EXE. We are talking about 2D game here for crying out loud. Maybe they will, but will it be too late for HTML5 before then? Nobody can tell and I hope not.[/quote]

In 2005, DX11 and HTML5 didn't exist.
You don't expect your 2005 machine to execute DX11 but you expect it to execute HTML5.
Despite the very fact that it relies on browsers (and so already occupies a fair amount of CPU/RAM ressources) and that it has to go through the graphic card process (once again, an integrated graphical chipset is not the same as an ATI or Nvidia child-board) or be calculated directly by the CPU (which already calculates the flash video/game/ads you're buffering/streaming, your opened webmail page, and a bunch of other web applications without counting the browser's extensions and the desktop's widgets and the peer to peer software).
This + this + that, in the end, despite the 2D aspect of the graphics, there are tons of operations going on.
And gear that is not originaly optimized/designed to support so many operations and that doesn't get decent drivers can't be expected to cope with this.

Computers have always been like this. In a 6 months span, the previous "generation" of CPUs and graphic cards were rendered almost obsolete.
All the 90's were so, and beginning of the 2000's too.
This past years, it can appear to stabilize, but that's still not the case. (we've gone from pentium to quad core and more, that's an incredible step further in power, but also a requisite for decent HTML5 performances)
2005 was 7 years ago. Computers are not living room consoles, if you want to stay in the "now" of gaming, you need to invest in better gear regulary, you can't expect your gear to last 10 years and be able to cope with the software novelties.

You can blame all the misery in the world, at some point it's the user's responsability to be properly equiped too.
Computers from 2005 won't last another 5 year anyway (at least not for current and "then" games). Some people won't update and stay on "old software/hardware" (kinda like people still using windows 95 when XP has been released for years (?)). Others will do the expense at some time (buying a brand new computer for the family) an affordable more modern computer that will handle some of the most recent technologies (pro tip: apple is really expensive for what it is).

Poor people, rich people. In the end it doesn't matter, people who're interested in playing the games the more comfortably possible will take the extra step to update and buy hardware.
They'll save for months and invest for years to come.
I don't have a smartphone, but I have a decent computer, it's a matter of priorities I guess.

And so, rest assured HTML5 games work fine on computers that can run BF3 in high details, so now all that is left for C2 users is to make games that those players will enjoy playing.
Kyatric2012-05-04 22:56:50
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat May 05, 2012 2:10 am

So having WebGL as an Option, building two versions (one with WebGL and one without), and then merging those to use the same resources - Does anyone think this is a good idea or practice to implement? If not, why?Doverseer2012-05-05 02:11:07
B
14
S
1
G
1
Posts: 16
Reputation: 1,805

Post » Sat May 05, 2012 2:22 am

@Ashley - What about a way that we could switch rendering modes at runtime via events? That way we could do a check for if the frame rate is really low with web GL, then we could switch to canvas 2D instead. Is that sort of thing possible, or does it have to be done at the start when the page loads?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sat May 05, 2012 2:56 am

@Doverseer, @Arima: WebGL is always faster when hardware-accelerated, so I think the only case you'd get better performance is when Chrome is using SwiftShader and you switch to Canvas 2D.

In the next release I've added some code to try to detect SwiftShader and fall back to canvas2D if it's being used. This should hopefully resolve the problem, so there should be no need at all to build two versions of your project. However, since Chrome doesn't specifically reveal if SwiftShader is being used, I had to add some hacky detection based on OpenGL detections. It may have false positives and disable WebGL on hardware-accelerated systems, but then they will almost certainly have a hardware-accelerated canvas 2D, so performance will still be good. That's a better result than having some users get totally unusable performance, so we can live with that. Wait for the next build and let me know how things go.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat May 05, 2012 3:18 am

@Kyatric
Yeah, i know that's pure speculation, and i didn't say that it is not.
But don't belive such things can happen is really naiveness.
I know a ton of corporations that "destroyed" others for preventing competition, there are many diseases or other genetic problems (like baldness) that already have a cure or a better treatment but are not revealed because the actual treatment is more profitable and many other things that happen because corporation stupidity.

I assume that i really don't know who can Adobe or any other company delay HTML5 dev, but for me it's really strange the number of problems and the slow development of this technology.
And stay clear that it is my opnion!

Edit:
"Click the star to the left of the title "Issue 126345:     SwiftShader causes unplayable performance for 2D HTML5 games"
Done!Metal_X2012-05-05 03:42:33
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Sat May 05, 2012 3:22 am

All involved: please star this issue I submitted for Chrome to show your interest:

https://code.google.com/p/chromium/issues/detail?id=126345

Click the star to the left of the title "Issue 126345:     SwiftShader causes unplayable performance for 2D HTML5 games".
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot], zenox98 and 14 guests