MaterialX: Implement export of Input nodes #20

Merged
Bogdan Nagirniak merged 26 commits from Vasyl-Pidhirskyi/blender:BLEN-530 into matx-export-material 2023-09-15 19:55:37 +02:00
Showing only changes of commit 06a0de713f - Show all commits

View File

@ -26,6 +26,14 @@ static int node_shader_gpu_fresnel(GPUMaterial *mat,
return GPU_stack_link(mat, node, "node_fresnel", in, out); return GPU_stack_link(mat, node, "node_fresnel", in, out);
} }
NODE_SHADER_MATERIALX_BEGIN
{
/* TODO: some outputs expected be implemented within the next iteration (see nodedef
* <artistic_ior>) */
return get_input_value("IOR", NodeItem::Type::Float);
}
NODE_SHADER_MATERIALX_END
} // namespace blender::nodes::node_shader_fresnel_cc } // namespace blender::nodes::node_shader_fresnel_cc
/* node type definition */ /* node type definition */
@ -38,6 +46,7 @@ void register_node_type_sh_fresnel()
sh_node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT); sh_node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT);
ntype.declare = file_ns::node_declare; ntype.declare = file_ns::node_declare;
ntype.gpu_fn = file_ns::node_shader_gpu_fresnel; ntype.gpu_fn = file_ns::node_shader_gpu_fresnel;
ntype.materialx_fn = file_ns::node_shader_materialx;
nodeRegisterType(&ntype); nodeRegisterType(&ntype);
} }