Skip to content

Commit

Permalink
Merge branch 'main' into feldstj/ramp_node
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Dec 5, 2024
2 parents db7341b + f0f9eac commit 527207e
Show file tree
Hide file tree
Showing 76 changed files with 1,335 additions and 855 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ jobs:
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
Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:
fail-fast: false
matrix:
python-minor: ['7', '8', '9', '10', '11', '12']
os: ['ubuntu-22.04', 'windows-2022', 'macos-13']
os: ['ubuntu-22.04', 'windows-2022', 'macos-14-large']

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

## [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 [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 [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
- Reduced duplication between the [MSL and GLSL implementations](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2068) of nodes.

### 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 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
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ 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)
option(MATERIALX_BUILD_APPLE_FRAMEWORK "Build MaterialX as an Apple Framework" ${__build_apple_framework})
Expand Down Expand Up @@ -180,7 +179,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 @@ -227,9 +225,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
6 changes: 3 additions & 3 deletions javascript/MaterialXView/source/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ export class Scene
}

this.#_rootNode = null;
const model = gltfData.scene;
let model = gltfData.scene;
if (!model)
{
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({ color: 0xdddddd });
const cube = new THREE.Mesh(geometry, material);
obj = new Group();
obj.add(geometry);
model = new Group();
model.add(cube);
}
else
{
Expand Down
10 changes: 2 additions & 8 deletions libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
if (MATERIALX_OSL_LEGACY_CLOSURES)
set(PBRLIB_SUFFIX "legacy")
else()
set(PBRLIB_SUFFIX "mtlx")
endif()

if(NOT SKBUILD)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}"
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "pbrlib_genosl_impl.*" EXCLUDE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.${PBRLIB_SUFFIX}"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.mtlx"
DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx)
endif()

Expand All @@ -23,6 +17,6 @@ if(MATERIALX_BUILD_PYTHON)
DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}"
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "pbrlib_genosl_impl.*" EXCLUDE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.${PBRLIB_SUFFIX}"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.mtlx"
DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx)
endif()
3 changes: 0 additions & 3 deletions libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,4 @@ This folder contains the standard data libraries for MaterialX, providing declar
- Basic GLSL and MSL `lightshader` node definitions and implementations are provided for the following light types:
- point, directional, spot
- Shader generation does not currently support:
- `ambientocclusion` node.
- `arrayappend` node.
- `curveadjust` node.
- `displacementshader` and `volumeshader` nodes for hardware shading targets (GLSL, MSL).
9 changes: 8 additions & 1 deletion libraries/bxdf/translation/standard_surface_to_usd.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<input name="coat" type="float" value="0" />
<input name="coat_color" type="color3" value="1, 1, 1" />
<input name="coat_roughness" type="float" value="0.1" />
<input name="subsurface" type="float" value="0" />
<input name="subsurface_color" type="color3" value="1, 1, 1" />
<input name="emission" type="float" value="0" />
<input name="emission_color" type="color3" value="1, 1, 1" />
<input name="opacity" type="color3" value="1, 1, 1" />
Expand Down Expand Up @@ -47,13 +49,18 @@
<input name="in1" type="color3" interfacename="base_color" />
<input name="in2" type="float" interfacename="base" />
</multiply>
<mix name="albedoOpaqueDielectric" type="color3">
<input name="fg" type="color3" interfacename="subsurface_color" />
<input name="bg" type="color3" nodename="scaledBaseColor" />
<input name="mix" type="float" interfacename="subsurface" />
</mix>
<mix name="coatAttenuation" type="color3">
<input name="fg" type="color3" interfacename="coat_color" />
<input name="bg" type="color3" value="1.0, 1.0, 1.0" />
<input name="mix" type="float" interfacename="coat" />
</mix>
<multiply name="diffuseColor" type="color3">
<input name="in1" type="color3" nodename="scaledBaseColor" />
<input name="in1" type="color3" nodename="albedoOpaqueDielectric" />
<input name="in2" type="color3" nodename="coatAttenuation" />
</multiply>
<dot name="roughness" type="float">
Expand Down
30 changes: 15 additions & 15 deletions libraries/bxdf/usd_preview_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
<!-- ======================================================================== -->

<!-- Node: UsdPreviewSurface -->
<nodedef name="ND_UsdPreviewSurface_surfaceshader" node="UsdPreviewSurface" nodegroup="pbr" doc="USD preview surface shader" version="2.6" isdefaultversion="true">
<input name="diffuseColor" type="color3" value="0.18, 0.18, 0.18" uimin="0,0,0" uimax="1,1,1" />
<input name="emissiveColor" type="color3" value="0, 0, 0" uimin="0,0,0" uisoftmax="1,1,1" />
<input name="useSpecularWorkflow" type="integer" value="0" uimin="0" uimax="1" uistep="1" />
<input name="specularColor" type="color3" value="0, 0, 0" uimin="0,0,0" uimax="1,1,1" />
<input name="metallic" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="roughness" type="float" value="0.5" uimin="0.0" uimax="1.0" />
<input name="clearcoat" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="clearcoatRoughness" type="float" value="0.01" uimin="0.0" uimax="1.0" />
<input name="opacity" type="float" value="1" uimin="0.0" uimax="1.0" />
<input name="opacityThreshold" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="ior" type="float" value="1.5" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" />
<input name="normal" type="vector3" value="0, 0, 1" uimin="-1.0,-1.0,-1.0" uimax="1.0,1.0,1.0" uistep="0.01" />
<input name="displacement" type="float" value="0" />
<input name="occlusion" type="float" value="1" uimin="0.0" uimax="1.0" />
<nodedef name="ND_UsdPreviewSurface_surfaceshader" node="UsdPreviewSurface" nodegroup="pbr" doc="UsdPreviewSurface shader" version="2.5" isdefaultversion="true">
<input name="diffuseColor" type="color3" value="0.18, 0.18, 0.18" uimin="0,0,0" uimax="1,1,1" uiname="Diffuse Color" />
<input name="emissiveColor" type="color3" value="0, 0, 0" uimin="0,0,0" uisoftmax="1,1,1" uiname="Emissive Color" />
<input name="useSpecularWorkflow" type="integer" value="0" uimin="0" uimax="1" uistep="1" uiname="Use Specular Workflow" />
<input name="specularColor" type="color3" value="0, 0, 0" uimin="0,0,0" uimax="1,1,1" uiname="Specular Color" />
<input name="metallic" type="float" value="0" uimin="0.0" uimax="1.0" uiname="Metallic" />
<input name="roughness" type="float" value="0.5" uimin="0.0" uimax="1.0" uiname="Roughness" />
<input name="clearcoat" type="float" value="0" uimin="0.0" uimax="1.0" uiname="Clearcoat" />
<input name="clearcoatRoughness" type="float" value="0.01" uimin="0.0" uimax="1.0" uiname="Clearcoat Roughness" />
<input name="opacity" type="float" value="1" uimin="0.0" uimax="1.0" uiname="Opacity" />
<input name="opacityThreshold" type="float" value="0" uimin="0.0" uimax="1.0" uiname="Opacity Threshold" />
<input name="ior" type="float" value="1.5" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" uiname="Index of Refraction" />
<input name="normal" type="vector3" value="0, 0, 1" uimin="-1.0,-1.0,-1.0" uimax="1.0,1.0,1.0" uistep="0.01" uiname="Normal" />
<input name="displacement" type="float" value="0" uiname="Displacement" />
<input name="occlusion" type="float" value="1" uimin="0.0" uimax="1.0" uiname="Occlusion" />
<output name="out" type="surfaceshader" />
</nodedef>

Expand Down
6 changes: 3 additions & 3 deletions libraries/pbrlib/genmdl/pbrlib_genmdl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<materialx version="1.39">

<!-- <oren_nayar_diffuse_bsdf> -->
<implementation name="IM_oren_nayar_diffuse_bsdf_genmdl" nodedef="ND_oren_nayar_diffuse_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_oren_nayar_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}})" target="genmdl" />
<implementation name="IM_oren_nayar_diffuse_bsdf_genmdl" nodedef="ND_oren_nayar_diffuse_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_oren_nayar_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_energy_compensation:{{energy_compensation}})" target="genmdl" />

<!-- <burley_diffuse_bsdf> -->
<implementation name="IM_burley_diffuse_bsdf_genmdl" nodedef="ND_burley_diffuse_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_burley_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}})" target="genmdl" />
Expand All @@ -11,13 +11,13 @@
<implementation name="IM_translucent_bsdf_genmdl" nodedef="ND_translucent_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_translucent_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_normal:{{normal}})" target="genmdl" />

<!-- <dielectric_bsdf> -->
<implementation name="IM_dielectric_bsdf_genmdl" nodedef="ND_dielectric_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}})" target="genmdl" />
<implementation name="IM_dielectric_bsdf_genmdl" nodedef="ND_dielectric_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_top_weight:{{top_weight}})" target="genmdl" />

<!-- <conductor_bsdf> -->
<implementation name="IM_conductor_bsdf_genmdl" nodedef="ND_conductor_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}})" target="genmdl" />

<!-- <generalized_schlick_bsdf> -->
<implementation name="IM_generalized_schlick_bsdf_genmdl" nodedef="ND_generalized_schlick_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}})" target="genmdl" />
<implementation name="IM_generalized_schlick_bsdf_genmdl" nodedef="ND_generalized_schlick_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color82:{{color82}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_top_weight:{{top_weight}})" target="genmdl" />

<!-- <subsurface_bsdf> -->
<implementation name="IM_subsurface_bsdf_genmdl" nodedef="ND_subsurface_bsdf" sourcecode="materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_subsurface_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_radius:{{radius}}, mxp_anisotropy:{{anisotropy}}, mxp_normal:{{normal}})" target="genmdl" />
Expand Down
5 changes: 0 additions & 5 deletions libraries/pbrlib/genosl/legacy/mx_anisotropic_vdf.osl

This file was deleted.

6 changes: 0 additions & 6 deletions libraries/pbrlib/genosl/legacy/mx_burley_diffuse_bsdf.osl

This file was deleted.

32 changes: 0 additions & 32 deletions libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl

This file was deleted.

36 changes: 0 additions & 36 deletions libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl

This file was deleted.

Loading

0 comments on commit 527207e

Please sign in to comment.