diff --git a/examples/jsm/nodes/ShaderNode.js b/examples/jsm/nodes/ShaderNode.js index 4f9ea40e0a05c1..ec77ebf816b823 100644 --- a/examples/jsm/nodes/ShaderNode.js +++ b/examples/jsm/nodes/ShaderNode.js @@ -236,7 +236,13 @@ const ConvertType = function ( type, cacheMap = null ) { const nodes = params.map( getAutoTypedConstNode ); - return nodeObject( new ConvertNode( nodes.length === 1 ? nodes[ 0 ] : new JoinNode( nodes ), type ) ); + if ( nodes.length === 1 ) { + + return nodeObject( nodes[ 0 ].nodeType === type ? nodes[ 0 ] : new ConvertNode( nodes[ 0 ], type ) ); + + } + + return nodeObject( new ConvertNode( new JoinNode( nodes ), type ) ); }