diff --git a/CMakeLists.txt b/CMakeLists.txt index 31db83e8fe..569cceeebd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,6 @@ option(MATERIALX_TEST_RENDER "Run rendering tests for MaterialX Render module. G option(MATERIALX_WARNINGS_AS_ERRORS "Interpret all compiler warnings as errors." OFF) option(MATERIALX_COVERAGE_ANALYSIS "Build MaterialX libraries with coverage analysis on supporting platforms." OFF) option(MATERIALX_DYNAMIC_ANALYSIS "Build MaterialX libraries with dynamic analysis on supporting platforms." OFF) -option(MATERIALX_OSL_LEGACY_CLOSURES "Build OSL shader generation supporting the legacy OSL closures." OFF) option(MATERIALX_BUILD_IOS "Build MaterialX for iOS. (Deprecated. Set CMAKE_SYSTEM_NAME instead)" OFF) option(MATERIALX_BUILD_APPLE_FRAMEWORK "Build MaterialX as an Apple Framework" ${__build_apple_framework}) @@ -180,7 +179,6 @@ mark_as_advanced(MATERIALX_PYTHON_EXECUTABLE) mark_as_advanced(MATERIALX_PYTHON_OCIO_DIR) mark_as_advanced(MATERIALX_PYTHON_PYBIND11_DIR) mark_as_advanced(MATERIALX_OIIO_DIR) -mark_as_advanced(MATERIALX_OSL_LEGACY_CLOSURES) mark_as_advanced(MATERIALX_OSL_BINARY_OSLC) mark_as_advanced(MATERIALX_OSL_BINARY_TESTRENDER) mark_as_advanced(MATERIALX_OSL_INCLUDE_PATH) @@ -227,9 +225,6 @@ if(MATERIALX_BUILD_RENDER AND MATERIALX_BUILD_GEN_OSL AND MATERIALX_BUILD_TESTS) endif() # Add global definitions -if (MATERIALX_OSL_LEGACY_CLOSURES) - add_definitions(-DMATERIALX_OSL_LEGACY_CLOSURES) -endif() if(MATERIALX_BUILD_OIIO) add_definitions(-DMATERIALX_BUILD_OIIO) endif() diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index d60a54cf3b..6852090932 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -1,15 +1,9 @@ -if (MATERIALX_OSL_LEGACY_CLOSURES) - set(PBRLIB_SUFFIX "legacy") -else() - set(PBRLIB_SUFFIX "mtlx") -endif() - if(NOT SKBUILD) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}" PATTERN "CMakeLists.txt" EXCLUDE PATTERN "pbrlib_genosl_impl.*" EXCLUDE) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.${PBRLIB_SUFFIX}" + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.mtlx" DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx) endif() @@ -23,6 +17,6 @@ if(MATERIALX_BUILD_PYTHON) DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}" PATTERN "CMakeLists.txt" EXCLUDE PATTERN "pbrlib_genosl_impl.*" EXCLUDE) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.${PBRLIB_SUFFIX}" + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.mtlx" DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx) endif() diff --git a/libraries/README.md b/libraries/README.md index 15916f76e2..0ace221bcc 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -74,7 +74,4 @@ This folder contains the standard data libraries for MaterialX, providing declar - Basic GLSL and MSL `lightshader` node definitions and implementations are provided for the following light types: - point, directional, spot - Shader generation does not currently support: - - `ambientocclusion` node. - - `arrayappend` node. - - `curveadjust` node. - `displacementshader` and `volumeshader` nodes for hardware shading targets (GLSL, MSL). diff --git a/libraries/pbrlib/genosl/legacy/mx_anisotropic_vdf.osl b/libraries/pbrlib/genosl/legacy/mx_anisotropic_vdf.osl deleted file mode 100644 index 6d52e08509..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_anisotropic_vdf.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) -{ - // Not implemented in vanilla OSL - vdf = 0; // volume_henyey_greenstein(color(absorption), color(scattering), color(0.0), anisotropy); -} diff --git a/libraries/pbrlib/genosl/legacy/mx_burley_diffuse_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_burley_diffuse_bsdf.osl deleted file mode 100644 index 5f7d397dce..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_burley_diffuse_bsdf.osl +++ /dev/null @@ -1,6 +0,0 @@ -void mx_burley_diffuse_bsdf(float weight, color reflectance, float roughness, normal N, output BSDF bsdf) -{ - // TODO: Implement properly. - bsdf.response = reflectance * weight * oren_nayar(N, roughness); - bsdf.throughput = color(0.0); -} diff --git a/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl deleted file mode 100644 index 82cb6f32be..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl +++ /dev/null @@ -1,32 +0,0 @@ -#include "../lib/mx_microfacet_specular.osl" - -void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) -{ - bsdf.throughput = color(0.0); - - if (weight < M_FLOAT_EPS) - { - bsdf.response = 0; - return; - } - - // Calculate conductor fresnel - // - // Fresnel should be based on microfacet normal - // but we have no access to that from here, so just use - // view direction and surface normal instead - // - float NdotV = fabs(dot(N,-I)); - color F = mx_fresnel_conductor(NdotV, ior_n, ior_k); - - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - // Set ior to 0.0 to disable the internal dielectric fresnel - bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, false); -} diff --git a/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl deleted file mode 100644 index 5e50834746..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl +++ /dev/null @@ -1,36 +0,0 @@ -#include "../lib/mx_microfacet_specular.osl" - -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) -{ - if (scatter_mode == "T") - { - bsdf.response = tint * weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); - bsdf.throughput = tint * weight; - return; - } - - float NdotV = clamp(dot(N,-I), M_FLOAT_EPS, 1.0); - float F0 = mx_ior_to_f0(ior); - float F = mx_fresnel_schlick(NdotV, F0); - - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - float comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - // Calculate throughput from directional albedo. - float dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, ior) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; - - if (scatter_mode == "R") - { - bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 0); - } - else - { - bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 2); - } -} diff --git a/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl deleted file mode 100644 index cd022f8295..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl +++ /dev/null @@ -1,38 +0,0 @@ -#include "../lib/mx_microfacet_specular.osl" - -void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) -{ - float avgF0 = dot(color0, color(1.0 / 3.0)); - float ior = mx_f0_to_ior(avgF0); - - if (scatter_mode == "T") - { - bsdf.response = weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); - bsdf.throughput = weight; - return; - } - - float NdotV = fabs(dot(N,-I)); - color F = mx_fresnel_schlick(NdotV, color0, color90, exponent); - - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - // Calculate throughput from directional albedo. - color dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, color0, color90) * comp; - float avgDirAlbedo = dot(dirAlbedo, color(1.0 / 3.0)); - bsdf.throughput = 1.0 - avgDirAlbedo * weight; - - // Calculate the reflection response, setting IOR to zero to disable internal Fresnel. - bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, 0); - - if (scatter_mode == "RT") - { - bsdf.response += bsdf.throughput * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 1); - } -} diff --git a/libraries/pbrlib/genosl/legacy/mx_oren_nayar_diffuse_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_oren_nayar_diffuse_bsdf.osl deleted file mode 100644 index b9c5fba797..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_oren_nayar_diffuse_bsdf.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_oren_nayar_diffuse_bsdf(float weight, color _color, float roughness, normal N, int energy_compensation, output BSDF bsdf) -{ - bsdf.response = _color * weight * oren_nayar(N, roughness); - bsdf.throughput = color(0.0); -} diff --git a/libraries/pbrlib/genosl/legacy/mx_sheen_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_sheen_bsdf.osl deleted file mode 100644 index e94325fe99..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_sheen_bsdf.osl +++ /dev/null @@ -1,24 +0,0 @@ -#include "../lib/mx_microfacet_sheen.osl" - -// TODO: Vanilla OSL doesn't have a proper sheen closure, -// so use 'diffuse' scaled by sheen directional albedo for now. -void mx_sheen_bsdf(float weight, color Ks, float roughness, vector N, output BSDF bsdf) -{ - if (weight < M_FLOAT_EPS) - { - bsdf.response = 0; - bsdf.throughput = color(1.0); - return; - } - - // TODO: Normalization should not be needed. My suspicion is that - // BSDF sampling of new outgoing direction in 'testrender' needs - // to be fixed. - vector V = normalize(-I); - - float NdotV = fabs(dot(N,V)); - float alpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float albedo = weight * mx_imageworks_sheen_dir_albedo(NdotV, alpha); - bsdf.response = albedo * Ks * diffuse(N); - bsdf.throughput = 1.0 - albedo; -} diff --git a/libraries/pbrlib/genosl/legacy/mx_subsurface_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_subsurface_bsdf.osl deleted file mode 100644 index da0e3cc12a..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_subsurface_bsdf.osl +++ /dev/null @@ -1,6 +0,0 @@ -void mx_subsurface_bsdf(float weight, color _color, color radius, float anisotropy, normal N, output BSDF bsdf) -{ - // TODO: Subsurface closure is not supported by vanilla OSL. - bsdf.response = _color * weight * diffuse(N); - bsdf.throughput = color(0.0); -} diff --git a/libraries/pbrlib/genosl/legacy/mx_surface.osl b/libraries/pbrlib/genosl/legacy/mx_surface.osl deleted file mode 100644 index d48320411e..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_surface.osl +++ /dev/null @@ -1,6 +0,0 @@ -void mx_surface(BSDF bsdf, EDF edf, float opacity, int thin_walled, output surfaceshader result) -{ - result.bsdf = bsdf.response; - result.edf = edf; - result.opacity = clamp(opacity, 0.0, 1.0); -} diff --git a/libraries/pbrlib/genosl/legacy/mx_translucent_bsdf.osl b/libraries/pbrlib/genosl/legacy/mx_translucent_bsdf.osl deleted file mode 100644 index fd56a37db8..0000000000 --- a/libraries/pbrlib/genosl/legacy/mx_translucent_bsdf.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_translucent_bsdf(float weight, color _color, normal N, output BSDF bsdf) -{ - bsdf.response = _color * weight * translucent(N); - bsdf.throughput = color(0.0); -} diff --git a/libraries/pbrlib/genosl/pbrlib_genosl_impl.legacy b/libraries/pbrlib/genosl/pbrlib_genosl_impl.legacy deleted file mode 100644 index e4a424e1ac..0000000000 --- a/libraries/pbrlib/genosl/pbrlib_genosl_impl.legacy +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx b/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx index 69f8f9a7f8..ad3a21e9cf 100644 --- a/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx +++ b/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx @@ -129,12 +129,6 @@ - - - - - - diff --git a/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx b/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx index b190937c41..6ac2b862dd 100644 --- a/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx +++ b/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx @@ -131,13 +131,6 @@ - - - - - - - diff --git a/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx b/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx index afdfb2cfbb..3cb99052cf 100644 --- a/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx +++ b/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx @@ -45,10 +45,6 @@ - - - - diff --git a/libraries/stdlib/genosl/mx_ambientocclusion_float.osl b/libraries/stdlib/genosl/mx_ambientocclusion_float.osl deleted file mode 100644 index 10baf0b736..0000000000 --- a/libraries/stdlib/genosl/mx_ambientocclusion_float.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result) -{ - // This node is a stub and does not currently operate to specification - result = 0; -} diff --git a/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx b/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx index 716e1072d7..db318976c5 100644 --- a/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx +++ b/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx @@ -131,13 +131,6 @@ - - - - - - - diff --git a/libraries/stdlib/stdlib_defs.mtlx b/libraries/stdlib/stdlib_defs.mtlx index 943e36ec88..e6f8d431e7 100644 --- a/libraries/stdlib/stdlib_defs.mtlx +++ b/libraries/stdlib/stdlib_defs.mtlx @@ -1354,21 +1354,6 @@ - - - - - - - - - - - @@ -2899,44 +2884,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - registerImplementation("IM_mix_bsdf_" + OslShaderGenerator::TARGET, ClosureMixNode::create); - registerImplementation("IM_mix_edf_" + OslShaderGenerator::TARGET, ClosureMixNode::create); - // - registerImplementation("IM_add_bsdf_" + OslShaderGenerator::TARGET, ClosureAddNode::create); - registerImplementation("IM_add_edf_" + OslShaderGenerator::TARGET, ClosureAddNode::create); - // - registerImplementation("IM_multiply_bsdfC_" + OslShaderGenerator::TARGET, ClosureMultiplyNode::create); - registerImplementation("IM_multiply_bsdfF_" + OslShaderGenerator::TARGET, ClosureMultiplyNode::create); - registerImplementation("IM_multiply_edfC_" + OslShaderGenerator::TARGET, ClosureMultiplyNode::create); - registerImplementation("IM_multiply_edfF_" + OslShaderGenerator::TARGET, ClosureMultiplyNode::create); - -#endif // MATERIALX_OSL_LEGACY_CLOSURES - // registerImplementation("IM_surface_" + OslShaderGenerator::TARGET, SurfaceNodeOsl::create); @@ -158,10 +142,6 @@ ShaderPtr OslShaderGenerator::generate(const string& name, ElementPtr element, G const bool isSurfaceShaderOutput = singleOutput && singleOutput->getType() == Type::SURFACESHADER; -#ifdef MATERIALX_OSL_LEGACY_CLOSURES - const bool isBsdfOutput = singleOutput && singleOutput->getType() == Type::BSDF; -#endif - if (isSurfaceShaderOutput) { // Special case for having 'surfaceshader' as final output type. @@ -170,16 +150,6 @@ ShaderPtr OslShaderGenerator::generate(const string& name, ElementPtr element, G // to understand this output. emitLine("output closure color " + singleOutput->getVariable() + " = 0", stage, false); } -#ifdef MATERIALX_OSL_LEGACY_CLOSURES - else if (isBsdfOutput) - { - // Special case for having 'BSDF' as final output type. - // For legacy closures this type is a struct internally (response, throughput, thickness, ior) - // so we must declare this as a single closure color type in order for renderers - // to understand this output. - emitLine("output closure color " + singleOutput->getVariable() + " = 0", stage, false); - } -#endif else { // Just emit all outputs the way they are declared. @@ -253,18 +223,6 @@ ShaderPtr OslShaderGenerator::generate(const string& name, ElementPtr element, G emitLine(singleOutput->getVariable() + " = (" + result + ".bsdf + " + result + ".edf) * opacity_weight + transparent() * (1.0 - opacity_weight)", stage); emitScopeEnd(stage); } -#ifdef MATERIALX_OSL_LEGACY_CLOSURES - else if (isBsdfOutput) - { - // Special case for having 'BSDF' as final output type. - // For legacy closures this type is a struct internally (response, throughput, thickness, ior) - // so we must declare this as a single closure color type in order for renderers - // to understand this output. - const ShaderGraphOutputSocket* socket = graph.getOutputSocket(0); - const string result = getUpstreamResult(socket, context); - emitLine(singleOutput->getVariable() + " = " + result + ".response", stage); - } -#endif else { // Assign results to final outputs. diff --git a/source/MaterialXGenOsl/OslSyntax.cpp b/source/MaterialXGenOsl/OslSyntax.cpp index 797a891ce6..a85821c4fd 100644 --- a/source/MaterialXGenOsl/OslSyntax.cpp +++ b/source/MaterialXGenOsl/OslSyntax.cpp @@ -371,19 +371,6 @@ OslSyntax::OslSyntax() EMPTY_STRING, "struct textureresource { string filename; string colorspace; };")); -#ifdef MATERIALX_OSL_LEGACY_CLOSURES - - registerTypeSyntax( - Type::BSDF, - std::make_shared( - "BSDF", - "BSDF(null_closure, color(1.0))", - "{ 0, color(1.0) }", - "closure color", - "struct BSDF { closure color response; color throughput; };")); - -#else - registerTypeSyntax( Type::BSDF, std::make_shared( @@ -393,8 +380,6 @@ OslSyntax::OslSyntax() "closure color", "#define BSDF closure color")); -#endif // MATERIALX_OSL_LEGACY_CLOSURES - registerTypeSyntax( Type::EDF, std::make_shared( diff --git a/source/MaterialXTest/CMakeLists.txt b/source/MaterialXTest/CMakeLists.txt index 4835787ed8..c3fae603dc 100644 --- a/source/MaterialXTest/CMakeLists.txt +++ b/source/MaterialXTest/CMakeLists.txt @@ -96,11 +96,6 @@ endif() add_custom_command(TARGET MaterialXTest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../../libraries ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/libraries) -if(MATERIALX_OSL_LEGACY_CLOSURES) - add_custom_command(TARGET MaterialXTest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E rename - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/libraries/pbrlib/genosl/pbrlib_genosl_impl.legacy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/libraries/pbrlib/genosl/pbrlib_genosl_impl.mtlx) -endif() if(MATERIALX_BUILD_GEN_MDL) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../source/MaterialXGenMdl/mdl/" diff --git a/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.cpp b/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.cpp index 2a9a0bb6fa..979320bd91 100644 --- a/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.cpp +++ b/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.cpp @@ -81,7 +81,7 @@ TEST_CASE("GenShader: GLSL Implementation Check", "[genglsl]") mx::StringSet generatorSkipNodeTypes; mx::StringSet generatorSkipNodeDefs; - GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs, 30); + GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs); } TEST_CASE("GenShader: GLSL Unique Names", "[genglsl]") diff --git a/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h b/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h index 97ad62f0e4..bc96ac0268 100644 --- a/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h +++ b/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h @@ -51,7 +51,7 @@ class GlslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester { whiteList = { - "ambientocclusion", "arrayappend", "screen", "curveadjust", "displacementshader", "volumeshader", + "screen", "displacementshader", "volumeshader", "IM_constant_", "IM_dot_", "IM_geompropvalue_boolean", "IM_geompropvalue_string", "IM_light_genglsl", "IM_point_light_genglsl", "IM_spot_light_genglsl", "IM_directional_light_genglsl", "IM_angle", "volumematerial", "ND_volumematerial" diff --git a/source/MaterialXTest/MaterialXGenMdl/GenMdl.cpp b/source/MaterialXTest/MaterialXGenMdl/GenMdl.cpp index 638a4fd10c..4bec0016de 100644 --- a/source/MaterialXTest/MaterialXGenMdl/GenMdl.cpp +++ b/source/MaterialXTest/MaterialXGenMdl/GenMdl.cpp @@ -94,7 +94,7 @@ TEST_CASE("GenShader: MDL Implementation Check", "[genmdl]") mx::StringSet generatorSkipNodeDefs; - GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs, 31); + GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs); } diff --git a/source/MaterialXTest/MaterialXGenMdl/GenMdl.h b/source/MaterialXTest/MaterialXGenMdl/GenMdl.h index ab92a5dacf..e51dbbd7e5 100644 --- a/source/MaterialXTest/MaterialXGenMdl/GenMdl.h +++ b/source/MaterialXTest/MaterialXGenMdl/GenMdl.h @@ -76,7 +76,7 @@ class MdlShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester { whiteList = { - "ambientocclusion", "arrayappend", "backfacing", "screen", "curveadjust", "displacementshader", + "backfacing", "screen", "displacementshader", "volumeshader", "IM_constant_", "IM_dot_", "IM_geomattrvalue", "IM_angle", "geompropvalue", "surfacematerial", "volumematerial", "IM_absorption_vdf_", "IM_mix_vdf_", "IM_add_vdf_", "IM_multiply_vdf", diff --git a/source/MaterialXTest/MaterialXGenMsl/GenMsl.cpp b/source/MaterialXTest/MaterialXGenMsl/GenMsl.cpp index b0309ea44d..32baaec5f0 100644 --- a/source/MaterialXTest/MaterialXGenMsl/GenMsl.cpp +++ b/source/MaterialXTest/MaterialXGenMsl/GenMsl.cpp @@ -84,7 +84,7 @@ TEST_CASE("GenShader: MSL Implementation Check", "[genmsl]") mx::StringSet generatorSkipNodeTypes; mx::StringSet generatorSkipNodeDefs; - GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs, 30); + GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs); } TEST_CASE("GenShader: MSL Unique Names", "[genmsl]") diff --git a/source/MaterialXTest/MaterialXGenMsl/GenMsl.h b/source/MaterialXTest/MaterialXGenMsl/GenMsl.h index 7c96279d8b..c281abde1c 100644 --- a/source/MaterialXTest/MaterialXGenMsl/GenMsl.h +++ b/source/MaterialXTest/MaterialXGenMsl/GenMsl.h @@ -70,7 +70,7 @@ class MslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester { whiteList = { - "ambientocclusion", "arrayappend", "backfacing", "screen", "curveadjust", "displacementshader", + "backfacing", "screen", "displacementshader", "volumeshader", "IM_constant_", "IM_dot_", "IM_geompropvalue_boolean", "IM_geompropvalue_string", "IM_light_genmsl", "IM_point_light_genmsl", "IM_spot_light_genmsl", "IM_directional_light_genmsl", "IM_angle", "surfacematerial", "volumematerial", "ND_surfacematerial", "ND_volumematerial", "ND_backface_util", "IM_backface_util_genmsl" diff --git a/source/MaterialXTest/MaterialXGenOsl/GenOsl.cpp b/source/MaterialXTest/MaterialXGenOsl/GenOsl.cpp index 612d134753..6e613c85b8 100644 --- a/source/MaterialXTest/MaterialXGenOsl/GenOsl.cpp +++ b/source/MaterialXTest/MaterialXGenOsl/GenOsl.cpp @@ -90,7 +90,7 @@ TEST_CASE("GenShader: OSL Implementation Check", "[genosl]") mx::StringSet generatorSkipNodeDefs; - GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs, 31); + GenShaderUtil::checkImplementations(context, generatorSkipNodeTypes, generatorSkipNodeDefs); } TEST_CASE("GenShader: OSL Unique Names", "[genosl]") diff --git a/source/MaterialXTest/MaterialXGenOsl/GenOsl.h b/source/MaterialXTest/MaterialXGenOsl/GenOsl.h index 959c12d48b..cc97558e59 100644 --- a/source/MaterialXTest/MaterialXGenOsl/GenOsl.h +++ b/source/MaterialXTest/MaterialXGenOsl/GenOsl.h @@ -63,7 +63,7 @@ class OslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester { whiteList = { - "ambientocclusion", "arrayappend", "backfacing", "screen", "curveadjust", "displacementshader", + "backfacing", "screen", "displacementshader", "volumeshader", "IM_constant_", "IM_dot_", "IM_geompropvalue", "IM_angle", "ND_backface_util" }; ShaderGeneratorTester::getImplementationWhiteList(whiteList); diff --git a/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp b/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp index 78da7e50f3..40f89c001f 100644 --- a/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp +++ b/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp @@ -67,8 +67,7 @@ bool getShaderSource(mx::GenContext& context, // Check that implementations exist for all nodedefs supported per generator void checkImplementations(mx::GenContext& context, const mx::StringSet& generatorSkipNodeTypes, - const mx::StringSet& generatorSkipNodeDefs, - unsigned int expectedSkipCount) + const mx::StringSet& generatorSkipNodeDefs) { const mx::ShaderGenerator& shadergen = context.getShaderGenerator(); @@ -90,10 +89,8 @@ void checkImplementations(mx::GenContext& context, // Node types to explicitly skip temporarily. mx::StringSet skipNodeTypes = { - "ambientocclusion", "displacement", "volume", - "curveadjust", "conical_edf", "measured_edf", "absorption_vdf", @@ -268,7 +265,6 @@ void checkImplementations(mx::GenContext& context, std::cerr << (std::string("Missing list: ") + missing_str) << std::endl; } REQUIRE(missing == 0); - REQUIRE(skipped == expectedSkipCount); implDumpBuffer.close(); } diff --git a/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.h b/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.h index 2bac14e435..d4876a03f7 100644 --- a/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.h +++ b/source/MaterialXTest/MaterialXGenShader/GenShaderUtil.h @@ -46,8 +46,7 @@ bool generateCode(mx::GenContext& context, const std::string& shaderName, mx::Ty // Check that implementations exist for all nodedefs supported per generator void checkImplementations(mx::GenContext& context, const mx::StringSet& generatorSkipNodeTypes, - const mx::StringSet& generatorSkipNodeDefs, - unsigned int expectedSkipCount); + const mx::StringSet& generatorSkipNodeDefs); // Utility test to check unique name generation on a shader generator void testUniqueNames(mx::GenContext& context, const std::string& stage); diff --git a/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp b/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp index 3184d892e9..05c83ae82e 100644 --- a/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp +++ b/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp @@ -65,8 +65,7 @@ TEST_CASE("GenReference: OSL Reference", "[genreference]") // Generate reference shaders. // Ignore the following nodes: const mx::StringSet ignoreNodeList = { "surfacematerial", "volumematerial", - "constant_filename", "arrayappend", - "dot_filename"}; + "constant_filename", "dot_filename"}; bool failedGeneration = false; for (const mx::NodeDefPtr& nodedef : stdlib->getNodeDefs())