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
Old version was doing massive overdraw (whole mesh was drawn for each material).
Even current solution is still quite messy: there is a different behavior for stroke and fill materials (when used as secondary materials).
Stroke materials are applied to the complete mesh (as most common use case seems to be wireframe) while fill materials now apply only to faces within single material group (when "decalIndex" property of secondary fill material is set).
There were two problems:
- vertices were in a different coordinate system than normals
- generated JS code was not properly handling normals with 0-sized components
Changed mesh JS class name generator in Blender exporter to use cross-platform path parsing.
Old version was generating broken class names on Windows (full path was included).
For decals you need to set "decalIndex" property of the material (corresponding to materials index of the original mesh UV material).
Added multimaterials example.
Fixed forgotten sphere smoothing in OBJ converter example.
Added OBJ converter test example.
Modified Three.js to handle converted models:
- extended WebGL renderer to use texturing
- broke down model into multiple VBOs according to materials
- textures are lazy created when images get loaded
(converter takes care of resizing images to nearest power of 2
dimensions using 2d canvas)
- changed material array semantics in Mesh object
- before: multiple materials were applied to all faces (broken in WebGL, needs multitexturing shader)
- now: there is only single material per face, but one mesh can have faces with different materials
- added per vertex normals (to get smooth shading in WebGL)
* `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
* `Particle` now use `ParticleCircleMaterial` instead of `ColorFillMaterial`
* `Particle.size` > `Particle.scale.x` and `Particle.scale.y`
* `SVGRenderer` currently out of sync
Added THREE namespace
Camera.x -> Camera.position.x
Camera.target.x -> Camera.target.position.x
ColorMaterial -> ColorFillMaterial
FaceColorMaterial -> FaceColorFillMaterial
Materials are now multipass (use array)
Added ColorStrokeMaterial and FaceColorStrokeMaterial
geometry.faces.a are now indexes instead of links