Skip to content

Commit 467e185

Browse files
authored
Merge branch 'AcademySoftwareFoundation:main' into fix_dot_crash
2 parents 08bee1a + 59f98fe commit 467e185

35 files changed

Lines changed: 2110 additions & 205 deletions

.github/workflows/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
python: 3.9
2626
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON -DMATERIALX_BUILD_MONOLITHIC=ON
2727

28-
- name: Linux_GCC_14_Python39
28+
- name: Linux_GCC_14_Python312
2929
os: ubuntu-24.04
3030
compiler: gcc
3131
compiler_version: "14"
32-
python: 3.9
32+
python: 3.12
3333

34-
- name: Linux_GCC_14_Python311
34+
- name: Linux_GCC_14_Python313
3535
os: ubuntu-24.04
3636
compiler: gcc
3737
compiler_version: "14"
38-
python: 3.11
38+
python: 3.13
3939
test_render: ON
4040

4141
- name: Linux_GCC_CoverageAnalysis
@@ -53,32 +53,32 @@ jobs:
5353
python: 3.9
5454
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
5555

56-
- name: Linux_Clang_18_Python311
56+
- name: Linux_Clang_18_Python313
5757
os: ubuntu-24.04
5858
compiler: clang
5959
compiler_version: "18"
60-
python: 3.11
60+
python: 3.13
6161
clang_format: ON
6262

63-
- name: MacOS_Xcode_15_Python39
63+
- name: MacOS_Xcode_15_Python311
6464
os: macos-14
6565
compiler: xcode
6666
compiler_version: "15.4"
6767
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
68-
python: 3.9
68+
python: 3.11
6969

70-
- name: MacOS_Xcode_15_Python311
70+
- name: MacOS_Xcode_16_Python312
7171
os: macos-15
7272
compiler: xcode
7373
compiler_version: "16.1"
74-
python: 3.11
74+
python: 3.12
7575
test_shaders: ON
7676

77-
- name: MacOS_Xcode_16_Python311
77+
- name: MacOS_Xcode_16_Python313
7878
os: macos-15
7979
compiler: xcode
8080
compiler_version: "16.1"
81-
python: 3.11
81+
python: 3.13
8282
static_analysis: ON
8383
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
8484

@@ -103,10 +103,10 @@ jobs:
103103
python: 3.9
104104
cmake_config: -G "Visual Studio 17 2022" -A "Win32"
105105

106-
- name: Windows_VS2022_x64_Python311
106+
- name: Windows_VS2022_x64_Python313
107107
os: windows-2025
108108
architecture: x64
109-
python: 3.11
109+
python: 3.13
110110
cmake_config: -G "Visual Studio 17 2022" -A "x64"
111111
test_shaders: ON
112112

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Added support for [hex-tiled images](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2094), with initial implementations in hardware shading languages and MDL.
88
- Added support for [latitude-longitude images](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2168), implemented as a language-independent graph.
99
- Added support for [2D fractals](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2183), with initial implementations in hardware shading languages, OSL, and MDL.
10+
- Added support for [NanoColor names](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2513) in default color space management.
1011
- Added support for [custom OCIO configurations](https://github.com/AcademySoftwareFoundation/MaterialX/pull/1917) in shader generation.
1112
- Added support for [anisotropy](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2393) in the graph definition of glTF PBR.
1213
- Added support for the [time and frame nodes](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2389) in the MaterialX Viewer and MaterialX Graph Editor.
@@ -18,7 +19,7 @@
1819
- Raised the minimum Python version to [Python 3.9](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2326).
1920
- Raised the minimum OpenImageIO version to [OIIO 2.2](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2340).
2021
- Raised the default PyBind11 version to [PyBind11 2.13.6](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2331).
21-
- Optimized the graph definitions of [Standard Surface](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2483), [OpenPBR Surface](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2459), and [glTF PBR](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2467), roughly halving the fill cost for these shading models in hardware shading languages.
22+
- Optimized the graph definitions of [Standard Surface](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2483), [OpenPBR Surface](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2459), and [glTF PBR](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2467) in hardware shading languages, roughly halving the fill cost for these shading models in GLSL, ESSL, and MSL.
2223
- Optimized the implementation of [height-correlated Smith masking-shadowing](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2458) in GLSL.
2324
- Aligned implementations of the [heighttonormal node](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2424) beween GLSL and OSL, improving visual consistency and enabling support for arbitrary procedural heightfields.
2425
- Deprecated the [fps input](https://github.com/AcademySoftwareFoundation/MaterialX/pull/2450) of the time node, allowing it to be removed in a future specification update.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ if(NOT SKBUILD)
575575
# Export aliases for the MaterialX modules built in this monolithic build
576576
# to be less disruptive to downstream projects.
577577
get_property(MATERIALX_MODULES GLOBAL PROPERTY MATERIALX_MODULES)
578-
set(EXPORT_ALIASES "# Aliased targets for the the monolithic build\n")
578+
set(EXPORT_ALIASES "# Aliased targets for the monolithic build\n")
579579
foreach (MODULE ${MATERIALX_MODULES})
580580
string(APPEND EXPORT_ALIASES "add_library(${MODULE} ALIAS MaterialX)\n")
581581
endforeach ()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ The following packages contain pre-built binaries for the latest release, includ
8282
- The [Developer Guide](http://www.materialx.org/docs/api/index.html) contains a developer-oriented overview of MaterialX with Build and API documentation.
8383
- The [Python Scripts](python/Scripts) folder contains standalone examples of MaterialX Python code.
8484
- The [JavaScript](javascript) folder contains details on building JavaScript bindings for MaterialX.
85-
- Presentations at [ASWF Open Source Days](https://materialx.org/assets/ASWF_OSD2024_MaterialX_Final.pdf) and the [SIGGRAPH Physically Based Shading Course](https://blog.selfshadow.com/publications/s2020-shading-course/#materialx) provide details on the roadmap for MaterialX development.
85+
- Presentations at [ASWF Open Source Days](https://materialx.org/assets/ASWF_OSD2025_MaterialX_Final.pdf) and the [SIGGRAPH Physically Based Shading Course](https://blog.selfshadow.com/publications/s2020-shading-course/#materialx) provide details on the roadmap for MaterialX development.

SECURITY.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ None
1515

1616
## Addressed Security Issues
1717

18-
None
18+
The following MaterialX versions addressed the security issues listed within their section:
19+
20+
### 1.39.3
21+
22+
- [CVE-2025-53009](https://github.com/AcademySoftwareFoundation/MaterialX/security/advisories/GHSA-wx6g-fm6f-w822)
23+
- [CVE-2025-53010](https://github.com/AcademySoftwareFoundation/MaterialX/security/advisories/GHSA-3jhf-gxhr-q4cx)
24+
- [CVE-2025-53011](https://github.com/AcademySoftwareFoundation/MaterialX/security/advisories/GHSA-7qw8-3vmf-gj32)
25+
- [CVE-2025-53012](https://github.com/AcademySoftwareFoundation/MaterialX/security/advisories/GHSA-qc2h-74x3-4v3w)

documents/DeveloperGuide/GraphEditor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Select the `MATERIALX_BUILD_GRAPH_EDITOR` option in CMake to build the MaterialX
2121

2222
## Buttons
2323

24-
To display a new material and graph, click the `Load Material` button and and navigate to the [Materials/Examples](https://github.com/AcademySoftwareFoundation/MaterialX/tree/main/resources/Materials/Examples) folder, which contains a selection of materials in the MTLX format, and select a document to load. The Graph Editor will display the graph hierarchy of the selected document for visualization and editing.
24+
To display a new material and graph, click the `Load Material` button and navigate to the [Materials/Examples](https://github.com/AcademySoftwareFoundation/MaterialX/tree/main/resources/Materials/Examples) folder, which contains a selection of materials in the MTLX format, and select a document to load. The Graph Editor will display the graph hierarchy of the selected document for visualization and editing.
2525

2626
To save out changes to the graphs as MTLX files click the `Save Material` button. This will save the position of the nodes in the graph for future use as well.
2727

documents/Specification/MaterialX.GeomExts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ VariantAssign elements have the following attributes:
406406
* `variantset` (string, required): the name of the variantset to apply the variant from
407407
* `variant` (string, required): the name of the variant within `variantset` to use
408408

409-
In the above example, the input/token values defined within variant "var1" will be applied to and and all identically-named inputs/tokens found in either "material1" or "material2" unless restricted by a `node` or `nodedef` attribute defined in the <variantset>, while values defined within variant "var2" will only be applied to matching-named bindings in "material1". VariantAssigns are applied in the order specified within a scope, with those within a <materialassign> taking precedence over those which are direct children of the <look>.
409+
In the above example, the input/token values defined within variant "var1" will be applied to all identically-named inputs/tokens found in either "material1" or "material2" unless restricted by a `node` or `nodedef` attribute defined in the <variantset>, while values defined within variant "var2" will only be applied to matching-named bindings in "material1". VariantAssigns are applied in the order specified within a scope, with those within a <materialassign> taking precedence over those which are direct children of the <look>.
410410

411411

412412
### Visibility Elements

javascript/MaterialXView/source/index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ function init()
5353
viewer.getEditor().initialize();
5454
viewer.getMaterial().loadMaterials(viewer, materialFilename);
5555
viewer.getEditor().updateProperties(0.9);
56-
viewer.getScene().setUpdateTransforms();
5756
});
5857

5958
// Handle geometry selection changes
@@ -79,10 +78,6 @@ function init()
7978

8079
// Set up controls
8180
orbitControls = new OrbitControls(scene.getCamera(), renderer.domElement);
82-
orbitControls.addEventListener('change', () =>
83-
{
84-
viewer.getScene().setUpdateTransforms();
85-
})
8681

8782
// Add hotkey 'f' to capture the current frame and save an image file.
8883
// See check inside the render loop when a capture can be performed.
@@ -145,7 +140,6 @@ function init()
145140
viewer.getEditor().initialize();
146141
viewer.getMaterial().loadMaterials(viewer, materialFilename);
147142
viewer.getEditor().updateProperties(0.9);
148-
viewer.getScene().setUpdateTransforms();
149143
});
150144

151145
setSceneLoadingCallback(file =>
@@ -163,7 +157,6 @@ function init()
163157
function onWindowResize()
164158
{
165159
viewer.getScene().updateCamera();
166-
viewer.getScene().setUpdateTransforms();
167160
renderer.setSize(window.innerWidth, window.innerHeight);
168161
}
169162

@@ -177,12 +170,10 @@ function animate()
177170
turntableStep = (turntableStep + 1) % 360;
178171
var turntableAngle = turntableStep * (360.0 / turntableSteps) / 180.0 * Math.PI;
179172
scene._scene.rotation.y = turntableAngle;
180-
scene.setUpdateTransforms();
181173
}
182174

183-
scene.updateUniforms();
175+
scene.updateTimeUniforms();
184176
renderer.render(scene.getScene(), scene.getCamera());
185-
scene.updateTransforms();
186177

187178
if (captureRequested)
188179
{

javascript/MaterialXView/source/viewer.js

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ export class Scene
106106
}
107107
scene.add(model);
108108

109+
// Set up onBeforeRender callbacks so that we can update uniforms per object right before rendering.
110+
model.traverse((child) =>
111+
{
112+
child.onBeforeRender = (_renderer, _scene, camera, _geometry, material, _group) =>
113+
{
114+
this.updateObjectUniforms(child, material, camera);
115+
};
116+
})
117+
109118
console.log("- Scene load time: ", performance.now() - geomLoadTime, "ms");
110119

111120
// Always reset controls based on camera for each load.
@@ -116,7 +125,6 @@ export class Scene
116125

117126
viewer.getMaterial().clearSoloMaterialUI();
118127
viewer.getMaterial().updateMaterialAssignments(viewer, "");
119-
this.setUpdateTransforms();
120128
}
121129

122130
//
@@ -233,55 +241,30 @@ export class Scene
233241
orbitControls.update();
234242
}
235243

236-
setUpdateTransforms(val=true)
244+
updateObjectUniforms(child, material, camera)
237245
{
238-
this.#_updateTransforms = val;
239-
}
246+
if (!child || !material || !camera) return;
247+
const uniforms = material.uniforms;
248+
if (!uniforms) return;
240249

241-
getUpdateTransforms()
242-
{
243-
return this.#_updateTransforms;
244-
}
250+
uniforms.u_worldMatrix.value = child.matrixWorld;
251+
uniforms.u_viewProjectionMatrix.value = this.#_viewProjMat.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
245252

246-
updateTransforms()
247-
{
248-
// Only update on demand versus continuously.
249-
// Call setUpdateTransforms() to trigger an update here.
250-
// Required for: scene geometry, camera change and viewport resize.
251-
if (!this.#_updateTransforms)
252-
{
253-
return;
254-
}
255-
this.setUpdateTransforms(false);
253+
if (uniforms.u_viewPosition)
254+
uniforms.u_viewPosition.value = camera.getWorldPosition(this.#_worldViewPos);
256255

257-
const scene = this.getScene();
258-
const camera = this.getCamera();
259-
scene.traverse((child) =>
260-
{
261-
if (child.isMesh)
262-
{
263-
const uniforms = child.material.uniforms;
264-
if (uniforms)
265-
{
266-
uniforms.u_worldMatrix.value = child.matrixWorld;
267-
uniforms.u_viewProjectionMatrix.value = this.#_viewProjMat.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
256+
if (uniforms.u_worldInverseTransposeMatrix)
257+
uniforms.u_worldInverseTransposeMatrix.value =
258+
new THREE.Matrix4().setFromMatrix3(this.#_normalMat.getNormalMatrix(child.matrixWorld));
268259

269-
if (uniforms.u_viewPosition)
270-
uniforms.u_viewPosition.value = camera.getWorldPosition(this.#_worldViewPos);
271-
272-
if (uniforms.u_worldInverseTransposeMatrix)
273-
uniforms.u_worldInverseTransposeMatrix.value =
274-
new THREE.Matrix4().setFromMatrix3(this.#_normalMat.getNormalMatrix(child.matrixWorld));
275-
}
276-
}
277-
});
260+
material.uniformsNeedUpdate = true;
278261
}
279262

280263
/**
281264
* Update uniforms for all scene objects. This is called once per frame
282265
* and updates time and frame count uniforms.
283266
*/
284-
updateUniforms() {
267+
updateTimeUniforms() {
285268
this._frame++;
286269

287270
const scene = this.getScene();
@@ -296,13 +279,9 @@ export class Scene
296279
if (uniforms)
297280
{
298281
if (uniforms.u_time)
299-
{
300282
uniforms.u_time.value = time;
301-
}
302283
if (uniforms.u_frame)
303-
{
304284
uniforms.u_frame.value = frame;
305-
}
306285
}
307286
}
308287
});
@@ -472,7 +451,6 @@ export class Scene
472451
#_normalMat = new THREE.Matrix3();
473452
#_viewProjMat = new THREE.Matrix4();
474453
#_worldViewPos = new THREE.Vector3();
475-
#_updateTransforms = true;
476454

477455
// Root node of imported scene
478456
#_rootNode = null;
@@ -867,9 +845,6 @@ export class Material
867845
// Update scene shader assignments
868846
this.updateMaterialAssignments(viewer, "");
869847

870-
// Mark transform update
871-
viewer.getScene().setUpdateTransforms();
872-
873848
console.log("Total material time: ", (performance.now() - startTime), "ms");
874849
}
875850

@@ -1062,7 +1037,6 @@ export class Material
10621037
}
10631038
}
10641039
viewer.getMaterial().updateMaterialAssignments(viewer, this._soloMaterial);
1065-
viewer.getScene().setUpdateTransforms();
10661040
}
10671041

10681042
//

0 commit comments

Comments
 (0)