Skip to content

Commit 43bd3a7

Browse files
authored
Merge branch 'main' into krohmer/add_subsurface_bsdf_tests
2 parents 5a1a9f4 + f70d55c commit 43bd3a7

10 files changed

Lines changed: 92 additions & 41 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
# Change Log
22

3-
## [1.39.3] - Release Candidate
3+
## [1.39.4] - Development
4+
5+
## [1.39.3] - 2025-03-07
46

57
### Added
6-
- Added support for the [fract node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2169), including both new specification language and data library implementations.
8+
- Added support for the [fract node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2169), with implementations in GLSL, OSL, and MDL.
9+
- Added a bitangent input to the [bump node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2196), aligning its feature set with the normalmap node.
710
- Added support for [OSL 1.14](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2204) in shader generation, leveraging the latest closures when available.
811
- Added support for [MDL 1.10](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2214) in shader generation, leveraging the latest closures when available.
912
- Added initial support for [data library builds](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2226), allowing future releases to generate derived artifacts from the MaterialX data libraries.
1013
- Added an [ElementVec type alias](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2231) in MaterialX C++, allowing certain patterns to be expressed more clearly and concisely.
1114

1215
### Changed
13-
- Raised the minimum CMake version to [CMake 3.26](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2235).
16+
- Improved the compatibility of MaterialX shader generation with [Hydra Storm](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2211).
1417
- Refactored the [type system](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2176) in shader generation, improving the thread-safety and robustness of the generation process.
1518
- Improved the implementations of the [BSDF operator nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2191), preferring data definitions over explicit C++ code.
16-
- Improved the implementation of the [time node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2192), using a node graph implementation in hardware shading languages.
19+
- Improved the implementations of the [time node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2192), using a graph definition in hardware shading languages.
20+
- Optimized [GitHub CI](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2253) to reduce build times for contributors.
21+
- Raised the minimum CMake version to [CMake 3.26](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2235).
1722

1823
### Fixed
24+
- Fixed two edge cases in the [version](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2248) [upgrade](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2251) logic for normalmap nodes, addressing the usage of MaterialX versioning in OpenUSD.
25+
- Fixed [tangent frame orthogonalization](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2245) for the normalmap node in OSL shader generation.
1926
- Added validation of [tree depth](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2232) and [XInclude depth](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2233) in XML parsing, addressing cases where unusually complex documents could trigger a stack overflow.
20-
- Adding missing [null](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2228) [checks](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2229) in the getShaderNodes helper function.
21-
- Fixed edge cases in the version upgrade process for [normalmap](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2248) [nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2251).
27+
- Adding two missing [null](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2228) [checks](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2229) in the getShaderNodes helper function.
28+
- Integrated fixes to [OSL type classes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2200) from recent work in the OSL project.
2229
- Improved the handling of [invalid materials](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2230) in the MaterialX Viewer, addressing cases where missing lights could trigger a crash.
2330

2431
## [1.39.2] - 2025-01-20

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MaterialX Version
22
set(MATERIALX_MAJOR_VERSION 1)
33
set(MATERIALX_MINOR_VERSION 39)
4-
set(MATERIALX_BUILD_VERSION 3)
4+
set(MATERIALX_BUILD_VERSION 4)
55
set(MATERIALX_LIBRARY_VERSION ${MATERIALX_MAJOR_VERSION}.${MATERIALX_MINOR_VERSION}.${MATERIALX_BUILD_VERSION})
66

77
# Cmake setup
@@ -10,9 +10,9 @@ set(CMAKE_CXX_STANDARD 17)
1010
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
1111
set(CMAKE_MACOSX_RPATH ON)
1212
enable_testing()
13-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
14-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
15-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
13+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
14+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
15+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
1616

1717
# JavaScript setup
1818
option(MATERIALX_BUILD_JS "Build the MaterialX JavaScript package from C++ bindings. Requires the emscripten environment." OFF)
@@ -254,7 +254,7 @@ endif()
254254
255255
# Adjust the default installation path
256256
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
257-
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/installed" CACHE PATH "Default install path" FORCE)
257+
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/installed" CACHE PATH "Default install path" FORCE)
258258
endif()
259259
260260
# Set the installation path for shared libraries
@@ -358,7 +358,7 @@ function(mx_add_library MATERIALX_MODULE_NAME)
358358
359359
# Create version resource
360360
if(MATERIALX_BUILD_SHARED_LIBS AND MSVC)
361-
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
361+
configure_file(${PROJECT_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
362362
target_sources(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
363363
endif()
364364
@@ -588,10 +588,10 @@ if(NOT SKBUILD)
588588
endif()
589589

590590
configure_package_config_file(cmake/modules/MaterialXConfig.cmake.in
591-
${CMAKE_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake
591+
${PROJECT_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake
592592
INSTALL_DESTINATION "${MATERIALX_GEN_CONFIG_PATH}"
593593
PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_PROJECT_NAME)
594-
write_basic_package_version_file(${CMAKE_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}ConfigVersion.cmake
594+
write_basic_package_version_file(${PROJECT_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}ConfigVersion.cmake
595595
VERSION ${MATERIALX_LIBRARY_VERSION}
596596
COMPATIBILITY AnyNewerVersion)
597597

@@ -601,7 +601,7 @@ if(NOT SKBUILD)
601601
DESTINATION "${MATERIALX_GEN_CONFIG_PATH}"
602602
FILE ${CMAKE_PROJECT_NAME}Targets.cmake)
603603

604-
install(FILES "${CMAKE_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
605-
"${CMAKE_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake"
604+
install(FILES "${PROJECT_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
605+
"${PROJECT_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake"
606606
DESTINATION "${MATERIALX_GEN_CONFIG_PATH}")
607607
endif()

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ The Open Chess Set is an open reference asset, consisting of a [MaterialX file](
7272

7373
The following packages contain pre-built binaries for the latest release, including the MaterialX viewer, Python libraries, and example assets:
7474

75-
- [Microsoft Windows (Visual Studio 2022, Python 3.12)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Windows_VS2022_x64_Python312.zip)
76-
- [MacOS (Xcode 15, Python 3.12)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_MacOS_Xcode_15_Python312.zip)
77-
- [Linux (GCC 14, Python 3.12)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Linux_GCC_14_Python312.zip)
75+
- [Microsoft Windows (Visual Studio 2022, Python 3.13)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Windows_VS2022_x64_Python313.zip)
76+
- [MacOS (Xcode 16, Python 3.13)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_MacOS_Xcode_16_Python313.zip)
77+
- [Linux (GCC 14, Python 3.13)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Linux_GCC_14_Python313.zip)
7878

7979
## Additional Resources
8080

documents/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ set(DOXYGEN_HTML_OUTPUT_DIR ${DOXYGEN_OUTPUT_DIR}/html)
33
set(DOXYGEN_INPUT_LIST ${CMAKE_CURRENT_BINARY_DIR}/MainPage.md)
44

55
set(MATERIALX_DOXYGEN_SOURCE_FOLDERS
6-
${CMAKE_SOURCE_DIR}/source/MaterialXCore
7-
${CMAKE_SOURCE_DIR}/source/MaterialXFormat
8-
${CMAKE_SOURCE_DIR}/source/MaterialXGenShader
9-
${CMAKE_SOURCE_DIR}/source/MaterialXGenShader/Nodes
10-
${CMAKE_SOURCE_DIR}/source/MaterialXGenGlsl
11-
${CMAKE_SOURCE_DIR}/source/MaterialXGenGlsl/Nodes
12-
${CMAKE_SOURCE_DIR}/source/MaterialXGenOsl
13-
${CMAKE_SOURCE_DIR}/source/MaterialXGenMdl
14-
${CMAKE_SOURCE_DIR}/source/MaterialXRender
15-
${CMAKE_SOURCE_DIR}/source/MaterialXRenderHw
16-
${CMAKE_SOURCE_DIR}/source/MaterialXRenderGlsl
17-
${CMAKE_SOURCE_DIR}/source/MaterialXRenderOsl)
6+
${PROJECT_SOURCE_DIR}/source/MaterialXCore
7+
${PROJECT_SOURCE_DIR}/source/MaterialXFormat
8+
${PROJECT_SOURCE_DIR}/source/MaterialXGenShader
9+
${PROJECT_SOURCE_DIR}/source/MaterialXGenShader/Nodes
10+
${PROJECT_SOURCE_DIR}/source/MaterialXGenGlsl
11+
${PROJECT_SOURCE_DIR}/source/MaterialXGenGlsl/Nodes
12+
${PROJECT_SOURCE_DIR}/source/MaterialXGenOsl
13+
${PROJECT_SOURCE_DIR}/source/MaterialXGenMdl
14+
${PROJECT_SOURCE_DIR}/source/MaterialXRender
15+
${PROJECT_SOURCE_DIR}/source/MaterialXRenderHw
16+
${PROJECT_SOURCE_DIR}/source/MaterialXRenderGlsl
17+
${PROJECT_SOURCE_DIR}/source/MaterialXRenderOsl)
1818

1919
find_package(Doxygen REQUIRED)
2020

documents/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ INPUT = ${DOXYGEN_INPUT_STR}
99
OUTPUT_DIRECTORY = ${DOXYGEN_OUTPUT_DIR}
1010
IMAGE_PATH = ${DOXYGEN_OUTPUT_DIR}
1111
HTML_OUTPUT = ${DOXYGEN_HTML_OUTPUT_DIR}
12-
STRIP_FROM_PATH = ${CMAKE_SOURCE_DIR}
12+
STRIP_FROM_PATH = ${PROJECT_SOURCE_DIR}
1313

1414
JAVADOC_AUTOBRIEF = YES
1515
HIDE_SCOPE_NAMES = YES

source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (MATERIALX_BUILD_MONOLITHIC)
1010

1111
# Create version resource
1212
if(MATERIALX_BUILD_SHARED_LIBS AND MSVC)
13-
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
13+
configure_file(${PROJECT_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
1414
target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
1515
endif()
1616

source/JsMaterialX/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(GENMSL ${CMAKE_CURRENT_SOURCE_DIR}/JsMaterialXGenMsl/)
88
set(GENVK ${CMAKE_CURRENT_SOURCE_DIR}/JsMaterialXGenVk/)
99
set(GENMDL ${CMAKE_CURRENT_SOURCE_DIR}/JsMaterialXGenMdl/)
1010

11-
set(SOURCE_FOLDER ${CMAKE_SOURCE_DIR}/source)
11+
set(SOURCE_FOLDER ${PROJECT_SOURCE_DIR}/source)
1212

1313
set(CORE_DEPS ${CORE}JsTypes.cpp
1414
${CORE}JsMaterial.cpp
@@ -85,7 +85,7 @@ else()
8585
endif()
8686

8787

88-
set(JS_LINK_FLAGS_GENSHADER "${JS_LINK_FLAGS_CORE} --preload-file ${CMAKE_SOURCE_DIR}/libraries@libraries ")
88+
set(JS_LINK_FLAGS_GENSHADER "${JS_LINK_FLAGS_CORE} --preload-file ${PROJECT_SOURCE_DIR}/libraries@libraries ")
8989

9090
add_executable(JsMaterialXCore MaterialXLib.cpp
9191
${CORE_DEPS}
@@ -157,12 +157,12 @@ install(TARGETS JsMaterialXCore DESTINATION "JavaScript/MaterialX")
157157
install(TARGETS JsMaterialXGenShader DESTINATION "JavaScript/MaterialX")
158158

159159
# Copy the wasm output
160-
install(FILES ${CMAKE_BINARY_DIR}/bin/JsMaterialXCore.wasm DESTINATION JavaScript/MaterialX/)
161-
install(FILES ${CMAKE_BINARY_DIR}/bin/JsMaterialXGenShader.wasm ${CMAKE_BINARY_DIR}/bin/JsMaterialXGenShader.data DESTINATION JavaScript/MaterialX/)
160+
install(FILES ${PROJECT_BINARY_DIR}/bin/JsMaterialXCore.wasm DESTINATION JavaScript/MaterialX/)
161+
install(FILES ${PROJECT_BINARY_DIR}/bin/JsMaterialXGenShader.wasm ${PROJECT_BINARY_DIR}/bin/JsMaterialXGenShader.data DESTINATION JavaScript/MaterialX/)
162162

163163
# Copy the JavaScript files with the version appended to them.
164-
install(FILES ${CMAKE_BINARY_DIR}/bin/JsMaterialXCore.js DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ RENAME JsMaterialXCore-${MATERIALX_LIBRARY_VERSION}.js)
164+
install(FILES ${PROJECT_BINARY_DIR}/bin/JsMaterialXCore.js DESTINATION ${PROJECT_BINARY_DIR}/ RENAME JsMaterialXCore-${MATERIALX_LIBRARY_VERSION}.js)
165165
install(FILES ${CMAKE_INSTALL_PREFIX}/JavaScript/MaterialX/JsMaterialXCore.js DESTINATION JavaScript/MaterialX/ RENAME JsMaterialXCore-${MATERIALX_LIBRARY_VERSION}.js)
166166

167-
install(FILES ${CMAKE_BINARY_DIR}/bin/JsMaterialXGenShader.js DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ RENAME JsMaterialXGenShader-${MATERIALX_LIBRARY_VERSION}.js)
167+
install(FILES ${PROJECT_BINARY_DIR}/bin/JsMaterialXGenShader.js DESTINATION ${PROJECT_BINARY_DIR}/ RENAME JsMaterialXGenShader-${MATERIALX_LIBRARY_VERSION}.js)
168168
install(FILES ${CMAKE_INSTALL_PREFIX}/JavaScript/MaterialX/JsMaterialXGenShader.js DESTINATION JavaScript/MaterialX/ RENAME JsMaterialXGenShader-${MATERIALX_LIBRARY_VERSION}.js)

source/MaterialXCore/Value.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,34 @@ string AggregateValue::getValueString() const
333333
return result;
334334
}
335335

336+
bool AggregateValue::isEqual(ConstValuePtr other) const
337+
{
338+
if (!other->isA<AggregateValue>())
339+
{
340+
return false;
341+
}
342+
343+
const AggregateValue& otherAggregate = other->asA<AggregateValue>();
344+
345+
size_t dataSize = _data.size();
346+
size_t otherDataSize = otherAggregate._data.size();
347+
348+
if (dataSize != otherDataSize)
349+
{
350+
return false;
351+
}
352+
353+
for (size_t i = 0; i < dataSize; i++)
354+
{
355+
if (!_data[i]->isEqual(otherAggregate._data[i]))
356+
{
357+
return false;
358+
}
359+
}
360+
361+
return true;
362+
}
363+
336364
AggregateValuePtr AggregateValue::createAggregateValueFromString(const string& value, const string& type, ConstTypeDefPtr typeDef)
337365
{
338366
StringVec subValues = parseStructValueString(value);

source/MaterialXCore/Value.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class MX_CORE_API Value
122122
return _floatPrecision;
123123
}
124124

125+
// Returns true if value data matches.
126+
virtual bool isEqual(ConstValuePtr other) const = 0;
127+
125128
protected:
126129
template <class T> friend class ValueRegistry;
127130

@@ -178,6 +181,16 @@ template <class T> class MX_CORE_API TypedValue : public Value
178181
/// Return value string.
179182
string getValueString() const override;
180183

184+
// Returns true if value data matches.
185+
bool isEqual(ConstValuePtr other) const override
186+
{
187+
if (!other || !other->isA<T>())
188+
{
189+
return false;
190+
}
191+
return _data == other->asA<T>();
192+
}
193+
181194
//
182195
// Static helper methods
183196
//
@@ -238,6 +251,9 @@ class MX_CORE_API AggregateValue : public Value
238251
/// Return value string.
239252
string getValueString() const override;
240253

254+
// Returns true if value data matches.
255+
bool isEqual(ConstValuePtr other) const override;
256+
241257
//
242258
// Static helper methods
243259
//

source/MaterialXTest/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ if(MATERIALX_BUILD_GEN_GLSL OR MATERIALX_BUILD_GEN_OSL OR MATERIALX_BUILD_GEN_MD
5858
if (NOT MATERIALX_BUILD_MONOLITHIC)
5959
get_target_property(MaterialXGenMdl_SOURCE_DIR MaterialXGenMdl SOURCE_DIR)
6060
else()
61-
get_target_property(MaterialX_SOURCE_DIR ${MATERIALX_MONOLITHIC_TARGET} SOURCE_DIR)
62-
set(MaterialXGenMdl_SOURCE_DIR "{MaterialX_SOURCE_DIR}/MaterialXGenMdl")
61+
get_target_property(PROJECT_SOURCE_DIR ${MATERIALX_MONOLITHIC_TARGET} SOURCE_DIR)
62+
set(MaterialXGenMdl_SOURCE_DIR "{PROJECT_SOURCE_DIR}/MaterialXGenMdl")
6363
endif()
6464
target_compile_definitions(MaterialXTest PRIVATE -DMATERIALX_MDL_IMPL_MODULE_PATH=\"${MaterialXGenMdl_SOURCE_DIR}/mdl\")
6565
endif()

0 commit comments

Comments
 (0)