MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Transmission support in Standard Surface to glTF PBR translation

Open kwokcb opened this issue 8 months ago • 3 comments

Issue

Unlike standard surface and openpbr, base color on gltf pbr affects transmission. This seems to be the way it's supposed to work but is inconsistent with the other shading models.

For example if you take the glass example which has a base value if 0, this renders as a "clear" material using standard surface and openpbr, but renders opaque black with gltf pbr.

Test

This is the glTF after translation, but can just create a material and set baseColorFactor to 0 and transmissionFactor to non-0.

"materials": [
    {
      "extensions": {
        "KHR_materials_transmission": {
          "transmissionFactor": 1
        },
        "KHR_materials_ior": {
          "ior": 1.5
        }
      },
      "pbrMetallicRoughness": {
        "baseColorFactor": [
          0,
          0,
          0,
          1
        ],
        "metallicFactor": 0,
        "roughnessFactor": 0
      },
      "emissiveFactor": [
        0,
        0,
        0
      ],
      "doubleSided": true,
      "name": "SR_glass"
    }
  ],

Result in model-viewer: image

Result in MaterialX Graph Editor: image

Workaround

Modify the base color to be white.

CC'ing @proog128 , @emackey as a possible item to check for future OpenPBR compatibility.

kwokcb avatar Nov 15 '23 15:11 kwokcb