Skip to content

Commit

Permalink
Merge branch 'dev_1.39' into update_stdlib_normalmap_for_1_39
Browse files Browse the repository at this point in the history
Signed-off-by: ld-kerley <[email protected]>
  • Loading branch information
ld-kerley authored Jan 26, 2024
2 parents 8319ff4 + 4d94b30 commit 67c99f2
Show file tree
Hide file tree
Showing 313 changed files with 5,087 additions and 4,733 deletions.
73 changes: 35 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ jobs:
python: 3.7
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON

- name: Linux_GCC_11_Python39
os: ubuntu-20.04
compiler: gcc
compiler_version: "11"
python: 3.9
build_javascript: ON

- name: Linux_GCC_12_Python311
os: ubuntu-22.04
compiler: gcc
compiler_version: "12"
python: 3.11
upload_shaders: ON
build_javascript: ON

- name: Linux_GCC_13_Python312
os: ubuntu-22.04
compiler: gcc
compiler_version: "13"
python: 3.12
static_analysis: ON
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Linux_GCC_CoverageAnalysis
os: ubuntu-22.04
Expand All @@ -53,20 +54,19 @@ jobs:
compiler_version: "10"
python: 3.7
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
static_analysis: ON

- name: Linux_Clang_14_Python311
- name: Linux_Clang_15_Python312
os: ubuntu-22.04
compiler: clang
compiler_version: "14"
python: 3.11
compiler_version: "15"
python: 3.12
test_render: ON
clang_format: ON

- name: Linux_Clang_14_DynamicAnalysis
- name: Linux_Clang_DynamicAnalysis
os: ubuntu-22.04
compiler: clang
compiler_version: "14"
compiler_version: "15"
python: None
cmake_config: -DMATERIALX_DYNAMIC_ANALYSIS=ON
dynamic_analysis: ON
Expand All @@ -78,17 +78,17 @@ jobs:
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
python: 3.7

- name: MacOS_Xcode_13_Python39
os: macos-12
compiler: xcode
compiler_version: "13.4"
python: 3.9

- name: MacOS_Xcode_14_Python311
os: macos-13
compiler: xcode
compiler_version: "14.3"
python: 3.11

- name: MacOS_Xcode_15_Python312
os: macos-13
compiler: xcode
compiler_version: "15.0"
python: 3.12
test_shaders: ON

- name: iOS_Xcode_15
Expand All @@ -104,18 +104,19 @@ jobs:
python: 3.7
cmake_config: -G "Visual Studio 16 2019" -A "Win32" -DMATERIALX_BUILD_SHARED_LIBS=ON

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

- name: Windows_VS2022_x64_Python311
- name: Windows_VS2022_x64_Python312
os: windows-2022
architecture: x64
python: 3.11
python: 3.12
cmake_config: -G "Visual Studio 17 2022" -A "x64"
test_shaders: ON
upload_shaders: ON

steps:
- name: Sync Repository
Expand Down Expand Up @@ -172,6 +173,10 @@ jobs:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}

- name: Install Python Dependencies
if: matrix.python != 'None'
run: pip install setuptools

- name: Install Emscripten
if: matrix.build_javascript == 'ON'
run: |
Expand All @@ -190,17 +195,13 @@ jobs:

- name: Run Clang Format
if: matrix.clang_format == 'ON'
run: find source \( -name *.h -o -name *.cpp -o -name *.mm \) ! -path "*/External/*" ! -path "*/NanoGUI/*" | xargs clang-format -i --verbose
run: find source \( -name *.h -o -name *.cpp -o -name *.mm -o -name *.inl \) ! -path "*/External/*" ! -path "*/NanoGUI/*" | xargs clang-format -i --verbose

- name: CMake Generate
run: |
mkdir build
cd build
cmake -DMATERIALX_BUILD_PYTHON=ON -DMATERIALX_BUILD_VIEWER=ON -DMATERIALX_BUILD_GRAPH_EDITOR=ON -DMATERIALX_TEST_RENDER=OFF -DMATERIALX_WARNINGS_AS_ERRORS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ${{matrix.cmake_config}} ..
run: cmake -S . -B build -DMATERIALX_BUILD_PYTHON=ON -DMATERIALX_BUILD_VIEWER=ON -DMATERIALX_BUILD_GRAPH_EDITOR=ON -DMATERIALX_TEST_RENDER=OFF -DMATERIALX_WARNINGS_AS_ERRORS=ON ${{matrix.cmake_config}}

- name: CMake Build
run: cmake --build . --target install --config Release --parallel 2
working-directory: build
run: cmake --build build --target install --config Release --parallel 2

- name: CMake Unit Tests
run: ctest -VV --output-on-failure --build-config Release
Expand Down Expand Up @@ -308,15 +309,11 @@ jobs:

- name: JavaScript CMake Generate
if: matrix.build_javascript == 'ON'
run: |
mkdir javascript/build
cd javascript/build
cmake -DMATERIALX_BUILD_JS=ON -DMATERIALX_EMSDK_PATH=${{ env.EMSDK }} -DMATERIALX_BUILD_RENDER=OFF -DMATERIALX_BUILD_TESTS=OFF -DMATERIALX_BUILD_GEN_OSL=OFF -DMATERIALX_BUILD_GEN_MDL=OFF ../..
run: cmake -S . -B javascript/build -DMATERIALX_BUILD_JS=ON -DMATERIALX_EMSDK_PATH=${{ env.EMSDK }}

- name: JavaScript CMake Build
if: matrix.build_javascript == 'ON'
run: cmake --build . --target install --config Release --parallel 2
working-directory: javascript/build
run: cmake --build javascript/build --target install --config Release --parallel 2

- name: JavaScript Unit Tests
if: matrix.build_javascript == 'ON'
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

## [1.38.9] - Development

### Added

- Added a [non-photorealistic rendering](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1631) data library to MaterialX, initially consisting of a single 'viewdirection' node.
- Added support for the generation of [pre-filtered environment maps](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1420) in MaterialX GLSL and MSL.
- Added support for the [creatematrix node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1553) in shader generation.
- Added [floating popups](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1565) for hovered pins in the MaterialX Graph Editor.
- Added support for [UI attributes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1623) and [enumerated values](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1632) in the MaterialX Web Viewer.
- Added [UI ranges](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1646) to the 'useSpecularWorkflow' and 'normal' inputs of the UsdPreviewSurface shading model.
- Added [versioning rules](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1664) for the MaterialX API and data libraries to the developer guide.
- Added initial C++ [fuzz tests](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1605) and [coverage tests](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1548) to GitHub Actions CI.
- Added [GCC 13, Clang 15](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1602), and [Python 3.12](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1588) builds to GitHub Actions CI.

### Changed

- Improved the logic for [connecting pins](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1569) in the MaterialX Graph Editor.
- Improved the robustness of [type pointer comparisons](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1665) in shader generation.
- Improved the handling of [filename inputs](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1547) in OSL shader generation.
- Reduced the size of the MaterialX data libraries, improving the use of [graph definitions](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1653) and merging [duplicate implementations](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1642).
- Updated the MaterialX Web Viewer to [three.js r152](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1615).
- Switched to a more efficient representation of [HDR images](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1616) in the MaterialX Web Viewer.
- Raised the minimum CMake version to [CMake 3.16](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1607).
- Updated the C++ unit test library to [Catch 2.13.10](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1566).

### Fixed

- Fixed the attenuation of [coated emission](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1534) in the Standard Surface shading model.
- Fixed the implementation of the [overlay node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1539) in shader generation.
- Fixed an edge case for [transform nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1560) in GLSL and MSL shader generation.
- Fixed the implementation of [mx_hsvtorgb](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1584) in MDL shader generation.
- Fixed [scroll wheel interactions](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1578) across windows of the MaterialX Graph Editor.
- Fixed the generation of unused [imgui.ini files](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1570) in the MaterialX Graph Editor.
- Fixed a dependency on [module import order](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1595) in MaterialX Python.
- Fixed an [off-by-one index check](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1582) in Element::setChildIndex.
- Fixed a [missing null check](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1601) in Graph::propertyEditor.
- Fixed cases where [absolute paths](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1603) were stored in MaterialXConfig.cmake.

## [1.38.8] - 2023-09-08

### Added
Expand Down
47 changes: 27 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(MATERIALX_BUILD_VERSION 0)
set(MATERIALX_LIBRARY_VERSION ${MATERIALX_MAJOR_VERSION}.${MATERIALX_MINOR_VERSION}.${MATERIALX_BUILD_VERSION})

# Cmake setup
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_MACOSX_RPATH ON)
Expand Down Expand Up @@ -45,6 +45,7 @@ option(MATERIALX_BUILD_GEN_MSL "Build the MSL shader generator back-end." ON)
option(MATERIALX_BUILD_RENDER "Build the MaterialX Render modules." ON)
option(MATERIALX_BUILD_OIIO "Build OpenImageIO support for MaterialXRender." OFF)
option(MATERIALX_BUILD_TESTS "Build unit tests." ON)
option(MATERIALX_BUILD_BENCHMARK_TESTS "Build benchmark tests." OFF)

option(MATERIALX_BUILD_SHARED_LIBS "Build MaterialX libraries as shared rather than static." OFF)
option(MATERIALX_PYTHON_LTO "Enable link-time optimizations for MaterialX Python." ON)
Expand All @@ -60,13 +61,21 @@ option(MATERIALX_BUILD_IOS "Build MaterialX for iOS." OFF)
if (MATERIALX_BUILD_IOS)
set(CMAKE_SYSTEM_NAME iOS)
add_definitions(-DTARGET_OS_IOS=1)
set(MATERIALX_BUILD_PYTHON OFF)
set(MATERIALX_BUILD_VIEWER OFF)
set(MATERIALX_BUILD_GRAPH_EDITOR OFF)
set(MATERIALX_BUILD_GEN_GLSL OFF)
set(MATERIALX_BUILD_GEN_OSL OFF)
set(MATERIALX_BUILD_GEN_MDL OFF)
set(MATERIALX_BUILD_TESTS OFF)
set(MATERIALX_BUILD_PYTHON OFF)
set(MATERIALX_BUILD_VIEWER OFF)
set(MATERIALX_BUILD_GRAPH_EDITOR OFF)
set(MATERIALX_BUILD_GEN_GLSL OFF)
set(MATERIALX_BUILD_GEN_OSL OFF)
set(MATERIALX_BUILD_GEN_MDL OFF)
set(MATERIALX_BUILD_TESTS OFF)
endif()

if (MATERIALX_BUILD_JS)
set(MATERIALX_BUILD_GEN_OSL OFF)
set(MATERIALX_BUILD_GEN_MSL OFF)
set(MATERIALX_BUILD_GEN_MDL OFF)
set(MATERIALX_BUILD_RENDER OFF)
set(MATERIALX_BUILD_TESTS OFF)
endif()

set(MATERIALX_PYTHON_VERSION "" CACHE STRING
Expand All @@ -80,10 +89,6 @@ set(MATERIALX_PYTHON_PYBIND11_DIR "" CACHE PATH

set(MATERIALX_OIIO_DIR "" CACHE PATH "Path to the root folder of the OpenImageIO installation.")

if (MATERIALX_BUILD_JS)
set(MATERIALX_BUILD_GEN_GLSL ON)
endif()

# Settings to define installation layout
set(MATERIALX_INSTALL_INCLUDE_PATH "include" CACHE STRING "Install header include path (e.g. 'inc', 'include').")
set(MATERIALX_INSTALL_LIB_PATH "lib" CACHE STRING "Install lib path (e.g. 'libs', 'lib').")
Expand Down Expand Up @@ -131,6 +136,7 @@ mark_as_advanced(MATERIALX_BUILD_GEN_MSL)
mark_as_advanced(MATERIALX_BUILD_RENDER)
mark_as_advanced(MATERIALX_BUILD_OIIO)
mark_as_advanced(MATERIALX_BUILD_TESTS)
mark_as_advanced(MATERIALX_BUILD_BENCHMARK_TESTS)
mark_as_advanced(MATERIALX_BUILD_SHARED_LIBS)
mark_as_advanced(MATERIALX_NAMESPACE_SUFFIX)
mark_as_advanced(MATERIALX_LIBNAME_SUFFIX)
Expand Down Expand Up @@ -177,6 +183,9 @@ endif()
if(MATERIALX_TEST_RENDER)
add_definitions(-DMATERIALX_TEST_RENDER)
endif()
if (MATERIALX_BUILD_BENCHMARK_TESTS)
add_definitions(-DMATERIALX_BUILD_BENCHMARK_TESTS)
endif()

if (MATERIALX_BUILD_GEN_MDL)
add_definitions(-DMATERIALX_MDLC_EXECUTABLE=\"${MATERIALX_MDLC_EXECUTABLE}\")
Expand Down Expand Up @@ -334,14 +343,12 @@ if(MATERIALX_BUILD_JS)
add_subdirectory(source/JsMaterialX)
endif()

if(${CMAKE_VERSION} VERSION_GREATER "3.6.2")
if(MATERIALX_BUILD_VIEWER)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXView)
elseif(MATERIALX_BUILD_GRAPH_EDITOR)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXGraphEditor)
elseif(MATERIALX_BUILD_TESTS)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXTest)
endif()
if(MATERIALX_BUILD_VIEWER)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXView)
elseif(MATERIALX_BUILD_GRAPH_EDITOR)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXGraphEditor)
elseif(MATERIALX_BUILD_TESTS)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MaterialXTest)
endif()

# Install root-level documents
Expand Down
4 changes: 2 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The current Voting Members of the MaterialX TSC are:
- Doug Smythe - Industrial Light & Magic
- Niklas Harrysson - Lumiere Software
- Orn Gunnarsson - Autodesk
- David Larsson - Adobe
- Andréa Machizaud - Adobe

### Stakeholders

Expand All @@ -68,8 +68,8 @@ The current Stakeholders of the MaterialX TSC are:
- Rafal Jaroszkiewicz - SideFX
- Lee Kerley - Sony Pictures Imageworks
- Lutz Kettner - NVIDIA
- Chris Kulla - Epic Games
- Bernard Kwok - Khronos Group
- Jonathan Litt - Epic Games
- André Mazzone - ILM
- Magnus Pettersson - IKEA
- Brian Savery - AMD
Expand Down
19 changes: 17 additions & 2 deletions documents/DeveloperGuide/MainPage.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,24 @@ Building the `install` target of your project will install the MaterialX C++ and

### MaterialX Versioning

The MaterialX codebase uses a modified semantic versioning system where the *major* and *minor* versions match that of the corresponding MaterialX [specification](https://www.materialx.org/Specification.html), and the *build* version represents engineering advances within that specification version. MaterialX documents are similarly marked with the specification version they were authored in, and they are valid to load into any MaterialX codebase with an equal or higher specification version.
The MaterialX codebase uses a modified semantic versioning system where the *major* and *minor* versions match that of the corresponding MaterialX [specification](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/documents/Specification/MaterialX.Specification.md), and the *build* version represents engineering advances within that specification version. MaterialX documents are similarly marked with the specification version they were authored in, and they are valid to load into any MaterialX codebase with an equal or higher specification version.

Upgrading of MaterialX documents from earlier versions is handled at import time by the Document::upgradeVersion method, which applies the syntax and node interface upgrades that have occurred in previous specification revisions. This allows the syntax conventions of MaterialX and the names and interfaces of nodes to evolve over time, without invalidating documents from earlier versions.
Upgrading of MaterialX documents from earlier versions is handled at import time by the `Document::upgradeVersion` method, which applies the syntax and node interface upgrades that have occurred in previous specification revisions. This allows the syntax conventions of MaterialX and the names and interfaces of nodes to evolve over time, without invalidating documents from earlier versions.

#### MaterialX API Changes

The following rules describe the categories of changes to the [MaterialX API](https://materialx.org/docs/api/classes.html) that are allowed in version upgrades:

- In *build* version upgrades, only non-breaking changes to the MaterialX API are allowed. For any API call that is modified in a build version upgrade, backwards compatibility should be maintained using deprecated C++ and Python wrappers for the original API call.
- In *minor* and *major* version upgrades, breaking changes to the MaterialX API are allowed, though their benefit should be carefully weighed against their cost. Any breaking changes to API calls should be highlighted in the release notes for the new version.

#### MaterialX Data Library Changes

The following rules describe the categories of changes to the [MaterialX Data Libraries](https://github.com/AcademySoftwareFoundation/MaterialX/tree/main/libraries) that are allowed in version upgrades:

- In *build* version upgrades, only additive changes and fixes to the MaterialX data libraries are allowed. Additive changes are allowed to introduce new nodes, node versions, and node inputs with backwards-compatible default values. Data library fixes are allowed to update a node implementation to improve its alignment with the specification, without making any changes to its name or interface.
- In *minor* version upgrades, changes to the names and interfaces of MaterialX nodes are allowed, with the requirement that version upgrade logic be used to maintain the validity and visual interpretation of documents from earlier versions.
- In *major* version upgrades, changes to the syntax rules of MaterialX documents are allowed, with the requirement that version upgrade logic be used to maintain the validity and visual interpretation of documents from earlier versions. These changes usually require synchronized updates to both the MaterialX API and data libraries.

### Additional Links

Expand Down
4 changes: 2 additions & 2 deletions documents/Specification/MaterialX.Specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m

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

* **`atan2`**: the arctangent of the expression (iny/inx); the output will be expressed in radians. If both `in1` and `in2` are provided, they must be the same type.
* **`atan2`**: the arctangent of the expression (iny/inx); the output will be expressed in radians. If both `iny` and `inx` are provided, they must be the same type.
* `iny` (float or vector<em>N</em>): the value or nodename for the "y" input; default is 0.0.
* `inx` (float or vector<em>N</em>): the value or nodename for the "x" input; default is 1.0.

Expand Down Expand Up @@ -1496,7 +1496,7 @@ Blend nodes take two 1-4 channel inputs and apply the same operator to all chann
| **`burn`** | 1-(1-B)/F | float, color<em>N</em> |
| **`dodge`** | B/(1-F) | float, color<em>N</em> |
| **`screen`** | 1-(1-F)(1-B) | float, color<em>N</em> |
| **`overlay`** | 2FB if F&lt;0.5;<br> 1-(1-F)(1-B) if F>=0.5 | float, color<em>N</em> |
| **`overlay`** | 2FB if B&lt;0.5;<br> 1-2(1-F)(1-B) if B>=0.5 | float, color<em>N</em> |


#### Merge Nodes
Expand Down
Loading

0 comments on commit 67c99f2

Please sign in to comment.