WebGL

0 favourites
  • <img src="http://upload.wikimedia.org/wikipedia/commons/3/39/WebGL_logo.png" border="0">

    <font size="5">Its Great... But DON'T enable it from Configuration Settings yet, and here's Why..</font>

    Provide WebGL as an OPTION!

    WebGL is awesome it really is, when things are working properly. But (because of crappy video drivers and/or hardware) some Computers will render the WebGL content, but it is painfully SLOW and therefore the game isn't really playable, <font color="red">Resulting in a Closed window or Backspace - LOSS OF POTENTIAL LONG-TERM FANS OF YOUR GAME!!!!</font>

    So what can be done for Computers that can run WebGL, but really shouldn't be?

    1. Regular Website:

    If you have your own website a work around is easy. Build 2 versions (one with WebGL, another without). Have a start screen where the Person can also choose a button "Enable WebGL" which will open the URL using the browser object to where the WebGL version is (Open URL - "http://mydomain.com/game/webgl.html"). If it is slow they can simply backspace and choose to Play the Regular (canvas2D) version. Or on the start page, some type of testing can be done to determine if it can run GOOD WebGL, if not it will go to a page on your site where the Regular version is.

    <img src="http://darren.netne.net/images/webgloption.PNG" border="0">

    The Game is compiled twice (without WebGL and with it) into separate directories. Then we just rename the c2runtime.js file and index.html from the WebGL build to webgl.html and webgl.js. Then copy these 2 files where the regular version is. Make sure you change the source of webgl.html to reference webgl.js instead of c2runtime.js. Now there will be no loading time between switching webgl and canvas because they will both be using the same source directories for images and media - which will already be loaded into cache memory.

    2. Game on the Arcade:

    I have not done any testing. I do not know a work around, other than the icon trick mentioned below. Anyone have any suggestions or methods?

    3. Chrome Web Store?

    I have not done enough testing, I will report my results soon. In theory you should be able to use a method similar to 1. Regular website, but instead your Open URL action to your WebGL version would be something like "chrome-extension://YOURAPPID/webgl.html" if you are exporting a Packaged App.

    4. Other Exports.

    More testing needs to be done. Feel free to help.

    I tested a WebGL game on my friends computer and It was so painful to watch!, because of the above mentioned problem. I updated their driver, but it was still painful to watch. So I just disabled WebGL in Chrome using --disable-webgl on the chrome icon, and the game ran perfect under canvas2D. But most people who just want to play a game on the internet, wont think to change any icon settings; they will just close the page if its painfully slow. WebGL will continue to get better as time goes along. Maybe one day Chrome will give a message "Your computer isn't running the WebGL content well, Click OK to switch to 2D mode." which then will disable WebGL on the tabs process.

    Example:

    Edited Space Blaster Demo

    Edited Space Blaster Demo Source:

    Edited Space Blaster Source

    Note: The example is on a free web server, so i apologize if you get a server busy message.

  • It is funny you just brought this subject up Doverseer. I have a perfectly good laptop that is only 2 years old but unfortunately like 90% of the PC's out there Firefox has blacklisted my graphics card.

    Over the last few months I have been experiencing many weird browser performance issues with every update from every browser vender. For example Google Chrome with WebGL enabled games started to run slower than the same game with canvas 2d. Also canvas 2d games started to get slower with each new update. Since the new Firefox 12 update this week canvas 2d games started running so slow that they are now unplayable in Firefox. I couldn't even play a game on the arcade without my browser freezing, and crashing. This is not just limited to games but also websites. It is like all of the browser venders are trying to force us to buy new PC's. If you try to contact a browser vender about this they just say update your drivers, or you got a crappy graphics card. That is if they respond to you at all. If your drivers are all up-to-date, and if you got a graphics card that is fused to your mother board you cant change it.

    Anyway, this has all pissed me off. I can't afford to buy a new PC right now so I did some searching, and found a solution. This could destroy your computer so I wouldn't recommend doing this especially if your PC is still under warranty because it will then be void. But if your PC is not under warranty, and to use the internet your only other alternative is to buy a new PC then you have nothing to loose by trying this.

    First start up your Firefox browser, then type about:config in Firefox�s address bar and make the following changes:

    1. To enable WebGL, set webgl.force-enabled to true.

    2. To enable Layers Acceleration, set layers.acceleration.force-enabled to true.

    3. To enable Direct2D in Windows Vista/7, set gfx.direct2d.force-enabled to true.

    Then cross your fingers, restart Firefox, and try running a WebGL application.

    By doing this I have increased my Firefox browser performance by over 250% in canvas 2d, and now WebGL works with Firefox. Also all other browsers Chrome, IE9, Opera, and Safari are preforming much faster. I just hope my PC lasts long enough for me to save up for a new one.

    Like I said I was left with now other choice because of the browser venders latest updates my PC became useless. But now everything runs great once again.

    This is all a real shame that this is happening because the majority of people in this world wont buy new PC's. So I am starting to wonder were this is going to leave us as html5 game developers. The future looks expensive for everyone.

  • Wink: Yeah, I mentioned on a post a while ago that I believed HTML5 it is not older computer friendly (poor people friendly). This is a great handicap when it comes to gaining audience for yer game. It really seems HTML5 is trying to make everybody buy new computers, which is ridiculous. Sure, there are oafs out there who will, but that's a minority. I am not working on my game yet (working only on assets) because I am following what's going on with HTML5 closely. Also, I did mention the disadvantage and the bull crap involved on depending now on browsers devs. to do their job right, as if we didn't depend on enough pricks already. As of now, all of this mess with HTML5 seems like the usual: Corporate stupidity. Really hope they get their stuff together because if this is done right, there is a lot of potential. But as things stand right now, native is still winning, by far.

  • "As of now, all of this mess with HTML5 seems like the usual: Corporate stupidity."

    I really think that Adobe will do everything to slowdown HTML5 development to try preventing Flash to become useless.

    Do you know any proofs about that?

  • I have no idea if Adobe is doing anything to slow down HTML5 dev., but good point. I would not put it past them in the least.

  • HTML5 is still young

  • you got it so right. Sorry I missed your post about this. I try to read everything here just because you never no when you might miss a shy smart members moment of pure life changing brilliance hidden someplace in a thread. lol

    This is all so typical you got the financially elite, trying to make one more money grab. It's like back in the day Microsoft got it right the first time before Corporate money got involved, and decided to bug the system so that we would not only have to depend on them for constant security updates but also the need for antivirus software.

    I really thought html5 was going to be the little persons chance (poor persons chance) lol :D to start up a small operation. It is impossible to make a native cross platform game by yourself with little money.

  • I have updated the Post with examples of a good way - Just Providing WebGL as an Option.

    If HTML5 were to get the performance of a Native App, allot of work would have to go into the Security Design of the browser. But I can see it happening soon or at least getting better.

  • Is this all just Firefox? Is anyone have problems with Chrome, Safari, or Opera? I run a lot of "old" netbooks and I haven't noticed any problems. Firefox is definitely going their own way, but if they are not cooperating with drivers, people will stop using them.

    Actually, I seem to remember that they are declining and Chrome is increasing and no one has noticed that IE has left the building. <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Wink: Integrated graphic chip on a laptop is not meant to allow to play games.

    The purpose of such "graphic card" is originaly to display office style softwares on working stations.

    To make an analogy with mechanical sports, it would be like trying to attend to a Formula1 race in a 4L and wondering why it can't compete.

    <center><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/R4_1_v_sst.jpg/280px-R4_1_v_sst.jpg" border="0"></center>

    : 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.

    You're right on one point though, HTML5 might not be suited to all. But there are enough technologies out there for you to chose from.

    If you don't like depending on browser, just go and make native applications.

    Bob Thulfram: Latest FF12 version appears to have the best performances on latest Scirra's benchmark, so you have it wrong, FF is not decreasing, and on the other hand, more and more annoying/critical bugs related to HTML5 gaming gets reported on chrome.

    Go back and read Ashley's article about graphic drivers and figure that considering the approximative quality in the graphic drivers provided by graphic cards vendor, FF is actualy protecting the end user with the blacklist.

    Go bug the drivers vendors so that they provide correct drivers instead of going the lazy way.

    I'd like to see what's Ashley's take on the original webGL/canvas2D issue though.

  • 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?

  • : 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.

    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.

    If you don't like depending on browser, just go and make native applications.

    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. :)

  • 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?

  • 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-channel

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Fascinating... I must be missing something in my own post because 1) I don't see where I mentioned M$ or ANY company.

    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.

    : 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.

    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.

    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.

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