How do I update node-material uniforms?

I encountered the very same issue, and sunag kindly disclosed the process.

import { uniform, MeshBasicNodeMaterial } from "three/examples/jsm/nodes/Nodes.js";

const myUniform = uniform( 1 ); // you can put number, Vector*, Color  and others

const nodeMaterial = new MeshBasicNodeMaterial();
nodeMaterial.colorNode = myUniform;

// changing
//myUniform.value = .5;
4 Likes