It provides a lean way how to render TRIANGLE_STRIP primitives: needs just n+2 vertices for n triangles (one Ribbon = one strip). There are no faces, no indices, everything is rendered in one simple drawArray call.
Vertex colors are supported, normals not yet.
- removed unnecessary normal matrix computation in hierarchies (this is already done in renderer)
- removed unnecessary enabling of attribute arrays in every frame (it's enough to do it when shader program is created)
- depth test is now only set if it changed
- getters/setters are no more in Vector3
- object hierarchies thus don't use "isDirty"
- this was completely killing performance for anything that was touching a lot of Vector3 like creation of meshes and dynamic buffers
- even without this, performance of hierarchies went up (a lot)
- objects do not get passed renderer anymore
- camera was almost also removed, but this is useful for LOD (though there may be some cleaner way to do this?)
- material ids are now unified, this makes "geometry.sortFacesByMaterial" faster (thus scene init / GUI blocking is shorter)
- all WebGL examples should work now (render-to-texture has weird lights and in some camera control feels different)
- CanvasRender still broken, despite many efforts :(
- currently only points and lines work, faces don't show up. I think this may need assistance from mrdoob.
We have been very lucky - setters / getters were not supported till just 2 hours ago (so fresh, I had to build Closure myself from their repo ;).
http://code.google.com/p/closure-compiler/issues/detail?id=249
Also some refactoring plus added hackish animation offset feature.
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