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
10 changed files with 10 additions and 9 deletions
Showing only changes of commit f573b66f31 - Show all commits

View File

@ -42,7 +42,7 @@ static int gpu_shader_bevel(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: This node doesn't have an implementation in MaterialX.*/ /* NOTE: This node isn't supported by MaterialX.*/
return get_input_link("Normal", NodeItem::Type::Vector3); return get_input_link("Normal", NodeItem::Type::Vector3);
} }
#endif #endif

View File

@ -319,7 +319,7 @@ NODE_SHADER_MATERIALX_BEGIN
{"base_color", get_input_value("Base Color", NodeItem::Type::Color3)}, {"base_color", get_input_value("Base Color", NodeItem::Type::Color3)},
{"subsurface", get_input_value("Subsurface", NodeItem::Type::Float)}, {"subsurface", get_input_value("Subsurface", NodeItem::Type::Float)},
{"subsurface_scale", get_input_value("Subsurface Scale", NodeItem::Type::Float)}, {"subsurface_scale", get_input_value("Subsurface Scale", NodeItem::Type::Float)},
{"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Vector3)}, {"subsurface_radius", get_input_value("Subsurface Radius", NodeItem::Type::Color3)},
//{"subsurface_ior", get_input_value("Subsurface IOR", NodeItem::Type::Vector3)}, //{"subsurface_ior", get_input_value("Subsurface IOR", NodeItem::Type::Vector3)},
{"subsurface_anisotropy", get_input_value("Subsurface Anisotropy", NodeItem::Type::Float)}, {"subsurface_anisotropy", get_input_value("Subsurface Anisotropy", NodeItem::Type::Float)},
{"metallic", get_input_value("Metallic", NodeItem::Type::Float)}, {"metallic", get_input_value("Metallic", NodeItem::Type::Float)},

View File

@ -61,7 +61,7 @@ static int node_shader_gpu_geometry(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: Some outputs don't have an implementation in MaterialX.*/ /* NOTE: Some outputs aren't supported by MaterialX.*/
NodeItem res = empty(); NodeItem res = empty();
std::string name = socket_out_->name; std::string name = socket_out_->name;

View File

@ -35,7 +35,7 @@ static int node_shader_gpu_light_path(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* This node isn't supported by MaterialX. Only default values returned. */ /* NOTE: This node isn't supported by MaterialX. Only default values returned. */
if (STREQ(socket_out_->name, "Is Camera Ray")) { if (STREQ(socket_out_->name, "Is Camera Ray")) {
return val(1.0f); return val(1.0f);
} }

View File

@ -33,7 +33,7 @@ static int node_shader_gpu_object_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: Some outputs don't have an implementation in MaterialX.*/ /* NOTE: Some outputs isn't supported by MaterialX.*/
NodeItem res = empty(); NodeItem res = empty();
std::string name = socket_out_->name; std::string name = socket_out_->name;

View File

@ -37,7 +37,7 @@ static int gpu_shader_particle_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: This node doesn't have an implementation in MaterialX.*/ /* NOTE: This node isn't supported by MaterialX.*/
return get_output_default(socket_out_->name, NodeItem::Type::Any); return get_output_default(socket_out_->name, NodeItem::Type::Any);
} }
#endif #endif

View File

@ -25,7 +25,7 @@ static int node_shader_gpu_point_info(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: This node doesn't have an implementation in MaterialX.*/ /* NOTE: This node isn't supported by MaterialX.*/
return get_output_default(socket_out_->name, NodeItem::Type::Any); return get_output_default(socket_out_->name, NodeItem::Type::Any);
} }
#endif #endif

View File

@ -74,7 +74,7 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: Some outputs don't have an implementation in MaterialX.*/ /* NOTE: Some outputs aren't supported by MaterialX.*/
NodeItem res = empty(); NodeItem res = empty();
std::string name = socket_out_->name; std::string name = socket_out_->name;

View File

@ -260,6 +260,7 @@ static void sh_node_noise_build_multi_function(NodeMultiFunctionBuilder &builder
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: Some inputs aren't supported by MaterialX.*/
NodeItem scale = get_input_value("Scale", NodeItem::Type::Float); NodeItem scale = get_input_value("Scale", NodeItem::Type::Float);
NodeItem detail = get_input_default("Detail", NodeItem::Type::Float); NodeItem detail = get_input_default("Detail", NodeItem::Type::Float);
NodeItem lacunarity = get_input_value("Lacunarity", NodeItem::Type::Float); NodeItem lacunarity = get_input_value("Lacunarity", NodeItem::Type::Float);

View File

@ -43,7 +43,7 @@ static int node_shader_gpu_wireframe(GPUMaterial *mat,
NODE_SHADER_MATERIALX_BEGIN NODE_SHADER_MATERIALX_BEGIN
#ifdef WITH_MATERIALX #ifdef WITH_MATERIALX
{ {
/* NOTE: This node doesn't have an implementation in MaterialX.*/ /* NOTE: This node isn't supported by MaterialX.*/
return get_output_default(socket_out_->name, NodeItem::Type::Float); return get_output_default(socket_out_->name, NodeItem::Type::Float);
} }
#endif #endif