Conversation
Set for ORM for boombox.
fallenmi
left a comment
There was a problem hiding this comment.
The vector3 gltf_image path now matches the existing color3, color4, and float variants: factor is declared on the NodeDef, its neutral default preserves existing documents, and the implementation graph applies it before returning the sampled value. This enables the intended per-channel ORM scaling without changing the default result.
I verified exact head a4de710993f61d0087c70f197b21367ae8dce07c against exact base 39e4c9e04580bb690235667f6b28686e60344773 and current GitHub merge 3f2db9abc2cc2d8cc23c442741a6bc58dde616a1 using the public MaterialX 1.39.5 APIs. A factor-bearing vector3 document is rejected at base with the expected NodeDef interface error; at head and merge it validates and generates factor * image_out in GLSL, MSL, OSL, and MDL. The combined library, boombox example, and neutral-factor compatibility control also validate. All 35 check runs and EasyCLA are green.
Disclosure: I used Codex to inspect the change and run exact-base, exact-head, and current-merge validation and shader-generation oracles. I verified the results and live pull-request state before preparing this review.
Update
Fixes glTF Vector3 image definition variant does not include a scale factor #3054
Fix the vec3 version of
gltf_imageto have image scaling factor as with other variants.This allows for looksup like ORM (occlusion, roughness, metallic) to fully support the roughness and metallic scaling factors as defined by the glTF specification.
Change
factorinterface input togltf_image(vec3 variant) of glTF libraryResults
This is a sample glTF converted to MaterialX. The ORM texture is scaled in roughness and metallic channels.
glTF
{ "asset": { "generator": "pygltflib@v1.16.5", "version": "2.0" }, "images": [ { "uri": "resources/Images/brick_base_gray.jpg", "name": "gltf_color" }, { "uri": "resources/Images/brick_roughness.jpg", "name": "gltf_metallic_roughness" } ], "materials": [ { "pbrMetallicRoughness": { "baseColorFactor": [ 0.7714629769325256, 0.0016784999752417207, 0.011678500100970268, 0.5 ], "metallicFactor": 0.2, "roughnessFactor": 0.8, "baseColorTexture": { "index": 0, "texCoord": 0 }, "metallicRoughnessTexture": { "index": 1, "texCoord": 0 } }, "emissiveFactor": [ 0, 0, 0 ], "alphaMode": "OPAQUE", "doubleSided": false, "name": "gltf_pbr_surfaceshader" } ], "samplers": [ { "magFilter": 9729, "minFilter": 9986, "wrapS": 10497, "wrapT": 10497 } ], "textures": [ { "sampler": 0, "source": 0, "name": "gltf_color" }, { "sampler": 0, "source": 1, "name": "gltf_metallic_roughness" } ] }MaterialX Equivalent
The
factorinput on the ORM image (image_orm) match to the glTF factors as a vector of[ occluson factor = 1, roughness factor, metalic factor ]. The
colorscaling factor onimage_base_coloris already supported.MaterialX Graph Editor
The resulting graph looks like this in the graph Editor