Fix Standard surface -> glTF PBR translation: thin_walled and transmission_depth #2644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_depthwas used for thickness, which do not correspond to glTF PBRs thickness. I have changed it to be used forattenuation_distancewhich correspond totransmission_depth, (with the caveat that in glTF PBR it should >0, asbase_coloris used to color the surface even forthin_walledtransmissive materials).From Standard Surface - 3.8 Specular Transmission
From KHR_materials_volume