Search Unity

how to render hair without using "Cutout"

Discussion in 'General Graphics' started by MMedak, Oct 7, 2019.

  1. MMedak

    MMedak

    Joined:
    Sep 19, 2019
    Posts:
    2
    I'm trying to accomplish a soft fur effect within this project. Selecting "Fade" within the shader messes up the drawing of the polygons and "Cutout" makes the edges way too hard. Any advice on how to fix the drawing order issue with the shader?
    OMdXMukpOh.png
    Cutout doesn't have a draw order issue but the edges are choppy and hard

    Unity_H2KrK45CdQ.png
    Fade solves the hard edges but isn't rendered correctly.
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    That's a hard problem even on big production, everybody seems to have moved to cut out with special dithering shader, and anti aliasing solution.
     
  3. MMedak

    MMedak

    Joined:
    Sep 19, 2019
    Posts:
    2
    thanks I'll give that a shot! Any recommendations on what a good dithering shader to use would be?
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    1. find a blue noise texture (there is some in the HDRP sources)
    2. Apply the noise in screen space
    3. cut out based on distance, alpha +- the source noise value
    4. use a post process of your choice that smooth things out.
     
  5. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
  6. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    If anyone writes a shader that does this, I'd love to get pinged so I could use it for CC3 hair ...