Work in progress, caveats:
- sort happens just inside one ParticleSystems, so everything gets messed up when more ParticleSystems are in the same screen space
- not yet solved proper order of operations, if you change object transform, you need to update ParticleSystem object matrix manually before rendering (so that sort works, otherwise it will use transform from previous frame)
Also fixed transparency in fog and did small optimizations in WebGLRenderer.
rotation/scale matrices if needed (if no rotation, no need t compute); and (3) no longer require
storage of translationMatrix or scaleMatrix (1 per object). Uses a single tmpMatrix instead.
No need to stuff them in different bucket, line-specific stuff is anyway done in `renderBuffer` method.
This was prompted by starting with implementation of ParticleSystem. It would be unwieldy to handle three different buckets of objects / buffers.
As expected, performance of one-to-one conversion from CanvasRenderer was horrible, so I had to change a bit how lines are handled.
Line object now has "type" property:
- default type is "THREE.LineContinuous" which should behave as before: geometry represents one continuous line (v0 ... vn)
- new option is "THREE.LinePieces" which tells renderer that geometry represents collection of individual line segments (v0,v1) ... (vn-1, vn)
(one Line object corresponds to one VBO)
(same limitations as with meshes - once VBO is baked, no changes are possible except object transforms - scale / rotation / position)
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
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