Add extract node support for matrix33 and matrix44 types#2812
Conversation
Add extract node definitions for matrix33 and matrix44 types, enabling row vector extraction by index from matrices. - matrix33 extract returns vector3 (row index 0-2) - matrix44 extract returns vector4 (row index 0-3) Includes node definitions, implementations for GLSL, MDL, and OSL backends, and corresponding unit tests.
|
|
|
In the MaterialX Proposals document https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/documents/Specification/MaterialX.Proposals.md#propose-stdlib-nodes something essentially identical to this is proposed for addition to the spec, although there it was called <extractrowvector> which is marginally clearer. Is there a strong feeling from the community which node naming would be preferred for this? |
|
Also noting that if we add a new node or new signatures for an existing node, the MaterialX.Specification.md document must also be updated to keep them in sync. |
|
About the documentation : it would mean that extract purpose instead of extracting float from vectors, it would be more : extract a n-1 dimension subpart from a n dimension aggregate. What do you think ? |
Add documentation for the new extract node variants that operate on matrix33 and matrix44 types (extracting row vectors by index)
…/MaterialX into extract-matrix-support
|
The changes to MaterialX.Specification.md look good to me; I'll let other reviewers approve the code changes. |
|
This looks really promising, @JHUbisoft, and thanks to @dbsmythe for the specification language review. Let's plan to take a close look at the implementations soon, so that we have the option of including this work in v1.39.5 if it's ready to merge. |
|
@JHUbisoft The GLSL and MDL implementations look correct to me, but am I right in my observation that the |
Add two overloads in mx_funcs.h: - vector mx_extract(matrix33, int): extracts row by index - vector4 mx_extract(matrix, int): extracts row by index
…/MaterialX into extract-matrix-support
Oups, you are right. I have added OSL code. |
jstone-lucasfilm
left a comment
There was a problem hiding this comment.
This looks good to me, thanks @JHUbisoft!
5e0e578
into
AcademySoftwareFoundation:main
|
Thank you |
Add extract node definitions for matrix33 and matrix44 types, enabling
row vector extraction by index from matrices.
Includes node definitions, implementations for GLSL, MDL, and OSL
backends, and corresponding unit tests.