Removed diffuse color influence on ambient term in Phong. This was causing texture disappearance when diffuse color was black.
Made Lambert more similar to Phong: now it also has ambient color parameter. Before ambient light was affecting Lambert as if ambient color was always 0xffffff.
Lots of code got cleaner with seconds, seems we used them before all around.
Also changed examples that didn't need deltas to simple Date.now() plus some more examples cleaning, trying to get rid of obsolescence warnings.
Apparently iterating over object properties is dangerous even if that code path is not executed.
Stress-testing particles buffers setting showed 60% performance increase (in Chrome) even when there were no custom attributes (and thus custom attributes handling code behind "if ( customAttributes )" was never executed).
I suspect this may be caused by some V8 optimization heuristics.
Got tired of redoing deltas all the time. Not sure about API or implementation details, but so far seems to be useful.
In future, we could for example have clocks that are slower / faster than realtime, or fixed step based.
This is for being able to render shadowmap just once per frame - all dynamic cubemap faces and full scene can share the same shadowmap (at least until we don't have camera-specific fine-tuned shadowmaps).
Finally, the trouble was at the application level: renderer.clear clears the current framebuffer, which, if you juggle multiple render targets, doesn't have to be necessarily the screen. Here it was the last face of cube render target.
Before lighting was messed up in dynamically generated cube maps.
Dynamic cube maps need to have flip uniforms (flipEnvMap / tFlip) set to 1, static cube maps to -1 (default).
For standard materials this is handled automatically, it's just something to be aware of when using cube maps in custom ShaderMaterials (dynamic and static cube maps have different cube face orientations, dynamic ones are correct, static ones need flipped x-axis in lookup vector).
There is still mystery of disappearing last cube face (negative-Z) and weirdly clipped objects in cars demo (works ok in simpler test).