Went through all examples, all should work.
JSON files exported from Blender / converted from OBJ files still use underscored property names internally. I don't know, should these also be changed?
Now you can add keyboard + mouse camera control with a single line, just change camera type and add parameters:
camera = new THREE.QuakeCamera( { fov: 50, aspect: window.innerWidth / window.innerHeight, near: 1, far: 10000,
movement_speed: 1, look_speed: 0.002, nofly: true, look_vertical: false } );
Thanks to mrdoob for suggestions ;)
That was much tougher than expected. No wonder other WebGL video demos around the web are broken.
Firefox OpenGL / ANGLE and Chrome OpenGL were ok, getting it to work in Chrome ANGLE was rather tricky.
Please report if something got broken. I tried to go through all textured examples but I may have missed something.
If you want to refresh texture on WebGL side, you just set "texture.needsUpdate" flag (if you use Loader or ImageUtils.loadTexture / loadTextureCube everything is taken care of).
Flag has to be set also for canvas-based textures, sorry no escaping this :(. I tried and it lead to ugly problems (e.g. AO minecraft demo mixes several asynchronously loaded and generated images into one texture, with autodetect always something was broken).
"needsUpdate" should work also on cube textures, though it's not tested yet (also there I didn't put hack for Chrome ANGLE).
build/Three.js - Includes all renderers + extras
build/custom/ThreeCanvas.js - Canvas renderer only
build/custom/ThreeDOM.js - DOM renderer only
build/custom/ThreeSVG.js - SVG renderer only
build/custom/ThreeWebGL.js - WebGL renderer only
build/custom/ThreeExtras.js - Extras only
Moved `THREE.Detector.js` to `examples/js/Detector.js`.
Updated examples to reflect these changes.
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.
I need to look at this objectMatrix::extractRotationMatrix() thing. I don't think this works like that... isn't the scale applied to the rotation in the matrix?
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.