There don't seem to be any effects on performance (though I'm not sure this was actually used in any example/test code path - so far quaternions are used just for animation interpolation and even there they were always dirty, and also just updated during JIT baking).
Also some more code cleanup - no need for Mesh to have own "update" as now it was exactly the same as its parent Object3D.
- 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.
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)
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