Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Water behind trees error

Discussion in 'Unity 5 Pre-order Beta' started by Jaimi, Feb 16, 2015.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Does anyone know how to get past this?

    The water doesn't draw between the tree leaves - what you are seeing below is the dirt under the water. These are standard terrain trees (From manufacturer k4 medieval kit).

    WaterError.jpg

    I've tried changing the queue of the fxwaterpro shader, but it doesn't make any difference. This looks really nasty in game.
     
  2. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
  3. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Try clicking on the tree in the project view and then in the inspector, at the bottom of the tree branch graph, click the circle arrow for "Recompute Tree". I had similar problems and that fixed it for me.
     
  4. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Thanks for the suggestion. I tried this and was still looking at the same issue. I have tried using "Nature\Tree Creator Leaves" and "Nature\Tree Creator Leaves Fast" and both have the same issue. What I did find, is that if I change the Shadow Caster Res that I get a more refined alpha appearance and the coloring is not as noticeable, but that is simply because the alpha is cut closer to the leaves.

    Full Res Shadow - Small speckles still noticeable.


    1/16th Res - Large blocks of the alpha are now visible.

    I have a feeling it is something that is different in the optimized leaves shader causing it.I am hoping that the Advanced Foliage Shader is updated to Unity 5 soon so I can see if this issue persists.
     
  5. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350

    Attached Files:

  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Cool! I'll try this out when I get home, Thanks!
     
  7. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Seems to be closer. When putting the Alpha Cutoff to .9 or greater, it appears to ignore the shadows of it's own leaves and only looks at some type of depth render behind it. At that point, a lot of the finer details of the leaf textures are gone, unfortunately.

    I turned up the Shadow strength to see the results more clearly.



    The alpha area is gone, but now there is this odd shadow transfer.
     
  8. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Yeah if you open up that shader and scroll to near the bottom you'll see this line:
    Code (csharp):
    1. clip (alpha - _Cutoff - 0.1);
    You can try changing that "0.1" to something greater. The larger you make that value, the more it will shrink the shadow texture, which will get rid of the shimmer, but will unfortunately also make the leaf shadows smaller. Alpha Cutoff shouldn't be as high as 0.9 as that means it will remove the leaf shadows entirely. Try changing "Shadow Caster Res" to 1/2, but the Alpha Cutoff lower, like 0.2 or so, and maybe in the shader edit that clip subtraction up to .2 and see how that looks. Unfortunately you have to kind of fiddle with the numbers until it looks good. I can't figure out a way to reduce the crappy alpha outline without also reducing the size of the leaf shadows.
     
  9. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    @makeshiftwings, I took that idea and started playing with the amounts but seemed that no matter what I ended up losing the shadow on the ground as soon as the alpha reached a level that did not show the shadow generation. I did, however, start looking at the queue and placed the first part of the shader into the "Queue"="Geometry+501" point and it seemed to correct most of the issues. There are still some objects rendering in the wrong order, but it is greatly reduced from before. I am not much of a shader coder so it was a mere guess that got me this far, thankfully it worked as well as it did.