Unity 2022.2.1f1. URP 14.0.4
On my home computer, my scene in editor looks like this.
On my other computer, it looks like this
The floor plane is using the built in URP Lit shader. Switching it to another shader (eg, simple lit) renders correctly. Anything using the Lit shader looks this way, including when its in a build.
Things I tried to resolve it:
- Delete the library and reimport
- Built the game and ran it (Built games have the same issue)
- Copy my shader cache from my home PC to see if it would make any difference
- Tried to debug the shader. UnityShaderCompiler prints ‘Unhandled exception: Protocol error - failed to read magic number (error -2147483644, transferred 0/4)’ but thats the extent of any issue I could find with it.
- Tried on another PC, where the issue happened again.
- Compile the shader in editor. This never seemed to finish, but the ShaderCache for the Lit shader kept growing in size. The logs show 2 ‘errors’ relating to the Lit shader, but they look more like warnings to me, and the compiler seems to think that the shader variant compiled.
Cmd: compileSnippet
insize=3553 file=Packages/com.unity.render-pipelines.universal/Shaders/Universal Render Pipeline/Lit pass=ForwardLit ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=_LOAD_OF_DEFINES_ flags=0 lang=3 type=Fragment platform=d3d11 reqs=1101803 mask=6 start=98 error: 1 plat 4 at E:/buildkite-agent/builds/windows-1/software/dev-launcher/Library/PackageCache/com.unity.render-pipelines.universal@14.0.4/ShaderLibrary/GlobalIllumination.hlsl(205): gradient instruction used in a loop with varying iteration; partial derivatives may have undefined value
error: 1 plat 4 at E:/buildkite-agent/builds/windows-1/software/dev-launcher/Library/PackageCache/com.unity.render-pipelines.universal@14.0.4/ShaderLibrary/GlobalIllumination.hlsl(206): gradient instruction used in a loop with varying iteration; partial derivatives may have undefined value
error: 1 plat 4 at E:/buildkite-agent/builds/windows-1/software/dev-launcher/Library/PackageCache/com.unity.render-pipelines.universal@14.0.4/ShaderLibrary/LightCookie/LightCookieInput.hlsl(102): gradient instruction used in a loop with varying iteration; partial derivatives may have undefined value
ok=1 outsize=39834
Been looking at this for over 2 weeks, its impacting our build system. Its not just this project either, one other project has the same problem.
Has anyone else seen this before?