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
6 changes: 5 additions & 1 deletion examples/jsm/nodes/core/NodeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ export function getValueType( value ) {

const typeOf = typeof value;

if ( typeOf === 'number' ) {
if ( value.isNode === true ) {

return 'node';

} else if ( typeOf === 'number' ) {

return 'float';

Expand Down
26 changes: 13 additions & 13 deletions examples/jsm/nodes/shadernode/ShaderNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,29 @@ const nodeObjectsCacheMap = new WeakMap();

const ShaderNodeObject = function ( obj ) {

const type = typeof obj;
const type = getValueType( obj );

if ( ( type === 'number' ) || ( type === 'boolean' ) ) {
if ( type === 'node' ) {

return nodeObject( getAutoTypedConstNode( obj ) );
let nodeObject = nodeObjectsCacheMap.get( obj );

} else if ( type === 'object' ) {
if ( nodeObject === undefined ) {

if ( obj && obj.isNode === true ) {
nodeObject = new Proxy( obj, shaderNodeHandler );
nodeObjectsCacheMap.set( obj, nodeObject );
nodeObjectsCacheMap.set( nodeObject, nodeObject );

let nodeObject = nodeObjectsCacheMap.get( obj );
}

if ( nodeObject === undefined ) {
return nodeObject;

nodeObject = new Proxy( obj, shaderNodeHandler );
nodeObjectsCacheMap.set( obj, nodeObject );
nodeObjectsCacheMap.set( nodeObject, nodeObject );
} else if ( ( type === 'float' ) || ( type === 'boolean' ) ) {

}
return nodeObject( getAutoTypedConstNode( obj ) );

return nodeObject;
} else if ( type && type !== 'string' ) {

}
return nodeObject( new ConstNode( obj ) );

}

Expand Down