import MeshStandardNodeMaterial from "three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js"
...
new MeshStandardNodeMaterial()
and I get the following error when attempting to use the material:
three.cjs:20208 Uncaught TypeError: Cannot set properties of undefined (setting 'value')
at getProgram (three.cjs:20208:1)
at setProgram (three.cjs:20326:1)
at WebGLRenderer.renderBufferDirect (three.cjs:19758:1)
at renderObject (three.cjs:20150:1)
at renderObjects (three.cjs:20126:1)
at renderScene (three.cjs:20066:1)
at WebGLRenderer.render (three.cjs:19955:1)
<snip (my code)>
I am not sure why cjs version is being used or whether there is also an esm version out there. Anyways, the line where the stack trace originates form corresponds to this source line:
I also attempted to construct material like this - to skip the whole “needsLights” section:
import MeshBasicNodeMaterial from "three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js"
new MeshBasicNodeMaterial({
lights: false
});
In that case I receive an similar error from here
We are talking about rather trivial example, not sure what could be wrong. Replacing node material with a “normal” material works properly. The rendered geometry has the usual attributes: position, uv, normal and color.
Double checking the examples, a possible missing part is:
import { nodeFrame } from 'three/examples/jsm/renderers/webgl/nodes/WebGLNodes.js';
...
nodeFrame.update();
However, that does not compile, because WebGLNodeBuilder.js imports three-nodes, unfortunately that seems to be relic of the past and the files are gone. There’s an npm package three-nodes in version 0.0.0 however doesn’t contain anything useful.