Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Shadows on creates messy artefacts with alphas

Discussion in 'General Graphics' started by LtCalumbo, Aug 23, 2016.

  1. LtCalumbo

    LtCalumbo

    Joined:
    Jan 28, 2014
    Posts:
    32
    Hi there,

    This is a very recent problem for us that's never happened before today.

    I noticed all these artefacts around tress and foliage. I couldn't figure out what was causing it but then as I was clicking through different quality levels I saw that on the lower ones the artefacts disappeared.

    Then I realised that it's with shadows on that the artefacts appear. I don't know how this is causing a problem. Only way I can fix myself is to turn shadows off or turn shadow distance down to 2.

    Hope someone has a better fix than me lol. You can see in the attached image, the left side is with shadows off and right side they're on.

    I'm using 5.3.4f1

    Thanks for reading!
     

    Attached Files:

  2. LtCalumbo

    LtCalumbo

    Joined:
    Jan 28, 2014
    Posts:
    32
    Anyone? I've noticed that this doesn't happen with a dedicated gfx card. Just happens with integrated....
     
  3. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    I haven't seen this before, but I have a guess as to what's happening. I think your leaves have some invisible pixels that are rendered invisible by setting their alpha to 0 in the shader (because of your texture). Those invisible pixels still record their depth unless you "discard" them in the shader. In the shader you can write "if (outputColor.a < 0.05) discard;", or if you're using a standard unity shader, use a "cutout" or "fade" mode (not transparent mode, as it does not discard invisible pixels).

    I'm thinking if you don't discard invisible pixels, shadows will still be drawn where they would be.

    If that's not working, what shader are you using?
     
  4. LtCalumbo

    LtCalumbo

    Joined:
    Jan 28, 2014
    Posts:
    32
    Hi there, thanks for the reply.

    I'm using the standard shader. Transparency is set to cut out. The problem goes away if I use Legacy/Transparent/Cutout/Diffuse shader but everything else is using Standard shader so it kinda makes the trees have a different look/feel to everything else.

    It's really bugging me because I've been working on this a long time and it's only since Monday this is happening.