Skip to content

Commit

Permalink
Merge branch 'main' into python_stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
joaovbs96 authored Dec 18, 2024
2 parents 112587d + af74b61 commit f4a16a7
Show file tree
Hide file tree
Showing 206 changed files with 5,792 additions and 4,290 deletions.
48 changes: 27 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: Linux_GCC_9_Python37
os: ubuntu-20.04
- name: Linux_GCC_10_Python37
os: ubuntu-22.04
compiler: gcc
compiler_version: "9"
compiler_version: "10"
python: 3.7
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON -DMATERIALX_BUILD_MONOLITHIC=ON

Expand All @@ -37,8 +37,6 @@ jobs:
compiler: gcc
compiler_version: "14"
python: 3.12
static_analysis: ON
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Linux_GCC_CoverageAnalysis
os: ubuntu-24.04
Expand All @@ -48,10 +46,10 @@ jobs:
coverage_analysis: ON
cmake_config: -DMATERIALX_COVERAGE_ANALYSIS=ON -DMATERIALX_BUILD_RENDER=OFF -DMATERIALX_BUILD_PYTHON=OFF

- name: Linux_Clang_10_Python37
os: ubuntu-20.04
- name: Linux_Clang_13_Python37
os: ubuntu-22.04
compiler: clang
compiler_version: "10"
compiler_version: "13"
python: 3.7
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON

Expand All @@ -63,18 +61,20 @@ jobs:
test_render: ON
clang_format: ON

- name: MacOS_Xcode_13_Python39
os: macos-12
- name: MacOS_Xcode_14_Python39
os: macos-13
compiler: xcode
compiler_version: "13.1"
compiler_version: "14.1"
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
python: 3.9

- name: MacOS_Xcode_14_Python311
- name: MacOS_Xcode_15_Python311
os: macos-14
compiler: xcode
compiler_version: "14.3"
compiler_version: "15.1"
python: 3.11
static_analysis: ON
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: MacOS_Xcode_15_Python312
os: macos-14
Expand Down Expand Up @@ -127,6 +127,7 @@ jobs:
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install xorg-dev
if [ "${{ matrix.compiler_version }}" != 'None' ]; then
if [ "${{ matrix.compiler }}" = "gcc" ]; then
Expand Down Expand Up @@ -228,13 +229,14 @@ jobs:
run: |
vcpkg/vcpkg install glslang --triplet=x64-windows
glslangValidator.exe -v
python python/Scripts/generateshader.py resources/Materials/Examples/StandardSurface --target glsl --validator glslangValidator.exe --vulkanGlsl True --validatorArgs="-V --aml"
python python/Scripts/generateshader.py resources/Materials/Examples/StandardSurface --target essl --validator glslangValidator.exe
python python/Scripts/generateshader.py resources/Materials/Examples --target glsl --validator glslangValidator.exe
python python/Scripts/generateshader.py resources/Materials/Examples --target essl --validator glslangValidator.exe
- name: Shader Validation Tests (MacOS)
if: matrix.test_shaders == 'ON' && runner.os == 'macOS'
run: |
python python/Scripts/generateshader.py resources/Materials/Examples/StandardSurface --target msl --validator "xcrun metal --language=metal" --validatorArgs="-w"
python python/Scripts/generateshader.py resources/Materials/Examples --target msl --validator "xcrun metal --language=metal" --validatorArgs="-w"
python python/Scripts/generateshader.py resources/Materials/TestSuite/stdlib --target msl --validator "xcrun metal --language=metal" --validatorArgs="-w"
- name: Coverage Analysis Tests
if: matrix.coverage_analysis == 'ON'
Expand All @@ -245,10 +247,14 @@ jobs:
working-directory: build

- name: Static Analysis Tests
if: matrix.static_analysis == 'ON' && runner.os == 'Linux'
if: matrix.static_analysis == 'ON'
run: |
sudo apt-get install cppcheck
cppcheck --project=build/compile_commands.json --error-exitcode=1 --suppress=*:*/External/* --suppress=*:*/NanoGUI/*
if [ "${{ runner.os }}" = "Linux" ]; then
sudo apt-get install cppcheck
else
brew install cppcheck
fi
cppcheck --project=build/compile_commands.json --error-exitcode=1 --suppress=normalCheckLevelMaxBranches --suppress=*:*/External/* --suppress=*:*/NanoGUI/*
- name: Initialize Virtual Framebuffer
if: matrix.test_render == 'ON' && runner.os == 'Linux'
Expand Down Expand Up @@ -347,7 +353,7 @@ jobs:

sdist:
name: Python SDist
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'AcademySoftwareFoundation/MaterialX'
outputs:
sdist_filename: ${{ steps.generate.outputs.filename }}
Expand Down Expand Up @@ -383,7 +389,7 @@ jobs:
fail-fast: false
matrix:
python-minor: ['7', '8', '9', '10', '11', '12']
os: ['ubuntu-latest', 'windows-2022', 'macos-13']
os: ['ubuntu-22.04', 'windows-2022', 'macos-14-large']

steps:
- name: Sync Repository
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

## [1.39.2] - Development

### Added
- Added support for the [Chiang Hair BSDF](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1968), with initial implementations in hardware shading languages and MDL.
- Added support for the [Disney Principled](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2004) shading model, implemented as a language-independent graph.
- Added support for [ramp curve adjustments](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1884), using a graph-based ramp node with ten control points.
- Added support for [Worley noise with solid cells](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2119), opening up new artistic options for metal flake shaders.
- Added support for [data library referencing](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2054), enabling improved performance in shader generation.
- Added support for [custom structure types](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1831) in MaterialX.
- Added support for [functional equivalence](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2003) tests between MaterialX elements.
- Added support for [geompropvalueuniform nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2092), improving functional parity between MaterialX and USD.
- Added support for [transmission effects](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2027) in the translation graph from Standard Surface to glTF PBR.
- Added support for [coated emission](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2087) in the translation graph from Standard Surface to UsdPreviewSurface.
- Added support for [Apple framework builds](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2020).
- Added support for [MDL 1.9](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2102) in shader generation.
- Added support for [viewdirection space](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2036) in hardware shading languages.
- Added a [combined version define](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2031) to MaterialX C++.
- Added a [release signing workflow](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2009) to GitHub Actions.
- Added documentation for [keyboard shortcuts](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2026) in the MaterialX Viewer.

### Changed
- Improved the performance of [graph traversal](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2023) by skipping edges that have already been visited.
- Reduced duplication between the [MSL and GLSL implementations](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2068) of nodes.
- Raised the [minimum OSL version](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2144) to v1.12.6 in OSL shader generation.

### Fixed
- Fixed [unintentional camera orbiting](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2032) in the render view of the MaterialX Graph Editor.
- Fixed [banding artifacts](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1977) in the MaterialX Viewer on MacOS.
- Fixed the handling of [missing scenes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2124) in the MaterialX Web Viewer.
- Fixed a call to the [anisotropic_vdf closure](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2016) in OSL shader generation.

### Removed
- Removed support for the [legacy OSL closures](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2121), focusing exclusively on the MaterialX-synchronized closures in OSL 1.12 and beyond.

## [1.39.1] - 2024-09-03

### Added
Expand Down
23 changes: 8 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,23 @@ 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)
set(MATERIALX_BUILD_APPLE_EMBEDDED OFF)
option(MATERIALX_BUILD_APPLE_FRAMEWORK "Build MaterialX as an Apple Framework" ${__build_apple_framework})
if (MATERIALX_BUILD_IOS)
MESSAGE(WARNING "The MATERIALX_BUILD_IOS is deprecated. Set the CMAKE_SYSTEM_NAME to the platform instead")
set(CMAKE_SYSTEM_NAME iOS)
endif()

# Cross Compilation detection as defined in CMake docs
# Apple ecosystem cross-compilation
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
# Note: All these SDKs may not be supported by MaterialX
set(MATERIALX_BUILD_APPLE_EMBEDDED OFF)
set(__build_apple_framework OFF)
if (CMAKE_SYSTEM_NAME MATCHES "iOS"
OR CMAKE_SYSTEM_NAME MATCHES "tvOS"
OR CMAKE_SYSTEM_NAME MATCHES "visionOS"
OR CMAKE_SYSTEM_NAME MATCHES "watchOS")
if (CMAKE_SYSTEM_NAME MATCHES "iOS" OR CMAKE_SYSTEM_NAME MATCHES "tvOS" OR CMAKE_SYSTEM_NAME MATCHES "visionOS" OR CMAKE_SYSTEM_NAME MATCHES "watchOS")
set(MATERIALX_BUILD_APPLE_EMBEDDED ON)
set(__build_apple_framework ${MATERIALX_BUILD_SHARED_LIBS})
# TARGET_OS_IPHONE refers to all IPHONE derived platforms
# https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/
# This should be auto-defined, but leaving it in here because it was historically defined
add_definitions(-DTARGET_OS_IPHONE=1)
set(MATERIALX_BUILD_MONOLITHIC ON)
set(MATERIALX_BUILD_PYTHON OFF)
Expand All @@ -91,8 +86,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "iOS"
set(MATERIALX_BUILD_TESTS OFF)
endif()

set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" CACHE STRING "The Codesigning identity needed to sign compiled objects")
option(MATERIALX_BUILD_APPLE_FRAMEWORK "Build MaterialX as an Apple Framework" ${__build_apple_framework})
# Apple framework handling
if(APPLE)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" CACHE STRING "The Codesigning identity needed to sign compiled objects")
endif()
if (MATERIALX_BUILD_APPLE_FRAMEWORK)
add_definitions(-DBUILD_APPLE_FRAMEWORK)
set(MATERIALX_BUILD_MONOLITHIC ON)
Expand Down Expand Up @@ -184,7 +181,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)
Expand Down Expand Up @@ -231,9 +227,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()
Expand Down
44 changes: 28 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<p align="center">
<img src="documents/Images/MaterialXLogo.png" height="170" />
<img src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXLogo.png" height="170" />
</p>

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE)
[![Version](https://img.shields.io/github/v/release/AcademySoftwareFoundation/MaterialX)](https://github.com/AcademySoftwareFoundation/MaterialX/releases/latest)
[![Build Status](https://github.com/AcademySoftwareFoundation/MaterialX/workflows/main/badge.svg?branch=main)](https://github.com/AcademySoftwareFoundation/MaterialX/actions?query=branch%3Amain)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6025/badge)](https://bestpractices.coreinfrastructure.org/projects/6025)

### Introduction
## Introduction

MaterialX is an open standard for representing rich material and look-development content in computer graphics, enabling its platform-independent description and exchange across applications and renderers. Launched at [Industrial Light & Magic](https://www.ilm.com/) in 2012, MaterialX has been a key technology in their feature films and real-time experiences since _Star Wars: The Force Awakens_ and _Millennium Falcon: Smugglers Run_. The project was released as open source in 2017, with companies including Sony Pictures Imageworks, Pixar, Autodesk, Adobe, and SideFX contributing to its ongoing development. In 2021, MaterialX became the seventh hosted project of the [Academy Software Foundation](https://www.aswf.io/).

### Quick Start for Developers
## Quick Start for Developers

- Download the latest version of the [CMake](https://cmake.org/) build system.
- Point CMake to the root of the MaterialX library and generate C++ projects for your platform and compiler.
- Select the `MATERIALX_BUILD_PYTHON` option to build Python bindings.
- Select the `MATERIALX_BUILD_VIEWER` option to build the MaterialX viewer.

### Supported Platforms
## Supported Platforms

The MaterialX codebase requires a compiler with support for C++17, and can be built with any of the following:

Expand All @@ -28,43 +28,55 @@ The MaterialX codebase requires a compiler with support for C++17, and can be bu

The Python bindings for MaterialX are based on [PyBind11](https://github.com/pybind/pybind11), and support Python versions 3.6 and greater.

### MaterialX Viewer
## MaterialX Viewer

The [MaterialX Viewer](documents/DeveloperGuide/Viewer.md) leverages shader generation to build GLSL shaders from MaterialX graphs, rendering the results using the NanoGUI framework.

**Figure 1:** Procedural and uniform materials in the MaterialX viewer
<p float="left">
<img src="documents/Images/MaterialXView_Marble.png" width="204" />
<img src="documents/Images/MaterialXView_Copper.png" width="204" />
<img src="documents/Images/MaterialXView_Plastic.png" width="204" />
<img src="documents/Images/MaterialXView_Carpaint.png" width="204" />
<img title="Standard Surface Marble material"
src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Marble.png"
width="24%" />
<img title="Standard Surface Copper material"
src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Copper.png"
width="24%" />
<img title="Standard Surface Plastic material"
src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Plastic.png"
width="24%" />
<img title="Standard Surface Carpaint material"
src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Carpaint.png"
width="24%" />
</p>

**Figure 2:** Textured, color-space-managed materials in the MaterialX viewer
<p float="left">
<img src="documents/Images/MaterialXView_TiledBrass.png" width="412" />
<img src="documents/Images/MaterialXView_TiledWood.png" width="412" />
<img title="Standard Surface Tiled Brass material"
src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_TiledBrass.png"
width="49%" />
<img title="Standard Surface Tiled Wood material"
src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_TiledWood.png"
width="49%" />
</p>

### Open Chess Set
## Open Chess Set

The Open Chess Set is an open reference asset, consisting of a [MaterialX file](resources/Materials/Examples/StandardSurface/standard_surface_chess_set.mtlx) in the Standard Surface shading model and a [geometry file](resources/Geometry) in the glTF format. It was authored by Moeen Sayed and Mujtaba Sayed, and was contributed to the MaterialX project by Side Effects.

**Figure 3:** The Open Chess Set, rendered in Arnold for Maya
<img src="documents/Images/OpenChessSet_Arnold_01.png" />
![The Open Chess Set rendered in Arnold for Maya](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/OpenChessSet_Arnold_01.png)

**Figure 4:** The Open Chess Set, rendered in Karma XPU for Houdini
<img src="documents/Images/OpenChessSet_Karma_01.png" />
![The Open Chess Set rendered in Karma XPU for Houdini](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/OpenChessSet_Karma_01.png)

### Pre-Built Binaries
## Pre-Built Binaries

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.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
## Additional Resources

- The [Developer Guide](http://www.materialx.org/docs/api/index.html) contains a developer-oriented overview of MaterialX with API documentation.
- The [Python Scripts](python/Scripts) folder contains standalone examples of MaterialX Python code.
Expand Down
Loading

0 comments on commit f4a16a7

Please sign in to comment.