This should allow attaching of lights to objects. As a side effect, directional lights positions don't need to be normalized explicitly anymore.
Also changed viewport dimensions passed to render plugins to work with render targets with different dimensions than the screen framebuffer.
And fixed new dependencies in build script.
Also some refactoring in plugins.
Still not really satisfied with a solution, will need to handle somehow ordering of plugins (both among them and with respect to rest of rendering, this would be needed for example to be able to redo shadow maps as a plugin).
Hope so. There is now just a single scene graph update per frame render (plus some extra one-shot updates if light cameras are auto-added to scene graph).
It was quite a pain - ArrayBuffers / Typed Arrays are fussy about byte alignment - but seems to be worth it.
Parsing times are down (modest gains for small objects / Firefox, bigger gains for large objects / Chrome, performance gains from 10% - 200%).
Also as a positive side effect, changing interleaved face arrays into uniform arrays seems to have helped a bit with gzip compression (about 6% smaller size for gzipped 526K Lucy).
Work-in-progress => do not merge yet.
OBJ converter, JSONLoader, BinaryLoader and some examples are done. Still need to do Blender exporter, SceneLoader and more examples.
Advantages:
- faster parse times
- bypass array initializer size limit in Firefox
- no more crashes in Chrome 15 (caused by too many concurrently active workers)
Disadvantages:
- more browser UI freezing
- multiple models tend to appear all at once with the last one (instead of popping up progressively)
Removed LOD text example. I think LOD example is good enough.
Ubiquity test working again.
Tweaked README to show the new pattern (Scene first thing created).
I had to resurrect parts of old code (keeping track of scene graph changes).
Good news: performance is great, new scene graph gains compound with buffers optimizations and non-array materials refactoring. Together we gained about 15% for rotating cubes performance test (pushing max to 2650 cubes at 60 fps).
Still broken with new scene graph: lod, skinning, collisions, AnaglyphWebGLRenderer, ParallaxBarrierWebGLRenderer, multi-canvas circle example.