forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
Metashade/pull upstream main #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ppenenko
merged 168 commits into
metashade:metashade/dev
from
ppenenko:metashade/pull_upstream_main
Jan 25, 2026
Merged
Metashade/pull upstream main #4
ppenenko
merged 168 commits into
metashade:metashade/dev
from
ppenenko:metashade/pull_upstream_main
Jan 25, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…undation#2469) This changelist extends MapHelper.h to support `std::map` bindings in JsMaterialX, accommodating a recent change to shader generation in AcademySoftwareFoundation#2462. This should address recent issues in the MaterialX Web Viewer described in AcademySoftwareFoundation#2468.
…eFoundation#2465) In AcademySoftwareFoundation#2400 the ClosureSourceCodeNode has been removed and replaced by the regular SourceCodeNode. For that to work, the SourceCodeNode needs to emit dependent function calls to generate code for the inputs.
Mirroring the existing behavior for `<fractal3d>`, we add the corresponding `<fractal2d> node that uses the `texcoord` input as its manifold. Add support for OSL, MSL, GLSL, MDL (note : MDL not tested). Updated specification documents to add `<fractal2d>` to the specification and remove it from the proposals document. Also remove `period` inputs for the noises that don't have those inputs in the specification. This is already documented in the proposals document. Note : in the GLSL noise library code I renamed the existing `mx_fractal_noise_xxx()` functions to `mx_fractal3d_noise_xxx()` to make the differentiation cleaner with the new `mx_fractal2d_noise_xxx()`. But I retained wrapper functions with the old name that just call through to the new name for backwards compatibility. I was unsure how much custom customer code might be referencing those functions. We can remove the shim functions when we have another breaking API release.
…reFoundation#2475) There is a typo in the GLSL rotation matrix used in hextiling. The 1st row, 2nd column should be `-a.z` instead of `-a.x`. See `mx_rotate_vector3.glsl` for the other axis rotation matrix implementation (or [`Rotation matrix from axis and angle` ](https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle) on wikipedia)
This changelist implements optimizations to the graph for glTF PBR, replacing `mix` operations on leaf BSDFs with pre-multiplied `add` operations, and removing duplicate computations. Performance tests were conducted on an NVIDIA RTX A6000 at 4K resolution, and the following timing improvements were seen: glTF PBR Carpaint: 25ms -> 11ms glTF PBR Glass: 23ms -> 9ms glTF PBR Gold: 23ms -> 10ms glTF PBR Boombox: 11ms -> 4ms
…oundation#2476) Produce cleaner generated shader code by removing use of #ifdef HW_SEPARATE_SAMPLERS to handle both combined and separate texture samplers. This restores the generated shader code to look like it did before adding the ability to handle separate texture + sampler (for WGSL). This is an enhancement to more cleanly address the issue: * AcademySoftwareFoundation#2379
…cademySoftwareFoundation#2485) This reverts commit cf6b196 for reasons outlined in AcademySoftwareFoundation#2301
…dation#2478) The `renderTestPaths` could only accept directories, and would run all tests within that directory. This modification allows adding `.mtlx` files as well, useful for debugging individual tests.
…#2487) The bin2c.cmake requirement for cmake 2.8 caused the NanoGUI compilation to fail to configure with any CMake 4.x.y The newest NanoGUI fixes this, and the rest of the updates seems rather innocuous. Without this, MaterialXView does not compile in the latest vscode on Windows (and possibly elsewhere).
This changelist removes a workaround in GitHub CI for the requirements of CMake 4+, which have now been met by updating to a newer version of NanoGUI.
…n#2482) Added an error (`-e`) parameter to `tests_to_html`. When set to any non-negative values, all tests with all of the RMS errors lower or equal to this threshold are skipped, producing html with only failing tests. It is off by default.
…2471) The web viewer did assign vertex attributes no matter if they existed, leading to exceptions when a loaded file e.g. didn't have UV coordinates. I also added more properties – UV0, UV1, UV2, Color, Color1 – so that they can be leveraged in loaded materials.
…eFoundation#2445) Previously, object names were taken directly from the three.js scene. However, three.js enforces specific constraints for object names (e.g. spaces, braces and so on are replaced with `_`). This renaming breaks DAG matching for geom expressions, as the compared name might not be right. three.js keeps the original name around though, so this PR makes sure the original name is used for path matching instead of the in-scene name. The PR also sets the material name properly from the `materialassign` instead of keeping it empty.
…2490) Just a comma for better readability.
This changelist implements optimizations to the graph for Standard Surface, replacing `mix` operations on leaf BSDFs with pre-multiplied `add` operations. Pre-multiplied `add` operations take better advantage of dynamic branching in hardware shading languages, and should have a neutral or positive impact on software shading languages. Performance tests were conducted on an NVIDIA RTX A6000 at 4K resolution, and the following timing improvements were seen: Standard Surface Marble: 3ms -> 1ms Standard Surface Carpaint: 3ms -> 1ms Standard Surface Glass: 5ms -> 3ms Standard Surface Plastic: 2ms -> 1ms Standard Surface Brushed Metal: 2ms -> 1ms Standard Surface Chess Set: 9ms -> 4ms
…ySoftwareFoundation#2477) Remove OSL C++ Material node in favour of data driven implementation. Simplification of code export allows ignoring of node classification, which the OSL code generator doesn't need to emit the correct code.
…dation#2484) This PR addresses the crash reported in AcademySoftwareFoundation#2473. It introduces a scope guard object that automatically ends the current command encoder and command buffer if the `renderFrame` method exits abnormally due to an exception. Without such a precaution, the viewer crashes shortly after the exception is handled, because the encoder is released by its autorelease pool before `endEncoding` is called on it, causing a hard assert in Metal.
…n#2495) By asking CMake to write MATERIALX_BUILD_OIIO in the generated CMake files if MaterialXRender was built with OpenImageIO support.
…2493) This changelist implements one additional optimization to the graph for glTF PBR, ensuring that the render cost of the transmissive `dielectric_bsdf` node can be skipped for materials with no transmissive component. Performance tests were conducted on an NVIDIA RTX A6000 at 4K resolution, and the following timing improvements were seen: glTF PBR Carpaint: 11ms -> 8ms glTF PBR Plastic: 8ms -> 5ms glTF PBR Gold: 9ms -> 6ms glTF PBR Boombox: 4ms -> 3ms
This changelist updates all referenced JavaScript packages to their latest version via `npm update`.
…tion#2497) Also declare downstream dependencies when building static libraries.
I'm submitting this PR - because I think it's the best we can do for now. I looked in to trying to find a portable robust implementation for this, and couldn't really come up with anything. I think it's better to be explicitly do nothing, than to do something that is confusing. MDL currently just passes through the `in` input as the output, so I'm using that as the template for the others as it seems like a reasonable fallback - implemented as a nodegraph that is now shared across all languages.
Following up on AcademySoftwareFoundation#2411, this changelist removes the blur helper functions in GLSL, MSL, and OSL that are no longer used by the codebase.
Code attempts to use `in` on `dot` not without checking for existence on the node. It will not be exposed (added) as a uniform input if it's connected as is the case with the `dot` nodes used in the open_pbr to standard_surface conversion graph. Simply add in a firewall check for existence first.
…#2705) Looks like when the GLSL texture magnification filter was updated [here](AcademySoftwareFoundation@a52687d), the corresponding change wasn't made on the MSL side. This is the cause of several render differences in the test suite between MSL and GLSL - discovered in AcademySoftwareFoundation#2697
…undation#2709) `TRANSFORM_POINT`, `TRANSFORM_VECTOR` and `TRANSFORM_NORMAL` are constant static members of `ShaderNode` that are both never used and never defined.
This changelist addresses a handful of static analysis warnings flagged by PVS-Studio: - Remove unused intermediate variables in `HwSurfaceNode::emitFunctionCall` and `Graph::showPropertyEditorOutputConnection`. - Iterate over key-value pairs by const reference for efficiency in `Viewer::loadStandardLibraries`.
Fix CMake for monolithic build with OIIO enabled. Align guard logic with OCIONode.
${TARGET_NAME} needs to be used when modifying a target after being declared, this is to ensure the monolithic build operates correctly too.
## Updates - Fixes AcademySoftwareFoundation#2528 - Patches to make image loaders declared in Python to work properly. - Fixes image data passing (void*) cannot resolve properly. - Virtualize extension support query and pass by reference to get data returned properly from derived classes. - Add in trampoline classes so that derived classes get called properly - Fix missing type enumerations in pybind bindings.
This changelist updates the default version of PyBind11 to 3.0.1, enabling MaterialX builds with the recently released Python 3.14.
…ademySoftwareFoundation#2721) When the input value ('V' in MaterialX spec, texcoord.y in the GLSL and OSL code) is below the 'center' input value, then the output should be the bottom value ('valueb'), otherwise if it is above then the output should be the top value ('valuet'). Given a default 'center' value of 0.5, it means that a texcoord.y value of 0.0 should yield 'valueb' as the output, and a texcoord.y value of 1.0 should yield 'valuet' as the output. The glsl and OSL code seem to do the opposite: mix in GLSL (and similarly in OSL) returns the first argument value when the third argument is 0.0. The third argument here is a call to mx_aastep(center, texcoord.y) which internlly uses smoothstep. For a default 'center' value of 0.5, a texcoord.y value of 0.0 yields 0.0 so the third argument to mix() is 0.0, meaning the first argument to mix() is returned. texcoord.y being 0.0 is below 'center' of 0.5 so the MaterialX spec states that 'valueb' should be returned, and yet the returned first argument to mix() is 'valuet'. Similarly, when texcoord.y is 1.0 being above a 'center' value of 0.5 the MaterilX spec states that 'valuet' should be returned, and yet this glsl implementtion returns 'valueb' in this case. The same applies to `ramptb` and `ramp4` nodes, and also in the MDL backend. This commit fixes this issue at the source OSL, GLSL and MDL files for `splittb` and `ramptb` nodes, and the node-graph implementation for `ramp4` node.
…ySoftwareFoundation#2722) Reinstate prior API behavior for NodeDef.getImplementation() and introduce new accessor. Based on feedback from Bernard here AcademySoftwareFoundation#2701. Add new method to access the implementation elements directly.
This changelist adds initial Python 3.14 jobs to the GitHub CI build matrix for MaterialX.
…Foundation#2724) MATERIALX_INSTALL_STDLIB_PATH can be used to control where the data library is installed, but this needs to be reflected in the exported cmake config file as well. @jfpanisset reported this in this [slack conversation](https://academysoftwarefdn.slack.com/archives/C0230LWBE2X/p1765194306347839).
This changelist adds an initial nodedef comparison script to MaterialX, allowing a user to compare node definitions between a data library document (e.g. stdlib_defs.mtlx) and a specification document (e.g. MaterialX.StandardNodes.md), reporting any differences between the two in their supported node sets, typed node signatures, and default values. The new script builds upon the recent node formatting improvements proposed by the AOUSD Materials Working Group, which greatly increased the accessibility of the MaterialX specification documents to machine parsing and analysis. GitHub CI additionally calls the nodedef comparison script on each commit to MaterialX, providing a trackable history of the alignment between data libraries and the specification.
Building upon the work in the new `comparenodedefs.py` script, this changelist makes several improvements to the tables in the StandardNodes specification, bringing the specification into closer alignment with the data libraries. Using the output of `comparenodedefs.py` as a measure, this changelist reduces the number of differences between the StandardNodes specification and data libraries from 122 to 46. Additionally, this changelist enables GitHub CI for changelists containing only edits to Markdown files, so that `comparenodedefs.py` is run on changes that contain only specification updates.
…reFoundation#2735) Continuing the work proposed in AcademySoftwareFoundation#2385. I noticed this as more compiler warnings were raised in other work for windows CI. Add `-Wshadow` to non windows compile path. This aligns us a little closer with the strict Windows path warnings, making it easier to catch build errors locally before hitting CI. Fixed some shadowing issues in Metal code-path that were missed previously because of mis-matched compiler warnings. Need to add `-Wno-shadow` for dependency builds (IMGui/NanoGui). Also adding `-Wno-nontrivial-memcall` because of recent clang warnings building IMGui.
This changelist builds upon recent work on `NodeDef::getImplementation`, simplifying the method and its underlying caching strategy for clarity, while maintaining all aspects of its behavior. Two important cases that were considered here are shader generation and LibsToOso.cpp, each of which requires different handling of graph indirection.
## Purpose - Add in Python docs into the MaterialX package for all modules - This allows for standard Python help and the ability to integrate this with things like type stubs (pyi) An example of this integrated into VSCode and PyCharm is shown - Tooling used to create html docs via tools like Sphinx but does not add any reliance on such tools. ## Changes - The existing build flag `MATERIALX_BUILD_DOCS` is used to: - Build docs with XML `Doxygen` output as extracted from C++ code. - Run a utility script to parse the XML to insert into PyMaterialX module files. - The flag is enabled when building Python wheels.
This changelist updates all OSL version checks in the MaterialX data libraries, extending support to OSL versions beyond 1.x.
) This changelist contains an initial set of formatting proposals for the PBR Nodes specification, organized by the AOUSD Materials Working Group. In addition to the formatting updates, details on the expectation of energy preservation for the specular BSDFs in MaterialX have been added, including a link to Emmanuel Turquin's 2019 paper.
This changelist adds a new GitHub CI step to compare the PBR Nodes specification and PBR data libraries using comparenodedefs.py. Based on the results of the new GitHub CI step, several minor improvements to the PBR and Standard Nodes specifications have been made: - Update the data type of `absorption` inputs from `color3` to `vector3` to match the data libraries. - Update the name of `absorption` outputs to match the data libraries. - Update the data type of the `intensity` input of the `light` node to match the data libraries. - Simplify the data tables for the `displacement` node, but leave it in the Standard Nodes specification. Additionally, this changelist adds support for the `or` conjunction in `comparenodedefs.py`, interpreting it in the same fashion as a comma.
- Fix a race condition in the Document cache, where the `valid` flag could be simultaneously written and read from different threads. - Use a `std::shared_mutex` pattern in the Document cache for greater robustness and clearer guarantees. - Add an initial Thread Safety section to the Developer Guidelines.
This changelist makes improvements to the specification tables for the `convert` node, aligning them more accurately with the standard data libraries, and expressing the type variations of the node more compactly. With these changes, the number of differences between the standard node specification and data libraries reported by `comparenodedefs.py` is reduced from 46 to 38.
Comment was likely copied from setConnectedNode, but forgot to change `node` to `output`.
…on#2741) This changelist implements clarity improvements to the standard node tables in the specification, without altering their alignment with the standard data libraries. The following clarity improvements are included: - Fix typos in the output descriptions for the math nodes. - Fix typos and letter case in the input descriptions for the comparison nodes. - Merge signature tables for the `extract` node.
…ftwareFoundation#2746) Closes AcademySoftwareFoundation#2745 Please read Issue AcademySoftwareFoundation#2745 for more background details. This PR skips optimization "bypassing" values from the input of a node, if the node don't contain any inputs. This fixes a crash for documents where a custom node was defined which was classified as constant but had zero inputs.
…n#2747) * Use heuristic to preserve IOR for volumes. * Remove outdated comment.
…2716) This changelist fixes a reference to the `space` of a geometric node in the Standard Nodes specification, aligning an MTLX example with the stated syntax in the specification text.
…2752) Hi, this pr aims to fix cmake configure error of vtk-9.6.0 when building with openusd with materialx. In nixpkgs, the cmake configure system will complain ``` CMake Error at /nix/store/0b2sw8gp8qa0pqznnhirlm2gqx8h919b-python3.13-materialx-1.39.4/lib/cmake/MaterialX/MaterialXTargets.cmake:270 (set_target_properties): The link interface of target "MaterialXRenderHw" contains: X11::X11 but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. ``` also the target OpenGL::OpenGL X11::Xt is required to link with other MaterialX target. So, i believe MaterialX need to propagate dependency OpenGL/libX11/libXt for downstream project to link with.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.