File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 11import Node from '../core/Node.js' ;
22import { nodeObject , vec3 } from '../tsl/TSLBase.js' ;
3+ import { hashArray } from '../core/NodeUtils.js' ;
34
45const sortLights = ( lights ) => {
56
@@ -51,6 +52,29 @@ class LightsNode extends Node {
5152
5253 }
5354
55+ getCacheKey ( force ) {
56+
57+ force = force || this . version !== this . _cacheKeyVersion ;
58+
59+ if ( force === true || this . _cacheKey === null ) {
60+
61+ const lightIDs = [ ] ;
62+
63+ for ( let i = 0 ; i < this . _lights . length ; i ++ ) {
64+
65+ lightIDs . push ( this . _lights [ i ] . id ) ;
66+
67+ }
68+
69+ this . _cacheKey = hashArray ( lightIDs ) ;
70+ this . _cacheKeyVersion = this . version ;
71+
72+ }
73+
74+ return this . _cacheKey ;
75+
76+ }
77+
5478 getHash ( builder ) {
5579
5680 if ( this . _lightNodesHash === null ) {
You can’t perform that action at this time.
0 commit comments