Skip to content

Commit

Permalink
NodeBuilder: Fix construct() node data (mrdoob#26533)
Browse files Browse the repository at this point in the history
* NodeBuilder: Fix construct() node data

* cleanup

* cleanup
  • Loading branch information
sunag authored Aug 4, 2023
1 parent b1fbdc5 commit e5426b0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/jsm/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,19 @@ class NodeBuilder {

if ( nodeData === undefined ) {

nodeData = { vertex: {}, fragment: {}, compute: {} };
nodeData = {};

cache.setNodeData( node, nodeData );

}

return shaderStage !== null ? nodeData[ shaderStage ] : nodeData;
if ( nodeData[ shaderStage ] === undefined ) nodeData[ shaderStage ] = {};

return nodeData[ shaderStage ];

}

getNodeProperties( node, shaderStage = this.shaderStage ) {
getNodeProperties( node, shaderStage = 'any' ) {

const nodeData = this.getDataFromNode( node, shaderStage );

Expand Down Expand Up @@ -650,7 +652,7 @@ class NodeBuilder {

getVaryingFromNode( node, type ) {

const nodeData = this.getDataFromNode( node, null );
const nodeData = this.getDataFromNode( node, 'any' );

let nodeVarying = nodeData.varying;

Expand Down

0 comments on commit e5426b0

Please sign in to comment.