Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directional Shadows Messed Up #7

Open
GeorgeDziov opened this issue Apr 9, 2018 · 4 comments
Open

Directional Shadows Messed Up #7

GeorgeDziov opened this issue Apr 9, 2018 · 4 comments

Comments

@GeorgeDziov
Copy link

GeorgeDziov commented Apr 9, 2018

After adding PCSS and turning on realtime GI shadows started changing resolution randomly and light started bleeding frequently. When I turn camera at some specific angle shadows become blurry and very low res no matter the quality settings.

I can't return shadows back to normal even when I remove PCSS folder and disable GI. This also affects all projects including new empty ones so I'd like to know how to restore default directional shadows. Point and spot lights are normal.

Link to Youtube https://www.youtube.com/watch?v=xRB6QEwvwgE

@chrisnolet
Copy link

It’s really strange that this issue persists even after removing PCSS. It might be worth removing the project’s Library and Temp directories, and have Unity rebuild them.

On the surface, it looks like an issue with the shadow projection and/or cascades. Does ‘Stable Fit’ and ‘Two Cascades’ or ‘Four Cascades’ help? It might also be worth reducing the shadow distance down to 20 or 30, too, to see if that helps.

Does a fresh install of Unity make a difference?

@GeorgeDziov
Copy link
Author

Just finished trying all suggestions - actually, while my current scene stays broken, there are some good results in general - shadow resolution is now normal again although directional shadows are still fuzzy but not as horribly as before so thanks for that.

Hope to get rid of fuzziness too, I had great shadows before even with 10K distance. Maybe it's some kind of scripting stuff? I tried restoring directional shadow shader but it did nothing. :(

@chrisnolet
Copy link

chrisnolet commented Apr 21, 2018

I'm glad those suggestions helped a little!

With shadows at a distance of 10k, it sounds like they may have been baked shadows. Is that possible/correct? By default, I believe mixed-mode lights project realtime shadows when static objects are within the shadow distance. Beyond the shadow distance, static objects revert to baked shadows.

You can change this behavior, so that static objects always use baked shadows, regardless of whether they're within the shadow distance or not. If you have static objects with baked shadows, try setting the Shadowmask Mode in Quality to 'Shadowmask' and see if that helps.

(Note that realtime and baked shadows have a different 'look', which is why it's not normally recommended to mix and match the two side-by-side, but it can work.)

Other than that, some other things to try for realtime shadows:

  • The shadow resolution might still be too low: start with Very High Resolution and work backwards.
  • Normal bias could be too high: try something around 0.05, just to see if that's the issue. (Revert if it's not.)

I'm not sure if UnityPCSS changes anything deeper in terms of the lighting setup, or if it has any lingering effects after being removed. (I'll leave the author of the asset to comment on that.) As you said, it's possible something more-complex is going on that's beyond me I'm afraid.

Hope this helps a little more though!

@GeorgeDziov
Copy link
Author

Nah I try to avoid baking shadows (and I really regret I turned realtime GI on)...
Tried fiddling with bias and resolution more, no more results unfortunately.

I just found that shadows don't change resolution at random. They change resolution based on how far I look. I mean if there's only a couple small cubes in scene, shadows are high res but if I put a big cube or a small cube far away, shadows get clunky. But when I look down, shadows are normal again cause only thing I see there is floor.
It worked different before turning on realtime GI with PCSS included - shadows got blurry only when I increased the shadow distance in Quality setting.

Anyway thanks for helping Chris, at least I got somewhere with those darn shadows! XD

Well, I'll be waiting for author to solve the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants