MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

glTF PBR Clearcoat interaction with Emission

Open bowald opened this issue 3 months ago • 0 comments

closes #2592

This PR will darken the emission color by a weighted clearcoat fresnel factor from KHR_materials_clearcoat

coated_emission = emission * (1 - clearcoat * clearcoat_fresnel)

Screenshots of a red emissive material with a clearcoat.

MaterialXGraphEditor_djwiexXuWH MaterialXGraphEditor_lBI0QFpkee chrome_XpDlrBBniD
Before PR: No clearcoat fresnel interaction After PR: Emission darken by clearcoat_fresnel Reference rendered using gltf_sample_viewer

Material

  <gltf_pbr name="gltf_pbr_surfaceshader" type="surfaceshader">
    <input name="metallic" type="float" value="0" />
    <input name="emissive" type="color3" value="1, 0, 0" />
    <input name="base_color" type="color3" value="0, 0, 0" />
    <input name="clearcoat" type="float" value="1" />
    <input name="clearcoat_roughness" type="float" value="0" />
  </gltf_pbr>

Discussion:

I ended up implementing Schlick Fresnel returning floats using nodes. I was planning to use the generalized_schlick node, however they returned distribution functions, is there an option to use the included schlick nodes or is how I have dont it in the PR a good way?

bowald avatar Oct 22 '25 12:10 bowald