Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/nodes/core/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class Node extends EventDispatcher {

//

const values = [ this.id ];
const values = [];

for ( const { property, childNode } of this._getChildren( ignores ) ) {

Expand All @@ -428,7 +428,7 @@ class Node extends EventDispatcher {
*/
customCacheKey() {

return 0;
return this.id;

}

Expand Down
4 changes: 4 additions & 0 deletions src/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { Vector4 } from '../../math/Vector4.js';
import { Float16BufferAttribute } from '../../core/BufferAttribute.js';
import { warn, error } from '../../utils.js';

let _id = 0;

const rendererCache = new WeakMap();

const typeFromArray = new Map( [
Expand Down Expand Up @@ -459,6 +461,8 @@ class NodeBuilder {
*/
this.fnCall = null;

Object.defineProperty( this, 'id', { value: _id ++ } );

}

/**
Expand Down
7 changes: 7 additions & 0 deletions src/nodes/core/PropertyNode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Node from './Node.js';
import { nodeImmutable, nodeObject } from '../tsl/TSLCore.js';
import { hashString } from './NodeUtils.js';

/**
* This class represents a shader property. It can be used
Expand Down Expand Up @@ -68,6 +69,12 @@ class PropertyNode extends Node {

}

customCacheKey() {

return hashString( this.type + ':' + ( this.name || '' ) + ':' + ( this.varying ? '1' : '0' ) );

}

getHash( builder ) {

return this.name || super.getHash( builder );
Expand Down
2 changes: 2 additions & 0 deletions src/renderers/common/RenderObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,8 @@ class RenderObject {

}

cacheKey = hash( cacheKey, this.camera.id );

return cacheKey;

}
Expand Down