forked from blender/blender
matx-code-improvements #8
@ -143,7 +143,7 @@ NodeItem NodeParser::get_input_value(const bNodeSocket &socket)
|
||||
|
||||
NodeItem NodeParser::compute_full()
|
||||
{
|
||||
CLOG_INFO(LOG_MATERIALX_SHADER, 1, "Node: %s [%d]", node->name, node->typeinfo->type);
|
||||
CLOG_INFO(LOG_MATERIALX_SHADER, 1, "%s [%d]", node->name, node->typeinfo->type);
|
||||
NodeItem res = compute();
|
||||
if (res.node) {
|
||||
res.set_name(node->output_sockets().size() == 1 ?
|
||||
|
@ -38,6 +38,15 @@ NodeItem OutputMaterialNodeParser::compute_default()
|
||||
{
|
||||
NodeItem surface = create_node("standard_surface", "surfaceshader");
|
||||
surface.set_input("base_color", value(MaterialX::Color3(material->r, material->g, material->b)));
|
||||
surface.set_input("diffuse_roughness", value(material->roughness));
|
||||
if (material->metallic > 0.0f) {
|
||||
surface.set_input("metalness", value(material->metallic));
|
||||
}
|
||||
if (material->spec) {
|
||||
surface.set_input("specular", value(material->spec));
|
||||
surface.set_input("specular_color", value(material->spec));
|
||||
surface.set_input("specular_roughness", value(material->roughness));
|
||||
}
|
||||
|
||||
NodeItem res = create_node("surfacematerial", "material");
|
||||
res.set_name("Material");
|
||||
|
Loading…
Reference in New Issue
Block a user