Search Unity

Semitransparent shader issue. How can I fix it?

Discussion in 'Shaders' started by Acatist, Apr 10, 2021.

  1. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hello everybody! For a long time I have observed that semi-transparency shaders have a problem when two layers of the same object overlap, generating these problems.



    At first I thought it was my problem, some configuration, etc. But, I have looked in other forums, and I have found some solutions, but they do not fit my needs. In my case, as you can see in the first image, the problem appears in the hair of this character. The hair is from Daz3D and the result has come out excellent thanks to this taecg shader. https://assetstore.unity.com/packages/vfx/shaders/hair-shader-57226



    I would like to know how I could solve this problem even if I had to modify the shader a bit. Anyone know how I could fix it?
     
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    First of you cannot solve problem of single transparent object with overlapping/intersecting triangles since triangles are not sorted relative to the camera position.

    What you can do is to have a depth buffer pass with invisible color first, and than transparent pass.