Why you should use WebGL


There is (among graphics enthusiasts) a lot of debate what API/version of something to use with a bunch of hotly contested alternatives. I would like to convince you to give WebGL a try. and this blog post explains why. It will also quickly summarize a few things people usually ask about WebGL. There are many gotchas (like with anything) as well, and I am aware of a lot more of them than you can imagine. I will perhaps talk about them in another blog post.

A Japanese translation can be found here courtesy of Akihiro Oyamada


What is WebGL?

WebGL is an implementation of OpenGL ES 2.0 for the web. You program it in Javascript (which is not Java).

Does this run without OpenGL?

Yes WebGL can run without OpenGL. There is a compatibility library called Angle which translates WebGL Shaders to either:

  • Desktop OpenGL GLSL (on Linux and OSX)
  • Mobile OpenGL ES 2.0 ESSL (on android and blackberry)
  • Direct3D 9 HLSL (on windows)

WebGL API calls are also translated:

  • Desktop OpenGL (each browser supplies his own wrapper for that)
  • Mobile OpenGL ES 2.0 (just a pipe trough)
  • Direct3D 9 API (Angle provides a wrapper for that)

Does it run on my favorite browser?

Browsers that support WebGL :

  • Desktop Chrome
  • Desktop Firefox
  • Desktop Safari (on OSX, need to flip a flag )
  • Desktop Opera
  • Mobile Firefox for Android
  • Mobile Chrome Beta for Android (need to flip a flag )
  • Mobile Opera for Android
  • Firefox OS builtin browser
  • Blackberry builtin browser

Browsers that do not support WebGL :

  • Internet Explorer
  • Desktop Safari on Windows
  • Mobile Safari (iOS, iPhone, iPad etc.)
  • Opera for iOS
  • Builtin Android browser

Does it run on my favorite platform?

If a platform works or not depends a bit on driver versions, OS versions and other factors. This is known as a Whitelist/Blacklist .

There are however platforms where WebGL will not run no matter what:

  • Windows on ARM (surface etc.)
  • Windows Phones
  • Windows 8 Modern UI
  • iOS (iPhone, iPad etc.)

This is because Microsoft and Apple have not implemented WebGL and they dissallow other browsers for these platforms. You might find this perplexing since you can find other browsers in these devices App-Stores. However these browsers are just different decorations for Internet Explorer or mobile Safari engines, and unless a browser can make his own engine, WebGL cannot be supported.

So how many people is that?

That is not easy to say. However I have introduced a WebGL statistics platform to answer that question. As of February 2nd 2013 the numbers are:

Data is assembled from over 13 million visits on over 530 participating sites over the last 60 days.

Note that in the last 30 days, Mobile support increased by 2% up from 4% for mobiles. That's huge progress (50% increase)! Mostly that's thanks to the Chrome Beta for android that finally supports WebGL per flag.

It is the easiest 3D API to use

If you write 3D applications you might know all the boilerplate setup and code you need to write just so you can start to do anything. People like John Carmack have complained about this. Well lucky for you, WebGL is not (much) like that.

Source: codeflow.org

Category: Bank

Similar articles: