Shader error in 'Shader Graphs/glTF-pbrMetallicRoughness': 'PBRDeferredFragment': cannot convert from 'struct v2f_surf' to 'struct SurfaceDescription'

Unity 2022.3.42f1, com.unity.cloud.gltfast 6.7.0 · June 28, 2024, Universal RP 14.0.11 · August 06, 2024.

I’m getting a lot of built-in shader variants compiling for glTF-pbrMetallicRoughness shader from com.unity.cloud.gltfast package despite URP pipeline being installed in the project settings/Graphics.

In the Editor.log I see that Unity tries to compile the BuiltIn Forward variant of this shader graph despite URP being set in the project.

Compiling shader “Shader Graphs/glTF-pbrMetallicRoughness” pass “BuiltIn Forward” (fp)
Full variant space: 774144
After settings filtering: 774144
After built-in stripping: 136704
After scriptable stripping: 5696

After this I’m getting the error:

Shader error in ‘Shader Graphs/glTF-pbrMetallicRoughness’: ‘PBRDeferredFragment’: cannot convert from ‘struct v2f_surf’ to ‘struct SurfaceDescription’ at /Projects/dex-core/Library/PackageCache/com.unity.shadergraph@14.0.11/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/PBRDeferredPass.hlsl(145) (on d3d11)

Compiling Subshader: 1, Pass: BuiltIn Deferred, Vertex program with DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADOWS_SHADOWMASK _MAIN_LIGHT_SHADOWS _SHADOWS_SOFT
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_DEFERRED UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
Disabled keywords: INSTANCING_ON LIGHTMAP_ON LIGHTPROBE_SH SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_HDR_ON UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _EMISSIVE _GBUFFER_NORMALS_OCT _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _MIXED_LIGHTING_SUBTRACTIVE _OCCLUSION _TEXTURE_TRANSFORM _TRANSMISSION

I managed to overcome this error by making a local copy of the GLTF package and removing the Built-In target from glTF-pbrMetallicRoughness.shadergraph. Still, I’m missing some random shader variants in the built game.

What is going on and how do I debug this?

2 Likes
2 Likes