Skip to content

Commit

Permalink
Merge branch 'main' into simplify_osl_test_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ld-kerley authored Jul 23, 2024
2 parents f5ed01a + 3a5b53b commit 0c5594f
Show file tree
Hide file tree
Showing 322 changed files with 6,500 additions and 4,711 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
python: 3.11
build_javascript: ON

- name: Linux_GCC_13_Python312
- name: Linux_GCC_14_Python312
os: ubuntu-24.04
compiler: gcc
compiler_version: "13"
compiler_version: "14"
python: 3.12
static_analysis: ON
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Expand Down Expand Up @@ -104,18 +104,18 @@ jobs:
python: 3.7
cmake_config: -G "Visual Studio 16 2019" -A "Win32" -DMATERIALX_BUILD_SHARED_LIBS=ON

- name: Windows_VS2019_x64_Python311
os: windows-2019
- name: Windows_VS2022_x64_Python311
os: windows-2022
architecture: x64
python: 3.11
cmake_config: -G "Visual Studio 16 2019" -A "x64"
cmake_config: -G "Visual Studio 17 2022" -A "x64"
test_shaders: ON

- name: Windows_VS2019_x64_Python312
os: windows-2019
- name: Windows_VS2022_x64_Python312
os: windows-2022
architecture: x64
python: 3.12
cmake_config: -G "Visual Studio 16 2019" -A "x64"
cmake_config: -G "Visual Studio 17 2022" -A "x64"
upload_shaders: ON

steps:
Expand Down Expand Up @@ -383,7 +383,7 @@ jobs:
fail-fast: false
matrix:
python-minor: ['7', '8', '9', '10', '11', '12']
os: ['ubuntu-latest', 'windows-2019', 'macos-13']
os: ['ubuntu-latest', 'windows-2022', 'macos-13']

steps:
- name: Sync Repository
Expand All @@ -401,7 +401,7 @@ jobs:
path: sdist

- name: Build Wheel
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.19.2
with:
package-dir: ${{ github.workspace }}/sdist/${{ needs.sdist.outputs.sdist_filename }}
env:
Expand Down
26 changes: 18 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# Change Log

## [1.39.0] - Development
## [1.39.1] - Development

## [1.39.0] - 2024-07-05

### Added
- Added a [MaterialX implementation](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1816) of the [OpenPBR Surface](https://academysoftwarefoundation.github.io/OpenPBR/) shading model.
- Added support for [Hoffman-Schlick Fresnel](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1727), [Zeltner-Burley sheen](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1825), and [energy-compensated Oren-Nayar diffuse](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1822) in physically based shading.
- Added support for the [OpenPBR Surface](https://academysoftwarefoundation.github.io/OpenPBR/) shading model, including the [MaterialX definition](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/bxdf/open_pbr_surface.mtlx) and [example materials](https://github.com/AcademySoftwareFoundation/MaterialX/tree/main/resources/Materials/Examples/OpenPbr) for OpenPBR Surface v1.1.
- Added support for [Hoffman-Schlick Fresnel](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1727), [Zeltner sheen](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1880), and [energy-compensated Oren-Nayar diffuse](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1822), with initial implementations in hardware shading languages.
- Added support for the [LamaGeneralizedSchlick and LamaIridescence](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1897) nodes, with definitions provided as MaterialX graphs.
- Added support for integer-type [add, subtract](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1777), and [conditional](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1786) nodes.
- Added support for matrix-type [switch](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1779) and [conditional](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1780) nodes.
- Added support for additional [convert node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1905) input and output types.
- Added support for [monolithic builds](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1725) of MaterialX.
- Added support for [Python 3.12](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1802) in Python wheel generation.
- Added support for the [full set of shader generators](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1771) in JavaScript.
- Added an example script to [generate a MaterialX document](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1746) from a folder of textures.
- Added support for [frame timing](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1739) in the MaterialX Viewer.
- Added a [uiScale option](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1586) for adjusting DPI in the Graph Editor.
- Added an example script to [generate a MaterialX document](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1746) from a folder of textures.
- Added unit tests for [core utilities](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1768) and [ESSL shader generation](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1781).
- Added support for [Python 3.12](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1802) in Python wheel generation.
- Added [GCC 14](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1913) and [Clang 18](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1820) builds to GitHub Actions CI.

### Changed
- Raised the minimum C++ version for MaterialX builds to [C++17](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1712).
- Updated the [PyBind11 library](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1839) to version 2.12.0, enabling support for recent compilers and CMake versions.
- Improved the expression of [thin-film layering](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1413) in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Improved the generality of the [normalmap node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1911) in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Extended the [switch node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1660) to ten inputs in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Renamed the inputs of the [atan2 node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1659) in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Changed the type of [subsurface_bsdf radius](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1834) from vector3 to color3 in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Renamed the [normalmap nodedef](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1677) in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Improved the support for [double-sided materials](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1866) in MaterialX 1.39.
- Optimized [Fresnel](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1732) [computations](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1733) in [GLSL](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1736), improving the performance of physically based shading in real-time renders.
- Applied [lossless optimization](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1738) to PNG and JPG textures in the MaterialX repository.

### Fixed
- Fixed default values for the [creatematrix node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1788).
- Fixed an issue with [keyboard input focus](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1596) in the Graph Editor.

### Removed
- Removed the [swizzle node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1793) in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Removed the [channels attribute](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1804) in MaterialX 1.39, with automatic upgrade logic for legacy documents.
- Removed the unimplemented [arrayappend node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1707) in MaterialX 1.39.

### Fixed
- Fixed default values for the [creatematrix node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1788).

## [1.38.10] - 2024-04-12

### Added
Expand Down
58 changes: 43 additions & 15 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 @@ -246,6 +246,9 @@ endif()
# Adjust compiler settings
if(MSVC)
add_compile_options(/MP)
if(MATERIALX_BUILD_MONOLITHIC)
add_compile_options(/bigobj)
endif()
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
Expand Down Expand Up @@ -293,6 +296,7 @@ function(mx_add_library MATERIALX_MODULE_NAME)
set(multiValueArgs
SOURCE_FILES
HEADER_FILES
INLINED_FILES
LIBRARIES)
cmake_parse_arguments(args
"${options}"
Expand All @@ -308,11 +312,12 @@ 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)
Expand Down Expand Up @@ -343,18 +348,29 @@ 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()

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}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>)

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

Expand All @@ -364,15 +380,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 @@ -463,6 +474,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
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
30 changes: 16 additions & 14 deletions documents/Specification/MaterialX.NPRSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ MaterialX NPR Shading Nodes v1.39

# MaterialX NPR Shading Nodes

**Version 1.39**
Doug Smythe - Industrial Light & Magic
Jonathan Stone - Lucasfilm Advanced Development Group
May 1, 2024
**Version 1.39**
Doug Smythe - Industrial Light & Magic
Jonathan Stone - Lucasfilm Advanced Development Group
July 1, 2024

# Introduction

Expand All @@ -24,9 +24,10 @@ This document describes a number of MaterialX nodes primarily applicable to non-
[NPR Utility Nodes](#npr-utility-nodes)
[NPR Shading Nodes](#npr-shading-nodes)

**[References](#references)**


## MaterialX NPR Library
# MaterialX NPR Library


## NPR Application Nodes
Expand All @@ -35,13 +36,8 @@ This document describes a number of MaterialX nodes primarily applicable to non-

* **`viewdirection`**: the current scene view direction (e.g. from the viewing/camera position to the current shading position). If `viewdirection` is used in a PBR shading context, it should be noted that this would be the same as the incident ray direction for primary ("camera") rays but **not** for secondary/reflection rays. This node must be of type vector3.

* `space` (uniform string): the space in which to return the view vector direction, defaults to "world".
* `space` (uniform string): the space in which to return the view vector direction, defaults to `world`.

<a id="node-lightdirection"> </a>

* **`lightdirection`**: the predominant incoming light direction, as defined by the shading environment. This node must be of type vector3.

* `space` (uniform string): the space in which to return the lighting vector direction, defaults to "world".


## NPR Utility Nodes
Expand All @@ -61,9 +57,15 @@ This document describes a number of MaterialX nodes primarily applicable to non-

<a id="node-gooch-shade"> </a>

* **`gooch_shade`**: Compute Gooch Shading ([https://en.wikipedia.org/wiki/Gooch_shading](https://en.wikipedia.org/wiki/Gooch_shading) [https://users.cs.northwestern.edu/~ago820/SIG98/gooch98.pdf](https://users.cs.northwestern.edu/~ago820/SIG98/gooch98.pdf)). Output type "surfaceshader".
* `warm_color` (color3): the "warm" color for shading, defaults to (0.8, 0.8, 0.7) in the "lin_rec709" colorspace.
* `cool_color` (color3): the "cool" color for shading, defaults to (0.3, 0.3, 0.8) in the "lin_rec709" colorspace.
* **`gooch_shade`**: Computes the single-pass shading portion of the Gooch[^Gooch1998] lighting model. Output type `surfaceshader`.
* `warm_color` (color3): the "warm" color for shading, defaults to (0.8, 0.8, 0.7) in the `lin_rec709` colorspace.
* `cool_color` (color3): the "cool" color for shading, defaults to (0.3, 0.3, 0.8) in the `lin_rec709` colorspace.
* `specular_intensity` (float): the intensity of the specular component. Defaults to 1.0.
* `shininess` (float): the specular power typically ranging from 1 to 256, defaults to 64.
* `light_direction` (vector3): the incoming predominant lighting direction in world space, defaults to (1.0, -0.5, -0.5).



# References

[^Gooch1998]: Gooch et al., **A Non-Photorealistic Lighting Model For Automatic Technical Illustration**, <https://users.cs.northwestern.edu/~ago820/SIG98/gooch98.pdf>, 1998.
Loading

0 comments on commit 0c5594f

Please sign in to comment.