Unity 5 Directional Light Shadow Flicker

Hello,
after I updated my project to Unity 5 all of the shadows starting to flicker.
In Unity 4.6 was no flicker with the setup.

Maybe is this a known bug?

Changing the near clipping distance of my cameras from .01 to .1 fixed the flickering for me.

[Fixed] I came across this issue as well today I am posting because I actually found the answer to shadows flickering and what not with out the help of the forums.

After trying every setting I narrowed it down to the cascade distances of the shadows. After adjusting the “cascade splits” and “total cascades” I was able to remove this flicker effect completely.
They are set to a default setting and depending on the camera ditance to your world you will want to adjust these to fit your needs. I hope this helps someone.

I had this problem after adding a huge plane in the scene (water).
So turn receive and cast shadows off on the plane or huge object.
Worked for me

We’re having the same issue. Moving the znear from 0.1 to 1 improves the flickering, but is not an acceptable solution for our project.

Same issue here. Deferred, linear, HDR (and I made sure of it).

What I did is to move the directional Light near the objects and it worked. This doesn’t make any sense as directional light is infinite but it did the trick to me. I hope I can save some time to anyone else, this is clearly a bug.

Similar problem with me. What I did was adjust the ‘bias’ of the main directional light in my scene. Worked like a charm.

They way I fixed this problem is by selecting the light that is flickering, going down to where is says Render Mode and changing the setting Auto to Important (Worked for me). I hope this helps someone!

I too suffered with this issue. For me the solution was the shadow Bias on my main directional light. I had a very low value of 0.05 or something silly. When I cranked it up to 1 my shadows were perfect with no flicker. Lower the value the more flicker.

The low near field clipping value fix also fixed a alignment issue with my global fog. Very strange but it seems low values do have strange effects on the deferred pipeline.

The fix for me was setting the rotation on my directional light to have integral values for each axis.

I was able to fix this by unchecking “Cast Shadows” under terrain settings. I really hope they fix this.

Problem is worse in the Editor view than the Game view. I have not actually built the project to see if this problem persist after building.

Maybe something within the Quality settings (Edit > Project Settings quality) in the “Other” section you find the “Blend Weights” option. It tells the max number of bones which can influence one vertex.

I found my own solution,
changed the near clipping plane form o.1 to 0.5

Hope this helps

I also found it to be the camera near clip plane to be too low which caused it.

After trying everything and reverse engineering everything I tried before, I was able to find an interesting culprit; Occlusion culling.

I cleared Occlusion culling and the shadows stayed and no longer flickered away when I looked at them or moved to different angles.

What I initially noticed was the tree shadows were fine, I was using the terrain/tree painter instead of hand placing.

I’m going to re-run occlusion to see what happens.

For me, cranking up the bias in the directional light did the tick just fine.

I solved my problem:

I have a scene with a quite complex hierarchy…
•some point lights WITH shadows
•main directional light WITH shadows [realitme]
•main player with Camera [far = 20000, near = 0.05]
•Rendering mode is Deffered
•Lighting - baked

My solution was to disable all SHADOWS for Point Lights. Now it’s okay. It seems that the deffered rendering mode is limited by the shadow casting or something like that.

What worked for me, was changing the Camera projection from perspective to Orthographic. :slight_smile: I hope this helps