MaterialX: code improvements #34

Merged
Bogdan Nagirniak merged 2 commits from matx-nodes-polishing into matx-export-material 2023-09-26 07:29:05 +02:00
Showing only changes of commit 5dd8e7c2a9 - Show all commits

View File

@ -319,7 +319,7 @@ NODE_SHADER_MATERIALX_BEGIN
{"base_color", get_input_value("Base Color", NodeItem::Type::Color3)},
{"subsurface", get_input_value("Subsurface", NodeItem::Type::Float)},
{"subsurface_scale", get_input_value("Subsurface Scale", NodeItem::Type::Float)},
{"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Color3)},
{"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Vector3)},
//{"subsurface_ior", get_input_value("Subsurface IOR", NodeItem::Type::Vector3)},
{"subsurface_anisotropy", get_input_value("Subsurface Anisotropy", NodeItem::Type::Float)},
{"metallic", get_input_value("Metallic", NodeItem::Type::Float)},
@ -525,39 +525,41 @@ NODE_SHADER_MATERIALX_BEGIN
NodeItem anisotropic = in["anisotropic"];
NodeItem rotation = in["anisotropic_rotation"];
res = create_node("standard_surface",
NodeItem::Type::SurfaceShader,
{{"base", val(1.0f)},
{"base_color", base_color},
{"diffuse_roughness", roughness},
{"metalness", in["metallic"]},
{"specular", in["specular"]},
{"specular_color", in["specular_tint"]},
{"specular_roughness", roughness},
{"specular_IOR", in["ior"]},
{"specular_anisotropy", anisotropic},
{"specular_rotation", rotation},
{"transmission", in["transmission"]},
{"transmission_color", base_color},
{"transmission_extra_roughness", roughness},
{"subsurface", in["subsurface"]},
{"subsurface_color", base_color},
{"subsurface_radius", in["subsurface_radius"] * in["subsurface_scale"]},
{"subsurface_anisotropy", in["subsurface_anisotropy"]},
{"sheen", in["sheen"]},
{"sheen_color", in["sheen_tint"]},
{"sheen_roughness", in["sheen_roughness"]},
{"coat", in["coat"]},
{"coat_color", in["coat_tint"]},
{"coat_roughness", in["coat_roughness"]},
{"coat_IOR", in["coat_ior"]},
{"coat_anisotropy", anisotropic},
{"coat_rotation", rotation},
{"coat_normal", in["coat_normal"]},
{"emission", in["emission"]},
{"emission_color", in["emission_color"]},
{"normal", in["normal"]},
{"tangent", in["tangent"]}});
res = create_node(
"standard_surface",
NodeItem::Type::SurfaceShader,
{{"base", val(1.0f)},
{"base_color", base_color},
{"diffuse_roughness", roughness},
{"metalness", in["metallic"]},
{"specular", in["specular"]},
{"specular_color", in["specular_tint"]},
{"specular_roughness", roughness},
{"specular_IOR", in["ior"]},
{"specular_anisotropy", anisotropic},
{"specular_rotation", rotation},
{"transmission", in["transmission"]},
{"transmission_color", base_color},
{"transmission_extra_roughness", roughness},
{"subsurface", in["subsurface"]},
{"subsurface_color", base_color},
{"subsurface_radius",
(in["subsurface_radius"] * in["subsurface_scale"]).convert(NodeItem::Type::Color3)},
{"subsurface_anisotropy", in["subsurface_anisotropy"]},
{"sheen", in["sheen"]},
{"sheen_color", in["sheen_tint"]},
{"sheen_roughness", in["sheen_roughness"]},
{"coat", in["coat"]},
{"coat_color", in["coat_tint"]},
{"coat_roughness", in["coat_roughness"]},
{"coat_IOR", in["coat_ior"]},
{"coat_anisotropy", anisotropic},
{"coat_rotation", rotation},
{"coat_normal", in["coat_normal"]},
{"emission", in["emission"]},
{"emission_color", in["emission_color"]},
{"normal", in["normal"]},
{"tangent", in["tangent"]}});
break;
}
default: