For some reason it doesn't work with the current Chrome canary (10.0.607.0) when using ANGLE :(.
Also OBJ converter demo is having problems with generated tiled texture in latest canary, so it looks like some bug was introduced in ANGLE's handling of UVs (baked AO relies on "zoomed" UVs).
Need to investigate more, maybe file a bug report.
WebGLRenderer2: Trying to re-create WebGLRenderer from scratch... Creating a program per material instead of just one for everything. Seems to be 3x faster by now...
A lot of things going on in this commit:
- added tangents computation for geometries
- mesh must have UV coordinates
- to be called explicitly once geometry is loaded like this: geometry.computeTangents()
- tangents are stored in Vertex objects
- quads are not solved properly (though workaround hack seems to work at least somehow, as far as each vertex appears at least somewhere)
- extended VBOs in WebGLRenderer to include tangent streams (when available)
- added "normal" shader to ShaderUtils (to be used with MeshShaderMaterial)
- Blinn-Phong with one directional and one point light (7 varyings gone, just one spare)
- normal maps are in tangent space
- displacement maps use simple luminance value (could be changed if better precision is needed)
- displacement mapping uses vertex texture fetch
- this requires GPU with Shader Model 3.0
- not currently supported in ANGLE
- for this, added "supportsVertexTextures" method to WebGLRenderer API, so that application can handle this
Firefox doesn't like Typed Array constructors without explicit sizes.
Also in Firefox there were some weird artefacts in Perlin noise when using Int8Array (patterns were repeated across diagonal lines).
For this extended Cube primitive with "sides" parameter.
You can use it to switch off cube faces like this:
var cube = new Cube( 100, 100, 100, 1, 1, materials, false, { ny: false } );
Default is all six faces on => { px: true, nx: true, py: true, ny: true, pz: true, nz: true }
As suspected, this was caused by incorrect shader state management when switching between multiple shaders (thanks Firefox for verbose warnings).
Also, testing WebGL performance is very tricky. You can get different performance depending on the state of browsers / system (messed up state can be 10-66% slower):
1. freshly started Chrome can be much faster than Chrome that already ran few WebGL demos (which are now closed)
2. demo opened in new Chrome tab can be faster than demo reloaded in the same tab
3. even demos opened and closed in Firefox can slow down Chrome demos
This suggests that browsers do not clean GPU state properly :(