0

I started using shader graph and created one shader, then I tried building my game however I get this error:

Shader error in 'Shader Graphs/blend': 'PBRDeferredFragment': cannot convert from 'struct v2f_surf' to 'struct SurfaceDescription' at /unfinishedProjects/handsignes/handsignes/Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Includes/PBRDeferredPass.hlsl(145) (on d3d11)

Compiling Subshader: 0, Pass: Pass 2, Vertex program with LIGHTPROBE_SH SHADOWS_SHADOWMASK
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS 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: DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS 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 \_GBUFFER_NORMALS_OCT \_MAIN_LIGHT_SHADOWS \_MAIN_LIGHT_SHADOWS_CASCADE \_MAIN_LIGHT_SHADOWS_SCREEN \_MIXED_LIGHTING_SUBTRACTIVE \_SHADOWS_SOFT\

I tried creating new project, copying shadergraph graph file there and building a scene with just a cude which uses material with that shader. This project has been built without any errors.

That's why I think that the problem is probably some project settings. I tried comparing every line of project settings with another project but they were equal.

I don't know what is causing this problem. if you need any screenshots of settings - ask and I will send any.

Jekuper
  • 25
  • 3

1 Answers1

0

Found the reason for this behaviour. Shader graph doesn't support built in renderer. Had to switch to URP instead.

Jekuper
  • 25
  • 3
  • 1
    The thing is, since version 2021.2 **Shader Graph DOES support SRP**, there is even a way to create it in the editor [(Proof)](https://imgur.com/a/KU6Xh9g). **However**, after trying to build the project all of the shader graphs may break and cause error you've mentioned. It is unclear to me why that happens, but something is definitely wrong. – sweatyDev Feb 05 '23 at 09:17
  • Yes, shader graph supports SRP, but as stated in [documentation](https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Getting-Started.html): _Shader Graph is only compatible with the Scriptable Render Pipelines (SRPs), namely the High Definition Render Pipeline (HDRP) and the Lightweight Render Pipeline (LWRP). These two SRPs are available in Unity 2018.1 and later. **The legacy built-in render pipeline does not support Shader Graph.**_ – Jekuper Feb 10 '23 at 13:23
  • @Jekuper my project wasn't touched for a few months and when I opened it, its started giving me this error. although before I left the project I was able to build without any problems. Now I'm getting errors with shadergraph on builtin. – majidarif Feb 11 '23 at 13:31