Skip to content

Commit

Permalink
TSL: Fix label() usage in uniform() (mrdoob#28548)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag authored Jun 3, 2024
1 parent c94a3c6 commit 0305d63
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/jsm/nodes/core/UniformNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ class UniformNode extends InputNode {

this.isUniformNode = true;

this.name = '';
this.groupNode = objectGroup;

}

label( name ) {

this.name = name;

return this;

}

setGroup( group ) {

this.groupNode = group;
Expand Down Expand Up @@ -73,7 +82,7 @@ class UniformNode extends InputNode {

const sharedNodeType = sharedNode.getInputType( builder );

const nodeUniform = builder.getUniformFromNode( sharedNode, sharedNodeType, builder.shaderStage, builder.context.label );
const nodeUniform = builder.getUniformFromNode( sharedNode, sharedNodeType, builder.shaderStage, this.name || builder.context.label );
const propertyName = builder.getPropertyName( nodeUniform );

if ( builder.context.label !== undefined ) delete builder.context.label;
Expand Down

0 comments on commit 0305d63

Please sign in to comment.