The GLSL and MDL implementations correctly treat it as a point (w=1), which includes translation:
The OSL implementation is also inconsistent with its corresponding vector2M3 variant, which correctly casts to point to include translation:
sourcecode="transform({{mat}}, point({{in}}))"
The OSL implementation of the vector3M4 variant of
transformmatrixtreats the input as a direction (w=0), ignoring the translation component of the matrix:https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx#L501
The GLSL and MDL implementations correctly treat it as a point (w=1), which includes translation:
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genglsl/mx_transformmatrix_vector3M4.glsl
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/source/MaterialXGenMdl/mdl/materialx/stdlib_1_6.mdl#L2302
The OSL implementation is also inconsistent with its corresponding vector2M3 variant, which correctly casts to point to include translation:
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genosl/mx_transformmatrix_vector2M3.osl
One proposed fix would be the following: