|
@@ -100,12 +100,16 @@ function UniformsCache() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function WebGLLights( stateId ) {
|
|
|
+var count = 0;
|
|
|
+
|
|
|
+function WebGLLights() {
|
|
|
|
|
|
var cache = new UniformsCache();
|
|
|
|
|
|
var state = {
|
|
|
|
|
|
+ id: count ++,
|
|
|
+
|
|
|
hash: '',
|
|
|
|
|
|
ambient: [ 0, 0, 0 ],
|
|
@@ -312,8 +316,7 @@ function WebGLLights( stateId ) {
|
|
|
state.point.length = pointLength;
|
|
|
state.hemi.length = hemiLength;
|
|
|
|
|
|
- // TODO (sam-g-steel) why aren't we using join
|
|
|
- state.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + rectAreaLength + ',' + hemiLength + ',' + shadows.length + ',' + stateId;
|
|
|
+ state.hash = state.id + ',' + directionalLength + ',' + pointLength + ',' + spotLength + ',' + rectAreaLength + ',' + hemiLength + ',' + shadows.length;
|
|
|
|
|
|
}
|
|
|
|