Skip to content

Conversation

@bowald
Copy link
Contributor

@bowald bowald commented Oct 23, 2025

Thickness in glTF PBR is used to describe how thick a mesh is. If it's thin walled, thickness is 0, otherwise it should be a value corresponding to a mesh, in a ray tracer, you will have that info when rendering, for a rasterizer you either bake it or use an arbitrary value (such as longest side of the bounding box).

Since Thickness is a mesh related value, we can't translate to the expected value, unless the material is considered thin_walled. Then it should be 0. I have updated the translation graph from Standard surface to set thickness to 0 if thin walled, otherwise 1 (which is better then nothing).

Previously transmission_depth was used for thickness, which do not correspond to glTF PBRs thickness. I have changed it to be used for attenuation_distance which correspond to transmission_depth, (with the caveat that in glTF PBR it should >0, as base_color is used to color the surface even for thin_walled transmissive materials).


From Standard Surface - 3.8 Specular Transmission


From KHR_materials_volume

@jstone-lucasfilm
Copy link
Member

This looks promising, @bowald, and I'll just highlight the validation error that shows up in GitHub CI:

Shader translation of D:\a\MaterialX\MaterialX\build\bin\resources\Materials\Examples\StandardSurface\standard_surface_brass_tiled failed
Validation errors: Invalid port connection: <output name="thickness_out" type="float" nodename="thickness_from_thin_wall">
Invalid port connection: <output name="thickness_out" type="float" nodename="thickness_from_thin_wall">

@bowald bowald force-pushed the stdsurf-gltf-fix-attenuation-distance branch from 97a0df7 to 95f5cf0 Compare October 24, 2025 06:52
@bowald
Copy link
Contributor Author

bowald commented Oct 24, 2025

Thanks for pointing it out @jstone-lucasfilm.
I changed the node name last thing I did. Great that the CI system catches these thing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants