…echanism requires modification of the WebGLRenderer for different objects. The new implementation leaves the current MarchingCubes immediate renderer intact but checks for existence of a immediateRenderCallback member function of the object. If found, that object is added to the scene.__webglObjectsImmediate array. The program, webgl context, and frustum are currently passed into the callback, putting al rendering responsibility at the implementing object. This may break the Three.js abstraction somewhat, but allows "power users" to do some funky webgl stuff while still relying on the Three.js framework for the rest of the scene...
Should not refresh anything if material doesn't change for several objects in a row (in a single frame). Hope this didn't break something, I remember this being tricky. Went through examples and they seem to work ok, gained some fps in performance test. Also disabled sorting in depth-of-field example for some more fps gain. Still didn't figure out the original reason for recent fps drop in performance / dof examples :/
Similarly like for geometry groups, iterating over object properties turned out to be bottleneck for some use cases: gained 5-10 fps in depth-of-field example (which btw for some reason got slower recently).
…e blend shader to ShaderExtras.
Hopefully this fixes several problems: - ambient component not modulated by scene ambient light - specular component not getting light colors - unnecessary opacity use in lighting calculations - unnecessary vertex shader light computation for Phong - unnecessary use of one varying in Phong
This reverts commit 285b51a.