Skip to content

Commit 0892d2e

Browse files
authored
Merge branch 'AcademySoftwareFoundation:main' into patch_js_packages
2 parents 715ea2f + 1ef82c8 commit 0892d2e

70 files changed

Lines changed: 617 additions & 1285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,33 +67,33 @@ jobs:
6767
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
6868
python: 3.11
6969

70-
- name: MacOS_Xcode_16_Python312
70+
- name: MacOS_Xcode_16_Python313
7171
os: macos-15
7272
compiler: xcode
73-
compiler_version: "16.1"
74-
python: 3.12
73+
compiler_version: "16.4"
74+
python: 3.13
7575
test_shaders: ON
7676

77-
- name: MacOS_Xcode_16_Python313
78-
os: macos-15
77+
- name: MacOS_Xcode_26_Python313
78+
os: macos-26
7979
compiler: xcode
80-
compiler_version: "16.1"
80+
compiler_version: "26.0"
8181
python: 3.13
8282
static_analysis: ON
8383
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
8484

8585
- name: MacOS_Xcode_DynamicAnalysis
86-
os: macos-15
86+
os: macos-26
8787
compiler: xcode
88-
compiler_version: "16.1"
88+
compiler_version: "26.0"
8989
python: None
9090
dynamic_analysis: ON
9191
cmake_config: -DMATERIALX_DYNAMIC_ANALYSIS=ON
9292

93-
- name: iOS_Xcode_16
94-
os: macos-15
93+
- name: iOS_Xcode_26
94+
os: macos-26
9595
compiler: xcode
96-
compiler_version: "16.1"
96+
compiler_version: "26.0"
9797
python: None
9898
cmake_config: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=`xcrun --sdk iphoneos --show-sdk-path` -DCMAKE_OSX_ARCHITECTURES=arm64
9999

@@ -144,15 +144,9 @@ jobs:
144144
if: runner.os == 'macOS'
145145
run: |
146146
if [ "${{ matrix.compiler_version }}" != 'None' ]; then
147-
if [ "${{ matrix.compiler }}" = "gcc" ]; then
148-
brew install gcc@${{ matrix.compiler_version }}
149-
echo "CC=gcc-${{ matrix.compiler_version }}" >> $GITHUB_ENV
150-
echo "CXX=g++-${{ matrix.compiler_version }}" >> $GITHUB_ENV
151-
else
152-
ls -ls /Applications/
153-
sudo xcode-select -switch /Applications/Xcode_${{ matrix.compiler_version }}.app
154-
echo "CC=clang" >> $GITHUB_ENV
155-
echo "CXX=clang++" >> $GITHUB_ENV
147+
sudo xcode-select -switch /Applications/Xcode_${{ matrix.compiler_version }}.app
148+
if [ "${{ matrix.os }}" == 'macos-26' ]; then
149+
xcodebuild -downloadComponent MetalToolchain
156150
fi
157151
fi
158152

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
22

3-
## [1.39.4] - Release Candidate
3+
## [1.39.5] - Development
4+
5+
## [1.39.4] - 2025-09-15
46

57
### Added
68
- Added support for [WebGPU Shading Language](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2407) in MaterialX shader generation.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MaterialX Version
22
set(MATERIALX_MAJOR_VERSION 1)
33
set(MATERIALX_MINOR_VERSION 39)
4-
set(MATERIALX_BUILD_VERSION 4)
4+
set(MATERIALX_BUILD_VERSION 5)
55
set(MATERIALX_LIBRARY_VERSION ${MATERIALX_MAJOR_VERSION}.${MATERIALX_MINOR_VERSION}.${MATERIALX_BUILD_VERSION})
66

77
# CMake setup

documents/Specification/MaterialX.PBRSpec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ Note that the standard library includes definitions for [**`displacement`**](./M
388388
* **`artistic_ior`**: Converts the artistic parameterization reflectivity and edge_color to complex IOR values. To be used with the [<conductor_bsdf>](#node-conductor-bsdf) node.
389389
* `reflectivity` (color3): Reflectivity per color component at facing angles. Defaults to (0.947, 0.776, 0.371).
390390
* `edge_color` (color3): Reflectivity per color component at grazing angles. Defaults to (1.0, 0.982, 0.753).
391-
* `ior` (**output**, vector3): Computed index of refraction.
392-
* `extinction` (**output**, vector3): Computed extinction coefficient.
391+
* `ior` (**output**, color3): Computed index of refraction.
392+
* `extinction` (**output**, color3): Computed extinction coefficient.
393393

394394
<a id="node-chiang-hair-roughness"> </a>
395395

libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<input name="specular_anisotropy" type="float" value="0.0" />
99
<input name="specular_rotation" type="float" value="0.0" />
1010
<input name="specular_roughness" type="float" value="0.2" />
11+
<input name="specular_IOR" type="float" value="1.5" />
1112
<input name="transmission" type="float" value="0" />
1213
<input name="transmission_color" type="color3" value="1, 1, 1" />
1314
<input name="transmission_depth" type="float" value="0" />
@@ -19,10 +20,13 @@
1920
<input name="coat_roughness" type="float" value="0.1" />
2021
<input name="emission" type="float" value="0" />
2122
<input name="emission_color" type="color3" value="1, 1, 1" />
23+
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
24+
<input name="tangent" type="vector3" defaultgeomprop="Tworld" />
2225

2326
<output name="base_color_out" type="color3" />
2427
<output name="metallic_out" type="float" />
2528
<output name="roughness_out" type="float" />
29+
<output name="ior_out" type="float" />
2630
<output name="anisotropy_strength_out" type="float" />
2731
<output name="anisotropy_rotation_out" type="float" />
2832
<output name="transmission_out" type="float" />
@@ -33,6 +37,9 @@
3337
<output name="clearcoat_out" type="float" />
3438
<output name="clearcoat_roughness_out" type="float" />
3539
<output name="emissive_out" type="color3" />
40+
<output name="emissive_strength_out" type="float" />
41+
<output name="normal_out" type="vector3" />
42+
<output name="tangent_out" type="vector3" />
3643
</nodedef>
3744

3845
<nodegraph name="NG_standard_surface_to_gltf_pbr" nodedef="ND_standard_surface_to_gltf_pbr">
@@ -186,14 +193,30 @@
186193
</dot>
187194

188195
<!-- Emission -->
189-
<multiply name="emissive" type="color3">
190-
<input name="in1" type="color3" interfacename="emission_color" />
191-
<input name="in2" type="float" interfacename="emission" />
192-
</multiply>
196+
<dot name="emissive" type="color3">
197+
<input name="in" type="color3" interfacename="emission_color" />
198+
</dot>
199+
<dot name="emissive_strength" type="float">
200+
<input name="in" type="float" interfacename="emission" />
201+
</dot>
202+
203+
<!-- Specular Index of Refraction -->
204+
<dot name="ior" type="float">
205+
<input name="in" type="float" interfacename="specular_IOR" />
206+
</dot>
207+
208+
<!-- Geometry -->
209+
<dot name="normal" type="vector3">
210+
<input name="in" type="vector3" interfacename="normal" />
211+
</dot>
212+
<dot name="tangent" type="vector3">
213+
<input name="in" type="vector3" interfacename="tangent" />
214+
</dot>
193215

194216
<output name="base_color_out" type="color3" nodename="base_color" />
195217
<output name="metallic_out" type="float" nodename="metallic" />
196218
<output name="roughness_out" type="float" nodename="roughness" />
219+
<output name="ior_out" type="float" nodename="ior" />
197220
<output name="anisotropy_strength_out" type="float" nodename="anisotropy_strength" />
198221
<output name="anisotropy_rotation_out" type="float" nodename="anisotropy_rotation" />
199222
<output name="transmission_out" type="float" nodename="transmission" />
@@ -204,6 +227,9 @@
204227
<output name="clearcoat_out" type="float" nodename="clearcoat" />
205228
<output name="clearcoat_roughness_out" type="float" nodename="clearcoat_roughness" />
206229
<output name="emissive_out" type="color3" nodename="emissive" />
230+
<output name="emissive_strength_out" type="float" nodename="emissive_strength" />
231+
<output name="normal_out" type="vector3" nodename="normal" />
232+
<output name="tangent_out" type="vector3" nodename="tangent" />
207233

208234
</nodegraph>
209235
</materialx>

libraries/pbrlib/genglsl/lib/mx_closure_type.glsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ struct ClosureData {
1515
vec3 P;
1616
float occlusion;
1717
};
18+
19+
ClosureData makeClosureData(int closureType, vec3 L, vec3 V, vec3 N, vec3 P, float occlusion)
20+
{
21+
return $closureDataConstructor;
22+
}

libraries/pbrlib/genglsl/lib/mx_environment_fis.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distributio
3232
float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0);
3333

3434
// Sample the environment light from the given direction.
35-
vec3 Lw = tangentToWorld * L;
35+
vec3 Lw = mx_matrix_mul(tangentToWorld, L);
3636
float pdf = mx_ggx_NDF(H, alpha) * G1V / (4.0 * NdotV);
3737
float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples);
3838
vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance);

libraries/pbrlib/genglsl/lib/mx_generate_prefilter_env.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ vec3 mx_generate_prefilter_env()
5252
float G = mx_ggx_smith_G2(NdotL, NdotV, alpha);
5353

5454
// Sample the environment light from the given direction.
55-
vec3 Lw = tangentToWorld * L;
55+
vec3 Lw = mx_matrix_mul(tangentToWorld, L);
5656
float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV);
5757
float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples);
5858
vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance);

libraries/pbrlib/genglsl/lib/mx_microfacet_sheen.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ mat3 mx_orthonormal_basis_ltc(vec3 V, vec3 N, float NdotV)
136136
float mx_zeltner_sheen_brdf(vec3 L, vec3 V, vec3 N, float NdotV, float roughness)
137137
{
138138
mat3 toLTC = transpose(mx_orthonormal_basis_ltc(V, N, NdotV));
139-
vec3 w = toLTC * L;
139+
vec3 w = mx_matrix_mul(toLTC, L);
140140

141141
float aInv = mx_zeltner_sheen_ltc_aInv(NdotV, roughness);
142142
float bInv = mx_zeltner_sheen_ltc_bInv(NdotV, roughness);
@@ -183,7 +183,7 @@ vec3 mx_zeltner_sheen_importance_sample(vec2 Xi, vec3 V, vec3 N, float roughness
183183
pdf = max(w.z, 0.0) * M_PI_INV * mx_square(aInv * lenSqr);
184184

185185
mat3 fromLTC = mx_orthonormal_basis_ltc(V, N, NdotV);
186-
w = fromLTC * w;
186+
w = mx_matrix_mul(fromLTC, w);
187187

188188
return w;
189189
}

libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ vec3 mx_fresnel_airy(float cosTheta, FresnelData fd)
374374

375375
// Reflectance term for m>0 (pairs of diracs)
376376
Cm = Rs - T121.x;
377-
for (int m=1; m<=2; m++)
377+
for (int m = 1; m <= AIRY_FRESNEL_ITERATIONS; m++)
378378
{
379379
Cm *= r123p;
380380
Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23p+vec3(phi21.x)));
@@ -389,7 +389,7 @@ vec3 mx_fresnel_airy(float cosTheta, FresnelData fd)
389389

390390
// Reflectance term for m>0 (pairs of diracs)
391391
Cm = Rp - T121.y;
392-
for (int m=1; m<=2; m++)
392+
for (int m = 1; m <= AIRY_FRESNEL_ITERATIONS; m++)
393393
{
394394
Cm *= r123s;
395395
Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23s+vec3(phi21.y)));
@@ -400,7 +400,7 @@ vec3 mx_fresnel_airy(float cosTheta, FresnelData fd)
400400
I *= 0.5;
401401

402402
// Convert back to RGB reflectance
403-
I = clamp(XYZ_TO_RGB * I, 0.0, 1.0);
403+
I = clamp(mx_matrix_mul(XYZ_TO_RGB, I), 0.0, 1.0);
404404

405405
return I;
406406
}
@@ -493,7 +493,7 @@ vec2 mx_latlong_projection(vec3 dir)
493493

494494
vec3 mx_latlong_map_lookup(vec3 dir, mat4 transform, float lod, $texSamplerSignature)
495495
{
496-
vec3 envDir = normalize((transform * vec4(dir,0.0)).xyz);
496+
vec3 envDir = normalize(mx_matrix_mul(transform, vec4(dir,0.0)).xyz);
497497
vec2 uv = mx_latlong_projection(envDir);
498498
return textureLod($texSamplerSampler2D, uv, lod).rgb;
499499
}

0 commit comments

Comments
 (0)