Hey I’m new to Unity since 3.0, and whenever I would add a terrain, then a directional light and turn shadows on I would get artifacts everywhere(pic on left), and reading around a few people seemed to have this problem, most suggested to change shadow settings and quality, which I tried to no success, so just playing around I found if I rotated the light on the Z-axis to around 230, or -120, it would get rid of the artifacts (pic on right). Just thought I’d post this fix if anyone else is having this problem, and see if its a bug or I’m doing something wrong.
You need to increase the bias a little, that should fix it.
I had already tried that, and it did make it look better, but I had to crank it to the max which messed with how the shadows looked, and there was still artifacts, but rotating the light actually works better, which is fine since z-axis doesn’t change the angle of the light or anything… Just a weird thing.
I have similar problem, changing bias does not doo big difference, rotating light yes. It is not perfect, but in most cases it almost OK.This is deffinitely bug.
I tried on totally different HW and same problem. I made bug report for this for the third time, maybe this time somebody will notice.
Have you tried on Unity 3.3?
I have been having the same issue even in 3.3 and is annoying me a lot. It is mostly related to the size of objects being shadowed ( a terrain for example) and can be reduced by increasing the shadow bias. however to really eliminate the artifact, one would end up with shadows noticeably detached from the objects due to the large bias.
I also found another issue with directional shadows. If you set the “Near Clipping plane” in the camera settings to something below 0.3 and have a relatively large terrain ( 2000-4000 span), the shadow on the terrain features will start to pulse (appear and disappear quickly) which is not tolerable at all. You can set the near clipping plane to a very small figure and see how visible the artifact becomes.
The problem disappears when setting higher near clips but with a drawback of being able to see through walls! unless you increase your character controller’s radius. however this will make a very fat character who would get stuck every where…
I really ask the folks in Unity to pay further effort to fix or at least find a work-around to the aforementioned issues.
Which graphic card do you have? Anyway I made bug report for this long time ago, no reply at all.
Shadow shaking can be solved by setting shadow cascade to four, instead of two, or one. Anyway i dont understand why is such setting there, because without it it is useless and there is no noticable performance loss.
Geforce 8800M GTX
The issue occur even when maxing out all quality settings eg. 4 cascades, high res, etc… even reducing shadow distance does not make any difference at all.
the only three solutions that would limit the artifacts are reducing Near clipping plane, increasing shadow bias and the reducing the size of your scene. But as I stated earlier, these also pose new problems that may not be tolerated.
Only sollution is to make bug report every day, until somebody finally do something.
Dynamic terrain shadows have been “broken” in this way forever. It’s a common shadowing artifact that every engine will run into. You can (as has been mentioned) mess with the bias and clipping planes and pray.
Google for “shadow acne” for some examples. There are ways to limit and improve the problem and some technical articles (GPU gems, etc), but there have been no visible improvements to the horrible moiré and self-shadowing artifacts inside Unity for years. It looks like they’re already using some of the common techniques, but IMO it renders dynamic shadows on terrain useless. If you really need these, try a different engine.
Well, this is not sollution. Sollution is to kick Unity team to do something with it, we are in 2011.
well, there were lots of improvements for shadows in 3.4 (will be released shortly) - so just wait and try again
I had the same problem…
Try: disable ‘cast shadows’ of the Terrain in the Terrain Settings…It fixed the problem for me, no more artifacts on the terrain…
Well, this really helps for terrain, but terrain should cast shadows, so this is not fix, just turning off bugged feature. And it of course does not solve same problem with meshes…
Wow, surprised to see this ‘bug’ still exists in Unity 4.1. Unity’s dynamic lighting seems to be really bad… I can’t light a simple log wall without the shadows flickering and never being accurate.
Yep, I have the same problem… Tried rotating, bias, bug report and no solution in July 2013.
This doesn’t happen in UDK(Cant wait to hear a fanboy make a suggestion) Unity team seems to be monopolizing and leave the basics behind, hopefully one day we will have some competition that will concentrate more on improving the engine instead of expanding platforms. (terrain with height map 1024 costs 740 draw calls)…
Been using unity in the 1.x cycle so I dont really want to change engines besides I like unity a lot more then UDK but if there was even a decent alternative I’d move, and yes I own a pro unity 4 license
Does anyone know if there has been a solution to this issue in 5.0? I’m still getting the shadow artifacts after messing with a variety of settings. Changing the near clip plane and upping the bias are the only things that help but those are terrible solutions.
Agreed, increasing the bias causes peter panning. This is really not a problem in other engines.