Augmented Reality and WebGL

AR, and especially vision based one, has just some small but hard constraints on an accompanying 3D engine. Firstly, there should be some sort of support for video textures if we are doing vision based AR in perfection with undistorting the image etc. pp.. In my particular scenario that wasn't really necessary or a requirement. Secondly, the more pressing requirement is the usage of a transformation matrix stack that supports caching of matrices and particularly transparently supports custom matrices. That allows to optimize subtrees and is quintessential for mapping the vision based tracking to an OpenGL scene. Further, it would be great to have matrix classes or functions that support various operations, such as pre and post-mul, transpose etc. pp.

Now here we go:

  • osg.js has all of above, but it is as its larger cousin OpenSceneGraph already large. Also some parts of the engine are only working in conjunction with a node.js based backend. That is not a deal breaker but in my case was not really suitable
  • Cubic.VR was looking promising, especially as I was interested in IFC and BIM support but the truth of the matter is that lots of support in the matrix stack are hard coded. And beside that, it seems unmaintained and not well documented.
  • GLGE turned out to be an utter mess in regard of custom modelview and projection matrices. virtually no combination worked an looking at the code it became apparent why. Numerous assumptions about how to use transformations.
  • PhiloGL is one of the great one that worked right out of the box. Probably, only due to the reason it doesn't have a predefined matrix stack and allows you to feed it directly to the shaders. That makes some applications easier to handle - quick hacks with small scenes, and other hard: large scene with complex subgraphs.
  • A3 is a bit of an outsider here as it is seemingly unmaintained and not fully developed. However, the design of the matrix stack is simple and neat, something a few of the other engines should have a look at.
  • three.js became actually my favorite after some initial problems. Transformations in the scenegraph work as expected. Projection matrix can be configured. Great. Well, there are some downsides as well. For instance the loaders seem to be not maintained well and are also separate from the rest of the engine.

Update on 28.03.2013. It seems Unreal Engine is joining the carnage. Lets see later if it is suitable for AR later this year.

Just to see what this might be useful for go here.