Skip to content

Commit

Permalink
Merge branch 'main' into gamaj/opencolorio_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Aug 20, 2024
2 parents 23e8128 + 153a803 commit 9130574
Show file tree
Hide file tree
Showing 96 changed files with 2,134 additions and 1,223 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Change Log

## [1.39.1] - Release Candidate

### Added
- Added initial shader translation graphs between [Standard Surface](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1934) and [OpenPBR Surface](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1949).
- Added initial support for [code generation hints](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1954).

### Changed
- Raised the minimum CMake version to [CMake 3.24](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1929).
- Moved feature proposals from the main specification to a new [MaterialX Proposals](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1953) document.
- Updated the open definitions of the [MaterialX Lama nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1955) to improve alignment with RenderMan.

### Fixed
- Fixed errors in the [installation steps](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1923) for CMake builds.
- Fixed the computation of [Fresnel transmission](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1962) in GLSL.
- Fixed transposed matrices in color transforms for the [displayp3 space](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1960).
- Fixed edge cases in the version upgrade process for [swizzle](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1945) [nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1957).
- Fixed a crash in the Graph Editor when [renaming a node graph](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1930).
- Fixed the exporting of [PugiXML symbols](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1944) in MaterialXFormat.

### Removed
- Removed an extra installation of the [resources folder](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1927) in MaterialXGenShader.

## [1.39.0] - 2024-07-05

### Added
Expand Down
88 changes: 69 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# MaterialX Version
set(MATERIALX_MAJOR_VERSION 1)
set(MATERIALX_MINOR_VERSION 39)
set(MATERIALX_BUILD_VERSION 0)
set(MATERIALX_BUILD_VERSION 1)
set(MATERIALX_LIBRARY_VERSION ${MATERIALX_MAJOR_VERSION}.${MATERIALX_MINOR_VERSION}.${MATERIALX_BUILD_VERSION})

# Cmake setup
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.24)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_MACOSX_RPATH ON)
Expand Down Expand Up @@ -182,10 +182,23 @@ if (MATERIALX_BUILD_USE_CCACHE)
endif()
endif()

# Attempt to configure OSL testing if it can be found by cmake.
# This will not override any explicitly provided oslc and testrender
if(MATERIALX_BUILD_RENDER AND MATERIALX_BUILD_GEN_OSL AND MATERIALX_BUILD_TESTS)
# We currently only need the actual OSL binaries if we're running tests with Render and GenOSL enabled.
find_package(OSL QUIET)
if(OSL_FOUND)
if(NOT MATERIALX_OSL_BINARY_OSLC)
set(MATERIALX_OSL_BINARY_OSLC $<TARGET_FILE:OSL::oslc>)
endif()
if(NOT MATERIALX_OSL_BINARY_TESTRENDER)
# currently OSL does not export a cmake target for testrender, but once that's added this can be simplified.
set(MATERIALX_OSL_BINARY_TESTRENDER $<TARGET_FILE_DIR:OSL::oslc>/testrender)
endif()
endif()
endif()

# Add global definitions
add_definitions(-DMATERIALX_OSL_BINARY_OSLC=\"${MATERIALX_OSL_BINARY_OSLC}\")
add_definitions(-DMATERIALX_OSL_BINARY_TESTRENDER=\"${MATERIALX_OSL_BINARY_TESTRENDER}\")
add_definitions(-DMATERIALX_OSL_INCLUDE_PATH=\"${MATERIALX_OSL_INCLUDE_PATH}\")
if (MATERIALX_OSL_LEGACY_CLOSURES)
add_definitions(-DMATERIALX_OSL_LEGACY_CLOSURES)
endif()
Expand Down Expand Up @@ -288,7 +301,9 @@ function(mx_add_library MATERIALX_MODULE_NAME)
set(multiValueArgs
SOURCE_FILES
HEADER_FILES
LIBRARIES)
INLINED_FILES
LIBRARIES
PRIVATE_LIBRARIES)
cmake_parse_arguments(args
"${options}"
"${oneValueArgs}"
Expand All @@ -303,23 +318,28 @@ function(mx_add_library MATERIALX_MODULE_NAME)
endif()

assign_source_group("Source Files" ${args_SOURCE_FILES})
assign_source_group("Source Files" ${args_INLINED_FILES})
assign_source_group("Header Files" ${args_HEADER_FILES})

if (NOT MATERIALX_BUILD_MONOLITHIC)
set(TARGET_NAME ${MATERIALX_MODULE_NAME})
add_library(${TARGET_NAME} ${args_SOURCE_FILES} ${args_HEADER_FILES})
add_library(${TARGET_NAME})

# Create version resource
if(MATERIALX_BUILD_SHARED_LIBS AND MSVC)
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
target_sources(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()

target_link_libraries(
${TARGET_NAME}
target_link_libraries(${TARGET_NAME}
PUBLIC
${args_LIBRARIES}
${CMAKE_DL_LIBS})

target_link_libraries(${TARGET_NAME}
PRIVATE
${args_PRIVATE_LIBRARIES})

target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
Expand All @@ -338,15 +358,33 @@ function(mx_add_library MATERIALX_MODULE_NAME)
else()
set(TARGET_NAME ${MATERIALX_MONOLITHIC_TARGET})

target_sources(${TARGET_NAME} PRIVATE ${args_SOURCE_FILES})
target_sources(${TARGET_NAME} PRIVATE ${args_HEADER_FILES})

add_library(${MATERIALX_MODULE_NAME} ALIAS ${MATERIALX_MONOLITHIC_TARGET})

# Store the aliased MaterialX modules name to create cmake export aliases later.
set_property(GLOBAL APPEND PROPERTY MATERIALX_MODULES ${MATERIALX_MODULE_NAME})
endif()

set_target_properties(${TARGET_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(${TARGET_NAME} PROPERTIES CMAKE_VISIBILITY_INLINES_HIDDEN 1)

target_sources(${TARGET_NAME}
PRIVATE
${args_SOURCE_FILES}
PUBLIC
FILE_SET
mxHeaders
TYPE
HEADERS
BASE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_BINARY_DIR}/..
FILES
${args_HEADER_FILES}
${args_INLINED_FILES})

target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>)

target_compile_definitions(${TARGET_NAME} PRIVATE "-D${args_EXPORT_DEFINE}")

if(NOT SKBUILD)
Expand All @@ -355,15 +393,10 @@ function(mx_add_library MATERIALX_MODULE_NAME)
EXPORT MaterialX
ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH}
LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH}
RUNTIME DESTINATION bin)
RUNTIME DESTINATION bin
FILE_SET mxHeaders)
endif()

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER
FILES_MATCHING
PATTERN "*.h*"
PATTERN "*.inl")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb"
DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL)
endif()
Expand Down Expand Up @@ -454,6 +487,23 @@ if(MATERIALX_BUILD_JS)
add_subdirectory(source/JsMaterialX)
endif()

if (MATERIALX_BUILD_MONOLITHIC)
# MaterialX monolithic build target needs to be installed after any other included
# modules to ensure the correct files are in mxHeaders
if(NOT SKBUILD)
install(TARGETS ${MATERIALX_MONOLITHIC_TARGET}
EXPORT MaterialX
ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH}
LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH}
RUNTIME DESTINATION bin
FILE_SET mxHeaders)

# Note : we don't install the headers etc. here, and rely on each separate modules CMakeLists.txt
# to do that installation, thus we respect the build options configuration, and only install
# the headers for the modules we've built in to the monolithic build.
endif()
endif()

if(MATERIALX_BUILD_VIEWER)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXView)
elseif(MATERIALX_BUILD_GRAPH_EDITOR)
Expand Down
4 changes: 2 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ The current Stakeholders of the MaterialX TSC are:

- Henrik Edstrom - Autodesk
- Fran González García - Pixar RenderMan
- Dhruv Govil - Apple
- Rafal Jaroszkiewicz - SideFX
- Ole Gulbrandsen - Sony Pictures Imageworks
- Rafal Jaroszkiewicz - SideFX
- Lee Kerley - Apple
- Lutz Kettner - NVIDIA
- Chris Kulla - Epic Games
- Bernard Kwok - Khronos Group
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ The Open Chess Set is an open reference asset, consisting of a [MaterialX file](

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

- [Microsoft Windows (Visual Studio 2022, Python 3.11)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Windows_VS2022_x64_Python311.zip)
- [MacOS (Xcode 14, Python 3.11)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_MacOS_Xcode_14_Python311.zip)
- [Linux (GCC 12, Python 3.11)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Linux_GCC_12_Python311.zip)
- [Microsoft Windows (Visual Studio 2022, Python 3.12)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Windows_VS2022_x64_Python312.zip)
- [MacOS (Xcode 15, Python 3.12)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_MacOS_Xcode_15_Python312.zip)
- [Linux (GCC 14, Python 3.12)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest/download/MaterialX_Linux_GCC_14_Python312.zip)

### Additional Resources

Expand Down
2 changes: 2 additions & 0 deletions documents/Specification/MaterialX.PBRSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ This document describes a number of shader-semantic nodes implementing widely-us
**[Shading Model Examples](#shading-model-examples)**
[Autodesk Standard Surface](#autodesk-standard-surface)
[UsdPreviewSurface](#usdpreviewsurface)
[Khronos glTF PBR](#khronos-gltf-pbr)
[OpenPBR Surface](#openpbr-surface)

**[References](#references)**

Expand Down
Loading

0 comments on commit 9130574

Please sign in to comment.