The idea is that later there will be more loaders which would load different formats (like OBJLoader, ColladaLoader).
Usage (async JS):
var loader = new THREE.Loader();
loader.loadAsync( "obj/torus/Torus.js", function() { createScene( new Torus() ) } );
Usage (web worker):
var loader = new THREE.Loader();
loader.loadWorker( "obj/torus/Torus_slim.js", function( geometry ) { createScene( geometry ) } );
Web worker loader is useful for large meshes, where it allows browser to stay responsive for longer time and also it can handle larger meshes than async JS loader.
Web worker loader needs a simpler format of the model. Web workers can communicate with the main application only via message passing, where messages are JSON objects.
There is a new version of OBJ -> Three.js converter (convert_obj_threejs_slim.py) which can produce model in format needed for web workers.
All examples which were using models from OBJ converter were refactored to use Loader.
Except large mesh example, all examples are using just async JS loading. Web worker loading is there, it's just commented out, as it's a bit pain for local development.
Chrome doesn't allow to run web workers from pages accessed via file://, so you need either to run it with "--allow-file-access-from-files" flag, or access examples via local server (http://localhost/example.html).
Changed OBJ -> Three.js converter to use new materials system (eventual old models need to be reconverted).
Limitations:
- one use case is now much slower
- when a mesh has each face with different color (e.g. polyfield in examples/test.html)
- before this used FaceColorFill material and in WebGLRenderer it was rendered fast with color attribute array
- now when FaceColorFill material is gone, each face gets own VBO :(
- material sorting uses Materials "toString" methods for hashing, so it's very important to keep these in a good shape
In Chrome it looks more or less ok, but it has some problem in Firefox 4 (with some camera angles there are black areas around edges).
Also updated Python builder scripts and examples to include this new material.
* Removed MeshFaceColorFillMaterial and MeshFaceColorStrokeMaterial
* Added MeshFaceMaterial ( it uses the face.material for that pass )
* CanvasRenderer and SVGRenderer per face material logic changed.
* SVGRenderer supports particles again.
* WebGLRenderer currently broken :/
* Code clean up
* `CanvasRenderer` and `SVGRenderer` basic lighting support (`*ColorStroke`/`*ColorFill` only)
* `Renderer` > `Projector`. `CanvasRenderer`, `SVGRenderer` and `DOMRenderer` do not extend anymore
* Interactivity base code (hdi folder). To be refactored... ([mindlapse](http://github.com/mindlapse))
* Added `computeCentroids` method to `Geometry`
* Included `Stats.js` directly in the `/examples` folder to avoid the need of internet for playing around