Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Experimenting with WebGL...

  1. #1

    Experimenting with WebGL...

    Runs anywhere under Chrome 18+ (will fallback to software if hardware acceleration is not available)
    Runs under FireFox if you have good enough drivers (DirectX or OpenGL)

    On Android, it runs under FireFox Mobile & Opera 12 on my HTC Desire.

    Height field & its normals are computed at runtime from JS, haven't benchmarked the thing in detail, but I'm under the impression Chrome & FireFox both JIT the maths code fairly well.

    WebGL isn't ready for high framerate games just yet (other things in the browser can make it stutter for one), and things are missing from the immersion POV (mouse capture, full-screen...) but for games with less ambitions and more static graphics, it is coming close to good enough

  2. #2
    I have done some experiments with webgl some time ago. it was very buggy and worked only in chrome at the time, but it's obviously getting better now that firefox and opera support it.

  3. #3
    Both your snippets works on Android too under FireFox & Opera, with Opera having the edge.
    The skinned mesh is obviously too much for my paltry phone gpu :/ but particles runs at a good frame rate.
    They run on Web TV too.

    I've been following the W3C & Khronos groups: Mozilla, Google and Apple are all pushing new standards, so it's just a matter of time I guess until the missing bits for game-oriented usage become widely available (full-screen, mouse-capture, audio API etc.).

    Once/if Apple enables WebGL in iOS 6 for widespread usage, that could be a game changer, so to speak.

  4. #4
    it will never be as fast as the native compiled executables though, which is why I decided to use fpc for cross platform game development. but you are right, for the small in-browser games this technology is starting to look very attractive.

  5. #5
    Quote Originally Posted by Dan View Post
    it will never be as fast as the native compiled executables though.
    It depends on the problem and what is used to compile the native executables, f.i. on pure maths like the Mandelbrot set, FireFox and especially Chrome were giving Delphi XE2 a good sweating a few months ago:

    FreePascal was in the same ballpark as Delphi, but I haven't tried since, it would be interesting to see if it has since caught up with the JS engines.

  6. #6
    WebGL and HTML5 aren't designed to compete against native compiled code. However, Webgl and HTML5 offer something that neither delphi or fpc can and that is that the code is running in a browser. At work we are biting the bullet and moving away from Delphi apps and we will be doing HTML5 apps from now on for our in-house business requirements and our education/games software.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  7. #7
    one major problem with these apps: they are hard to sell since all the source code is open.

  8. #8
    You can't stop people from reading your JavaScript, so consider that part of the game open-source. You can use obfuscation to make it difficult. Design your game in such a way that seeing that code won't matter. Mostly this is done by only implementing the user interface, visuals, and sounds on the client-side; everything else in the game is done on your server and communicated between the client and server using AJAX techniques.

    Also have a look at phonegap, I haven't used it but it takes html5 code and makes native apps for various phones etc

    Here is a small demo of obfuscation

    I would hate to have to reverse engineer a significant program
    Last edited by czar; 31-05-2012 at 02:10 AM.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  9. #9
    Quote Originally Posted by czar View Post
    WebGL and HTML5 aren't designed to compete against native compiled code.
    Well that's changing, Google ChromeOS, MS Metro, node.js, that FireFox mobile OS and the direction of new Html5 specs, they are step by step being pitted against native code.

    And Dan, there are tens of thousandths html5 apps getting sold, wrapped with phonegap or other similar homemade browser apps. For some the HTML shows through, for the well done ones, you can't tell them apart from the user point of view.

    Obfuscation as Czar pointed means that even though you get the code, you can't do much with it, you certainly can't reuse it without an effort that is as high or higher than writing it yourself anyway, especially when before obfuscation, the js went through an optimizer or smart-linker.

  10. #10
    I have started porting my game engine to smart mobile studio and it is looking very promising:
    only around 30 minutes to port the code. which could be reduced to 10 if sms supported operator overloading and some sort of non class typecasting (but apparently that's not possible).
    Last edited by Dan; 20-01-2013 at 05:33 PM.

Page 1 of 4 123 ... LastLast


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts