MaterialX: add support for nodes #11

Merged
Bogdan Nagirniak merged 17 commits from matx-add-other-nodes into matx-export-material 2023-09-06 10:37:26 +02:00
Showing only changes of commit 8f57f4b515 - Show all commits

View File

@ -35,7 +35,6 @@ NodeItem BSDFPrincipledNodeParser::compute()
NodeItem ior = get_input_value("IOR"); NodeItem ior = get_input_value("IOR");
NodeItem transmission = get_input_value("Transmission"); NodeItem transmission = get_input_value("Transmission");
NodeItem transmission_roughness = get_input_value("Transmission Roughness");
NodeItem emission = get_input_value("Emission"); NodeItem emission = get_input_value("Emission");
NodeItem emission_strength = get_input_value("Emission Strength"); NodeItem emission_strength = get_input_value("Emission Strength");
@ -52,8 +51,12 @@ NodeItem BSDFPrincipledNodeParser::compute()
res.set_input("base", 1.0, "float"); res.set_input("base", 1.0, "float");
res.set_input("base_color", base_color.to_color3()); res.set_input("base_color", base_color.to_color3());
res.set_input("diffuse_roughness", roughness); res.set_input("diffuse_roughness", roughness);
res.set_input("normal", normal); if (normal) {
res.set_input("tangent", tangent); res.set_input("normal", normal);
}
if (tangent) {
res.set_input("tangent", tangent);
}
res.set_input("metalness", metallic); res.set_input("metalness", metallic);
res.set_input("specular", specular); res.set_input("specular", specular);
@ -65,10 +68,10 @@ NodeItem BSDFPrincipledNodeParser::compute()
res.set_input("transmission", transmission); res.set_input("transmission", transmission);
res.set_input("transmission_color", base_color.to_color3()); res.set_input("transmission_color", base_color.to_color3());
res.set_input("transmission_extra_roughness", transmission_roughness); res.set_input("transmission_extra_roughness", roughness);
res.set_input("subsurface", subsurface); res.set_input("subsurface", subsurface);
res.set_input("subsurface_color", subsurface_color); res.set_input("subsurface_color", subsurface_color.to_color3());
res.set_input("subsurface_radius", subsurface_radius); res.set_input("subsurface_radius", subsurface_radius);
res.set_input("subsurface_anisotropy", anisotropic); res.set_input("subsurface_anisotropy", anisotropic);
@ -82,10 +85,12 @@ NodeItem BSDFPrincipledNodeParser::compute()
res.set_input("coat_IOR", ior); res.set_input("coat_IOR", ior);
res.set_input("coat_anisotropy", anisotropic); res.set_input("coat_anisotropy", anisotropic);
res.set_input("coat_rotation", anisotropic_rotation); res.set_input("coat_rotation", anisotropic_rotation);
res.set_input("coat_normal", clearcoat_normal); if (clearcoat_normal) {
res.set_input("coat_normal", clearcoat_normal);
}
res.set_input("emission", emission_strength); res.set_input("emission", emission_strength);
res.set_input("emission_color", emission); res.set_input("emission_color", emission.to_color3());
return res; return res;
} }