Search Unity

Question Shadow flicker on terrain with camera movement

Discussion in 'General Graphics' started by moltke, Jul 10, 2021.

  1. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    When I move the camera for the first second i get a flicker of the shadows on the unity terrain grass. When i am in constant motion it is not noticeable however when you adjust the camera back and forth or move it once and stop it is very noticeable in dim lighting (night). When lighting is very intense it seems to be gone.

    I have attached a few video examples of what I am experiencing



    I am using unity 2020.1.17f1, standard unity, linear and deferred

    I have played around with detail resolution per patch on the terrain
    I have changed the camera near clip plane
    I have turned off all camera components
    I have played with the quality settings and shadow settings
     
    Last edited: Jul 11, 2021
  2. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    anyone have any thoughts?
     
  3. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
  4. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,742
    Thanks for providing vids of the prob, and i see what your talking about.

    "I have played around with detail resolution per patch on the terrain", that wont help in this senario, its not about how much coverage there is, per patch.
    "I have changed the camera near clip plane", dont think this is a, draw distance prob.
    "I have turned off all camera components", nice and correct way to "narrow things down", shut things off, till you see a change.
    "I have played with the quality settings and shadow settings", very good.

    Hopefully something i write may spark something, to solve the prob. My gut feeling is this is a lighting issue, not camera, shadows, or view distance, etc. All foliage is effected, but not once did you mention Directional Light, or lighting. And lighting effects all terrain objects. Another thought is textures and materials.
     
    PutridEx likes this.
  5. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    I've turned all lighting off, direct and ambient. Still can't figure out what is causing it.
     
  6. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    anyone with any other thoughts?
     
  7. CaffeinatedCoolaid

    CaffeinatedCoolaid

    Joined:
    May 10, 2021
    Posts:
    59
    Check you camera settings, if you have the NearPlane set to really low then the FarPlane needs to be lowered as well because z-fighting issues can occurs and this can show up as flickery shadows.

    Does this effect you game camera as well?
    Does it happen in build?
    Does this happen in forward?
    Are terrain shadows turned on?
    Have you messed with the shadow settings?
    Third party shaders or post effect?
    A lot of variables to consider, a little more info might help.
     
  8. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    I would suggest look into reflection probes and also settings for motion vectors
     
  9. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    Does this effect you game camera as well? - yes
    Does it happen in build? - yes
    Does this happen in forward? yes
    Are terrain shadows turned on? - yes
    Have you messed with the shadow settings? - no, i even uploaded into a fresh project still same problem
    Third party shaders or post effect? - turned off all effects on the camera and it still happens
    A lot of variables to consider, a little more info might help.

    I would suggest look into reflection probes - no difference still occurs
     
  10. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,742
    I remember this post, alot of good suggestions, any resolve yet?
     
  11. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    I have not figured out what to do yet.
     
  12. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    Hi guys I made another video. I am still struggling to figure out this issue. I would really appreciate anyone's input

     
  13. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    I was thinking the same thing.

    I noticed that some of the flickering shadows, have sperical shapes, like an inner sphere shaped shadow, surrounded by an an outer sphere shaped shadow.
     
    Last edited: Jun 9, 2022
  14. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    I have this as well. It seems like its related to shadow cascades, this explains the circular pattern, but still no idea. Did you end up solving this?