提交 d1e8efae 编写于 作者: A aardgoose

use new hash value

上级 55d8eb49
......@@ -1463,20 +1463,10 @@ function WebGLRenderer( parameters ) {
releaseMaterialProgramReference( material );
} else if ( lightsHash.stateID !== lightsStateHash.stateID ||
lightsHash.directionalLength !== lightsStateHash.directionalLength ||
lightsHash.pointLength !== lightsStateHash.pointLength ||
lightsHash.spotLength !== lightsStateHash.spotLength ||
lightsHash.rectAreaLength !== lightsStateHash.rectAreaLength ||
lightsHash.hemiLength !== lightsStateHash.hemiLength ||
lightsHash.shadowsLength !== lightsStateHash.shadowsLength ) {
lightsHash.value !== lightsStateHash.directionalLength ) {
lightsHash.stateID = lightsStateHash.stateID;
lightsHash.directionalLength = lightsStateHash.directionalLength;
lightsHash.pointLength = lightsStateHash.pointLength;
lightsHash.spotLength = lightsStateHash.spotLength;
lightsHash.rectAreaLength = lightsStateHash.rectAreaLength;
lightsHash.hemiLength = lightsStateHash.hemiLength;
lightsHash.shadowsLength = lightsStateHash.shadowsLength;
lightsHash.value = lightsStateHash.value;
programChange = false;
......@@ -1584,12 +1574,7 @@ function WebGLRenderer( parameters ) {
}
lightsHash.stateID = lightsStateHash.stateID;
lightsHash.directionalLength = lightsStateHash.directionalLength;
lightsHash.pointLength = lightsStateHash.pointLength;
lightsHash.spotLength = lightsStateHash.spotLength;
lightsHash.rectAreaLength = lightsStateHash.rectAreaLength;
lightsHash.hemiLength = lightsStateHash.hemiLength;
lightsHash.shadowsLength = lightsStateHash.shadowsLength;
lightsHash.value = lightsStateHash.value;
if ( material.lights ) {
......@@ -1661,12 +1646,7 @@ function WebGLRenderer( parameters ) {
material.needsUpdate = true;
} else if ( material.lights && ( lightsHash.stateID !== lightsStateHash.stateID ||
lightsHash.directionalLength !== lightsStateHash.directionalLength ||
lightsHash.pointLength !== lightsStateHash.pointLength ||
lightsHash.spotLength !== lightsStateHash.spotLength ||
lightsHash.rectAreaLength !== lightsStateHash.rectAreaLength ||
lightsHash.hemiLength !== lightsStateHash.hemiLength ||
lightsHash.shadowsLength !== lightsStateHash.shadowsLength ) ) {
lightsHash.value !== lightsStateHash.value ) ) {
material.needsUpdate = true;
......
......@@ -117,7 +117,8 @@ function WebGLLights() {
spotLength: - 1,
rectAreaLength: - 1,
hemiLength: - 1,
shadowsLength: - 1
shadowsLength: - 1,
value: 0
},
ambient: [ 0, 0, 0 ],
......@@ -331,19 +332,32 @@ function WebGLLights() {
state.ambient[ 1 ] = g;
state.ambient[ 2 ] = b;
state.directional.length = directionalLength;
state.spot.length = spotLength;
state.rectArea.length = rectAreaLength;
state.point.length = pointLength;
state.hemi.length = hemiLength;
state.hash.stateID = state.id;
state.hash.directionalLength = directionalLength;
state.hash.pointLength = pointLength;
state.hash.spotLength = spotLength;
state.hash.rectAreaLength = rectAreaLength;
state.hash.hemiLength = hemiLength;
state.hash.shadowsLength = shadows.length;
var hash = state.hash;
if ( hash.directionalLength !== directionalLength ||
hash.pointLength !== pointLength ||
hash.spotLength !== spotLength ||
hash.rectAreaLength !== rectAreaLength ||
hash.hemiLength !== hemiLength ||
hash.shadowsLength !== shadows.length ) {
state.directional.length = directionalLength;
state.spot.length = spotLength;
state.rectArea.length = rectAreaLength;
state.point.length = pointLength;
state.hemi.length = hemiLength;
hash.stateID = state.id;
hash.directionalLength = directionalLength;
hash.pointLength = pointLength;
hash.spotLength = spotLength;
hash.rectAreaLength = rectAreaLength;
hash.hemiLength = hemiLength;
hash.shadowsLength = shadows.length;
hash.value++;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册