How to add two Node Material color together v0.157.0?

I want to add the colorNode from box1.martial to box2.material. The problem is this doesn’t seem to work because box1 original color (red) is what gets returned.

    var boxGeometry = new THREE.BoxGeometry( 50.1, 50.1, 50.1, 1 )
    var boxMaterial   = new NODE.MeshPhysicalNodeMaterial();
    var box1 = new THREE.Mesh( boxGeometry, boxMaterial );
    box2.material.colorNode =  NODE.vec3(1.,0,.0)

    var boxGeometry = new THREE.BoxGeometry( 50.1, 50.1, 50.1, 1 )
    var boxMaterial   = new NODE.MeshPhysicalNodeMaterial();
    var box2 = new THREE.Mesh( boxGeometry, boxMaterial );
    box2.material.colorNode =  NODE.vec3(0.,0,.1)

    box1.material.colorNode.add(box2.material.colorNode)

    scene.add(box1)
    scene.add(box2)

If the new NODE system is going to be like Unity or UE blueprint shouldn’t I be able to combine two graphs together?

I think the add() function return a new node as its result; you’ll need to assign that.

1 Like