URP Lit shader is white on certain computers

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?

Are the GPU drivers updated on both systems?
What are the pc specs?

Up to date drivers on both system

Broke PC 1 is
Win 10 Latest
Ryzen 5 3600
AMD Vega 64
16GB @ 3200Mhz

Broke PC 2 is a
Win 10 Latest
Ryzen 9 3900X
Nvidia GTX 1080
32GB @ 3200Mhz

A complete stab in the dark, but does disabling the SRPBatcher resolve the issue?

Disabling the SRPBatches does not resolve the issue

1 Like

Last guess: does it happen from certain angles? Maybe it’s specular lighting.

If not, make a bug report and maybe link this thread

Hey, have you checked the Frame Debugger?

Maybe the debugger can tell which step of rendering goes wrong.

Also, are you using any new feature in 2022.2? (Forward+, Full screen blit, …)

1 Like

Also if you use render doc to capture the render and post it here that would help provide more info

All angles. Going to check it with render doc in a min.

I really appreciate everyone’s input :slight_smile:

Its the old forward renderer, I dont think we are using any new features specificallly.

Here it is, I’m not sure what I would be looking for but it seems that when it draws the plane it has the texture sampler assigned but it just comes out white.
https://drive.google.com/file/d/14uFkc9AbTxAKA_lNgEPnd7uybta4j1oh/view?usp=share_link

8722995--1179621--upload_2023-1-11_18-46-4.png