URP shadows and light have strange artifacts

I’ve looked up several threads that said this type of stuff was fixed months ago, but I’m testing the latest Unity LTS (2020.3.18f1) and the Latest URP.
It seems that odd artifacting issues persist and this is preventing me from moving my project to URP.
Perhaps there is some series of settings I need to do to get rid of these artifacts and bad defaults, but my issue is that everything that I show using the built-in pipeline for comparisons below required no optimization. The built-in pipeline defaults just worked out of the box with no fiddling around whereas the URP defaults are terrible out of the box.
In my scene, there is only a single directional light, so this post doesn’t even begin to touch upon the issues with point lights that other posts refer to.

To summarize here are the main problems with URP shadows and lighting currently.

  • particle system has strange artifacts
  • shadows get cast on transparent objects
  • shadows have strange artifacts
  • post processing system doesn’t apply camera fog depth to character, and applies it too strong to environment.

I’ll post a bunch of pictures here to show all the issues.
Image 1: stange horizontal banding issue with URP shadows
7525193--928640--FootShadows.png
Image 2 : built in pipeline shadows without banding for comparison
7525193--928643--normalfootshadows.png
Image 3: built in pipeline particle effect where everything looks smooth


Image 4 : URP particle effect with really bad banding and color distortion with everything too white and bright

Image 5 : URP shadows on a character with bad banding in all the circled spots
7525193--928652--URPUMAartifacts.png

Due to 5 image limit per post, here are some more artifacts

Image 1 : built in pipeline transparent water without shadows, water is a good color


Image 2 : URP transparent water with shadows on transparent object and water looks neon blue instead of a nice dark blue
7525202--928664--WaterURP.png
Image 3 : built in pipeline post processing fog effect with good fog on both character and water that becomes appropriately stronger with distance from camera

Image 4 : URP post processing with character receiving no fog and environment receiving so much fog you can’t see anything

Image 5 : More strange banding issues with URP shadows

And here are the final 2 artifacts for this post.

In the first image, you can see the built in pipeline with some small shadows near the corner, but in the second image, you can see with URP that those artifacts are highly triangular and exaggerated.


I’m having similar issues since “upgrading” from the legacy renderer to URP ( v10.7 ). In our case its most noticeable on terrain, specially where the angle between directional light direction and the surface normal is near 90 degrees. Changing normal bias or depth bias doesn’t change it (just shifts the error). Same goes for cascade setup and shadow resolution. The effect just gets more or less “sharp”.

1 Like

This is an issue of shadow resolution (or rather, relative resolution on the shadow map). I asked before about the shadow quality difference, and at least some of those artifacts is because URP is using a conservative projection matrix for shadows. So the relative resolution of shadows in URP is much lower than builtin (depends on scene geometry; if you have big pieces of geometry like terrain or buildings then it will be a problem), even though the actual texture is the same resolution.

This may or may not be fixed eventually, but don’t hold your breath. You can use 4 cascades + tons of soft shadow blurring to mostly mitigate it, but of course this comes at a performance cost. I eventually went with “screw this; I’m implementing stencil shadows”. If all you need is a single directional light and are OK with requiring compute shader support, I might be able to hook you up (it’s open source, but not very easy to use; posted a bit about it over here ).

The other artifacts (ones from your first 2 posts and @turborilla-hans 's picture) must be caused by something else. Sorry I can’t be more helpful. URP shadows are a bit of a mess.

3 Likes

Did u find any fix for this? i’m almost going back to built in or switching to HDRP…