A custom node-based material.
This material used to describe custom material setups exported from Blender or 3ds Max. I can be physically based or non-physical depending on the specified node graph.
Change material color specified in the "RGB.001" node:
var object = app.scene.getObjectByName("MyObj");
var mat = object.material;
var index = mat.nodeRGBMap['RGB.001']; // 'RGB.001' is the name of an RGB node
mat.nodeRGB[index] = new v3d.Vector4(1, 0, 0, 1); // new color in RGBA format
mat.needsUpdate = true;
Change value specified in the "Value.001" node:
var object = app.scene.getObjectByName("Circle");
var mat = object.material;
var index = mat.nodeValueMap['Value.001'];
mat.nodeValue[index] = 0.5; // new value
mat.needsUpdate = true;
[page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
Any property of the material (including any property inherited from [page:Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
string and is *0xffffff* (white) by default. [page:Color.set](color) is called internally.
See the base [page:Material] class for common properties.
Directed graph which contains material nodes.
Additional graphs representing node groups of the main node graph.
Node material profile, it can be "blender" or "max".
Object with material textures. It maps texture names to [page:Texture textures]. You can use it to dynamically assign new textures to a material.
Array of [page:Vector4 Vector4] values which contains color values of a material's "RGB" nodes. Please note that these colors are represented by 4-dimentional vector, not the [page:Color Color] class.
Array of float values which contain values of the material's "Value" nodes.
Maps "Value" node name to index in [page:.nodeValue] array. Used to define which value is to be updated, see the example listing above.
Used to check whether this class represent node material.
You should not change this, as it is used internally for optimization.
See the base [page:Material] class for common methods.
Generate shaders and update other material parameters based on the specified [page:.nodeGraph].
Convert [page:GLTFLoader GLTF node graph] to the format used by the material's [page:.nodeGraph] property.
Use the following puzzles to manage your materials:
[page:Puzzles.assign_material assign material] - assign the material to an object.
[page:Puzzles.replace_texture replace texture] - replace the material's texture.