UPDATED POST HERE: http://granular.cs.umu.se/browserphysics/?p=7
SceneJS, Three.js and PhiloGL are three great scenegraphs for WebGL. But how well do they perform?
I did a small test to get some ideas on how well these softwares scale. What I did was a small application rendering N cubes, moving in a circle.
We can see that the FPS drops down below 60 around 600 cubes for Three.js and SceneJS. The corresponding number for WebGL without a scenegraph is 1000, and for the non-browser OpenSceneGraph (C++) it’s 3000.
Conclusions: We get a performance drop (~66 percentage units) when moving from OpenGL to WebGL. When using a scenegraph, we drop even more (80). I guess the web is not ready for heavy 3D graphics yet.
Usage notes: All of the scenegraph libraries have nice APIs. I like SceneJS the most because of its JSON-like API, it is very easy to learn because you can acutally see the scenegraph tree in the code. Three.js has got another type of API which is similar but uses no JSON. PhiloGL seems to me like some extra functions that helps you use native WebGL, the WebGL interface is not 100% encapsulated which makes it a bit harder to learn.
Tech notes: The tests were made using a desktop machine with an Intel i7 quadcore 2.8 GHz processor and 8Gb RAM. The operative system used was Ubuntu 10.04 (Lucid). The web browser used was Chromium 15 (I tried Firefox 6.0 also, its performance was about the same). When making these tests, I tried to cut down on the instanciations as much as I could to get more performance. The non-scenegraph test was made with pure WebGL with the support from and .
Nice – which version of SceneJS did you use? V2.0 will be much faster than V0.8..
cheers,
LK
I used v0.8. Thanks for the input – I will probably remake this test with v2.0 and also include a couple of other WebGL scenegraph libs. I’m impressed by SceneJS, it’s great! Good job 🙂
Thanks! You should profile OSGJS as well – a port of OpenSceneGraph to JavaScript – likely to be very fast: http://osgjs.org/
Maybe I will – depends on where my current project is going now though. Btw, I think that you may find my Browser Physics blog more interesting, it contains an updated version of this post: http://granular.cs.umu.se/browserphysics/?p=7
Do you have the benchmarks online somewhere? Would be cool to try it out and get a feel for the numbers!
Yes, at least a part of them. You’ll find links to the live tests here, though they are quite “static”. As it is now, you must download all code to be able to change the number of rendered objects… http://granular.cs.umu.se/browserphysics/?p=7
Also, might be nice to try it in different browsers…