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.
This PR adds a node definition and implementation of the glTF PBR material with the following extensions:
For extensive discussion and test models see KhronosGroup#1.
Known issues
No thin-walled support yet. In glTF, the material can either be thin-walled (thickness = 0) or volumetric (thickness > 0). A volumetric material has refraction. The implementation in this PR only supports the volumetric case, i.e., the node graph ends with a
surface
node. The alternative would bethin_surface
, but this seems to be not supported by MaterialXView. Besides, I wasn't able to figure out how to switch betweensurface
andthin_surface
based on an input.Occlusion is ignored. There is no concept of occlusion in MaterialX.
Thickness is ignored. There is no concept of a thickness map in MaterialX. Nevertheless, the parameter could be used to switch between thin-walled and volumetric.
Potential future additions
Add node definition and implementation for texture fetches. Most material parameters in glTF have a "factor" and a "texture". For example, there is
baseColorFactor
that modulatesbaseColorTexture
, i.e.,baseColor = baseColorFactor * texture(baseColorTexture, uv)
. Normal maps, on the other hand, have ascale
:normal = normalize(texture(normalTexture) * 2 - 1) * vec3(scale, scale, 1)
. By using these nodes for texture fetches implementations can ensure compatibility to glTF.Add support for KHR_materials_emissive_strength. Waiting for the extension to be ratified. This makes it possible to use values for emission that are greater than 1.
Add support for KHR_materials_iridescence. Waiting for the extension to be ratified. Layers a
thin_film
node on top of the specular BSDF.