Skip to content

Commit

Permalink
warn when importing legacy material KHR_materials_pbrSpecularGlossiness
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Aug 26, 2023
1 parent 5ce70f9 commit dfdee04
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ protected virtual async Task ConstructMaterial(GLTFMaterial def, int materialInd

if (_gltfRoot.ExtensionsUsed != null && _gltfRoot.ExtensionsUsed.Contains(specGlossExtName) && def.Extensions != null && def.Extensions.ContainsKey(specGlossExtName))
{
Debug.Log(LogType.Warning, $"KHR_materials_pbrSpecularGlossiness has been deprecated, material {def.Name} may not look correct. Use `gltf-transform metalrough` or other tools to convert to PBR.");

if (!string.IsNullOrEmpty(CustomShaderName))
{
mapper = new SpecGlossMap(CustomShaderName, MaximumLod);
}
else
{
#if UNITY_2021_3_OR_NEWER
// This isn't fully supported. KHR_materials_pbrSpecularGlossiness is deprecated though, so we're warning here.
mapper = new PBRGraphMap();
#else
mapper = new SpecGlossMap(MaximumLod);
#endif
}
}
else if (_gltfRoot.ExtensionsUsed != null && _gltfRoot.ExtensionsUsed.Contains(unlitExtName) && def.Extensions != null && def.Extensions.ContainsKey(unlitExtName))
Expand Down

0 comments on commit dfdee04

Please sign in to comment.